/* Find a Charter School: styled after njcharters.org (Avada theme palette, Roboto Slab + DM Sans). */
:root {
  --navy: #223e5c;      /* site DkBlue */
  --blue: #3461a6;      /* site BrightBlue */
  --sky: #58a9dd;       /* site LtBlue */
  --sky-soft: #e6f2fa;  /* site TransparentBlue */
  --gold: #f8cc27;      /* site Yellow */
  --coral: #db6046;     /* site Red */
  --teal: #5faca3;      /* site Green */
  --grey: #eeeeee;
  --ink: #1c2733;
  --muted: #5b6b80;
  --line: #dde5ee;
  --ok: #2f7f74;
  --ring: rgba(88, 169, 221, .45);
  --frame: #c6d6e6;     /* border of the list box and the map */
  --shadow: 0 8px 26px -10px rgba(34, 62, 92, .28);
  --shadow-sm: 0 2px 10px -4px rgba(34, 62, 92, .2);
  --font: "DM Sans", Arial, Helvetica, sans-serif;
  --font-head: "Roboto Slab", Georgia, serif;
  --wrap: 1440px;
  --gutter: 80px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: clip; }   /* the margin shapes run off the page edges on purpose */
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--ink);
  background: #fff;
  overflow-x: clip;   /* clip, not hidden: hidden would stop the map from staying in view as you scroll */
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: #105dd3; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
/* Page width follows njcharters.org: content up to 1440px, 80px side margins on desktop. */
.wrap { width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin: 0 auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 3000; background: var(--gold); color: var(--navy); padding: 8px 14px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 10px; }
svg { flex: none; }

/* ---------------------------------------------------------------- header (as on njcharters.org) */
.site-header { background: var(--navy); color: #fff; position: relative; z-index: 1001; }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 78px; }
.brand img { height: 42px; width: auto; display: block; }
.site-nav { display: flex; gap: 26px; margin-left: auto; }
.site-nav a { color: #fff; text-decoration: none; font-size: 16px; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: #fff; border-bottom-color: var(--sky); }

/* ---------------------------------------------------------------- page banner (as on njcharters.org's inner pages) */
.hero { position: relative; background: #fff; padding: 72px 0 44px; }
.hero-inner { position: relative; display: flex; align-items: center; gap: 32px; min-height: 250px; }
.hero-text { position: relative; z-index: 2; max-width: 760px; }
.hero h1 { font-family: var(--font-head); font-weight: 700; font-size: 56px; line-height: 1.12; color: var(--navy); margin: 0 0 18px; }
/* The site's own highlight (its .Highlight class): a soft yellow band over the lower half of the words. */
.hl { background-image: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(248, 204, 39, .5) 70%); }
.lede { font-size: 19px; margin: 0; color: var(--blue); max-width: 660px; }
.hero-art { position: relative; flex: none; width: 300px; height: 300px; margin-left: auto; margin-right: 60px; }
.hero-map { position: absolute; z-index: 2; right: 0; top: -30px; height: 310px; width: auto; pointer-events: none; }   /* clear of the language pill below */

/* ---------------------------------------------------------------- search and filter toolbar (colored band) */
.toolbar-band { position: relative; background: linear-gradient(180deg, var(--sky-soft) 0%, #f3f8fc 100%); padding: 0 0 10px; }
.toolbar-band > .wrap { position: relative; }
/* English / Español: a white pill on the toolbar's top edge, half over the banner and half over the toolbar. */
.lang-switch {
  position: absolute; z-index: 5; right: 26px; top: -6px; transform: translateY(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 6px; background: #fff; border-radius: 999px;
  box-shadow: 0 12px 26px -12px rgba(34, 62, 92, .5), 0 0 0 1px rgba(34, 62, 92, .07);
}
.lang-globe { width: 38px; height: 38px; margin-right: 2px; border-radius: 50%; background: var(--sky); color: #fff; display: grid; place-items: center; }
.lang-globe svg { width: 22px; height: 22px; }
.lang-switch button {
  border: 0; background: transparent; color: var(--navy); font-weight: 700; font-size: 15.5px; line-height: 1;
  padding: 11px 18px; border-radius: 999px; cursor: pointer; transition: background .15s;
}
.lang-switch button:hover { background: var(--sky-soft); }
.lang-switch button[aria-pressed="true"] { background: var(--gold); color: var(--navy); cursor: default; }
.search-card {
  position: relative; z-index: 3; top: -6px; background: var(--blue); color: #fff; border-radius: 16px;
  box-shadow: var(--shadow); padding: 40px 30px 24px; overflow: visible;   /* room under the language pill */
}
.search-card::before {   /* a soft light-blue glow in the corner, like the site's blue panels */
  content: ""; position: absolute; right: 0; top: 0; width: 360px; height: 100%; border-radius: 0 16px 16px 0; pointer-events: none;
  background: radial-gradient(ellipse at 100% 0%, rgba(88, 169, 221, .45), rgba(88, 169, 221, 0) 65%);
}
.search-main { position: relative; display: flex; gap: 14px; align-items: flex-end; }
.field.grow { flex: 1; min-width: 0; }
.search-buttons { display: flex; gap: 6px; align-items: center; }
.lbl { display: block; font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--navy); margin: 0 0 6px; }
.search-card .lbl { color: #fff; }
.help { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.search-card .help { color: #d6e6f6; position: relative; }

.combo { position: relative; }
.combo-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--sky); }
.combo input {
  width: 100%; height: 52px; padding: 0 44px 0 44px; font-size: 17px;
  border: 1.5px solid #c9d6e4; border-radius: 3px; background: #fff;
}
.combo input:focus, .field select:focus, .field input:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 4px var(--ring); }
.combo-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px;
  border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--muted); display: grid; place-items: center;
}
.combo-clear svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.combo-clear:hover { background: var(--sky-soft); color: var(--navy); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1100; list-style: none; margin: 0; padding: 6px;
  background: #fff; border-radius: 8px; box-shadow: var(--shadow); max-height: 330px; overflow-y: auto;
  color: var(--ink);   /* the list sits inside the blue search panel, whose text is white */
}
.combo-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--sky-soft); }
.combo-list .kind { font-size: 12px; color: var(--muted); flex: none; }
.combo-list .sub { color: var(--muted); }
.combo-list .note { color: var(--muted); font-size: 14px; cursor: default; }
.combo-list .note:hover { background: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 26px;
  border-radius: 3px; border: 1.5px solid transparent; cursor: pointer; font-size: 16px; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: var(--sky); color: #fff; text-transform: uppercase; letter-spacing: .4px; }
.btn-primary:hover { background: #3f97d2; color: #fff; }
.search-card .btn-primary { background: var(--gold); color: var(--navy); font-weight: 700; }
.search-card .btn-primary:hover { background: #ffd84a; color: var(--navy); }
.btn-link { background: transparent; color: var(--blue); padding: 0 12px; }
.btn-link:hover { background: var(--sky-soft); }
.search-card .btn-link { color: #fff; }
.search-card .btn-link:hover { background: rgba(255, 255, 255, .14); }
.btn-outline { background: #fff; color: var(--navy); border-color: #c9d6e4; }
.btn-outline:hover { border-color: var(--navy); }
.btn.small { height: 38px; padding: 0 14px; font-size: 15px; }
.btn[disabled] { opacity: .6; cursor: progress; }
#savedBtn[aria-pressed="true"] { background: #fdecea; border-color: var(--coral); color: #a33a24; }
#savedBtn[aria-pressed="true"] svg path { fill: var(--coral); stroke: var(--coral); }

.loc-status { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.loc-status:empty { display: none; }
.loc-status.ok { color: var(--ok); font-weight: 600; }
.loc-status.err { color: #b4432c; font-weight: 600; }
.search-card .loc-status { color: #dbe9f7; position: relative; }
.search-card .loc-status.ok { color: #c9f3e5; }
.search-card .loc-status.err { color: #ffd9cd; }

.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.search-card .filters { position: relative; border-top-color: rgba(255, 255, 255, .25); }
.search-card .combo input, .search-card .field select, .search-card .field input[type="search"] { border-color: #fff; color: var(--ink); }
.search-card .field select:disabled { background: #e3ecf6; color: #5b6b80; border-color: #e3ecf6; }
.search-card .combo input:focus, .search-card .field select:focus, .search-card .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(248, 204, 39, .45); }
.field select, .field input[type="search"] {
  width: 100%; height: 44px; padding: 0 12px; border: 1.5px solid #c9d6e4; border-radius: 3px; background: #fff; font-size: 16px;
}
.field select:disabled { background: #f4f6f9; color: var(--muted); }

/* ---------------------------------------------------------------- results + map */
/* Results band: pale blue to white, as on njcharters.org. */
.finder-band {
  position: relative; background: linear-gradient(180deg, #f3f8fc 0, #fff 640px); overflow: clip;
  /* Width of the side margin, outside the page width. The shapes below sit in it, as on njcharters.org. */
  --edge: calc((100% - min(var(--wrap), 100% - 2 * var(--gutter))) / 2);
}
.deco { position: absolute; z-index: 0; pointer-events: none; }
/* A large pale-blue circle cut off by the left edge of the window */
.deco-blob { width: 460px; height: 460px; border-radius: 50%; background: #deedf8; top: 70px; left: calc(var(--edge) - 460px + 30px); }
/* A small cluster lower in the left margin, as on the njcharters.org homepage: yellow triangle, light-blue ring, navy plus */
.deco-tri {
  width: 0; height: 0; top: 60%; left: calc(var(--edge) / 2 - 26px);
  border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 20px solid var(--gold);
}
.deco-dot { width: 42px; height: 42px; border-radius: 50%; border: 9px solid var(--sky); opacity: .75; top: calc(60% + 34px); left: calc(var(--edge) / 2 - 6px); }
.deco-plus { width: 20px; height: 20px; top: calc(60% + 96px); left: calc(var(--edge) / 2 - 22px); }
.deco-plus::before, .deco-plus::after { content: ""; position: absolute; background: var(--navy); border-radius: 2px; }
.deco-plus::before { left: 8px; top: 0; width: 4px; height: 20px; }
.deco-plus::after { top: 8px; left: 0; height: 4px; width: 20px; }
/* A pale-blue ring cut off by the right edge of the window */
.deco-ring {
  width: 300px; height: 300px; border-radius: 50%; border: 46px solid #d4e8f6;
  bottom: 40px; right: calc(var(--edge) - 300px + 30px);
}
/* The list and the map share one row as tall as the window, so both are in full view together. */
.finder {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: clamp(560px, calc(100vh - 56px), 1000px); gap: 32px; padding-top: 34px; padding-bottom: 64px;
}
.results-col { display: flex; flex-direction: column; min-height: 0; }
.list-box {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 14px;
  background: #f7fafd; border: 1px solid var(--frame); border-radius: 18px;
  scrollbar-width: thin; scrollbar-color: #a9c2da transparent;
}
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.count { margin: 0; font-family: var(--font-head); font-size: 26px; color: var(--navy); font-weight: 700; }
.count small { font-family: var(--font); font-weight: 400; font-size: 16px; color: var(--muted); }
.results-tools { display: flex; align-items: center; gap: 10px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.sort select { height: 38px; border: 1.5px solid #c9d6e4; border-radius: 3px; background: #fff; padding: 0 8px; font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 14px; border: 0;
  background: var(--sky); color: #fff; border-radius: 999px; font-size: 14.5px; cursor: pointer;
}
.chip svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.6; fill: none; }
.chip:hover { background: #3f97d2; }
.chip.clear { background: transparent; color: var(--blue); text-decoration: underline; padding: 0 6px; }

/* "You're in good company": charter students from the family's school district */
.community {
  display: flex; gap: 14px; align-items: flex-start; margin: 0 0 12px; padding: 14px 16px;
  background: #fff8e3; border: 1px solid #f1dd9a; border-radius: 14px;
}
.comm-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; }
.comm-icon svg { width: 24px; height: 24px; }
.comm-body { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.45; }
.comm-kicker { margin: 0 0 4px; font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--navy); }
.comm-name { margin: 6px 0 2px; font-weight: 700; color: var(--navy); }
.comm-name span { display: block; font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.comm-line, .comm-share { margin: 2px 0; }
.comm-line strong { color: var(--navy); }
.comm-share { color: #6b5000; }
.comm-dist + .comm-dist { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f1dd9a; }
.comm-which .kind { font-size: 12px; color: #1f6b62; background: #e3f3f1; border-radius: 999px; padding: 1px 8px; white-space: nowrap; display: inline-block; }
.comm-which { margin-top: 6px; }
.comm-which summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14.5px; }
.comm-which ul { list-style: none; margin: 8px 0 2px; padding: 0 6px 0 0; max-height: 150px; overflow-y: auto; display: grid; gap: 4px; scrollbar-width: thin; }
.comm-which li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.comm-which button { all: unset; cursor: pointer; color: var(--blue); }
.comm-which button:hover { text-decoration: underline; }
.comm-which button:focus-visible { outline: 3px solid var(--ring); border-radius: 3px; }
.comm-which .n { color: var(--muted); white-space: nowrap; }
.comm-src { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.panel ul.from { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.panel ul.from li.mine strong { color: var(--navy); }

.about { background: var(--sky-soft); border-radius: 12px; padding: 14px 18px; margin: 0 0 18px; }
.about summary { cursor: pointer; font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 17px; display: flex; align-items: center; gap: 10px; list-style: none; }
.about summary::-webkit-details-marker { display: none; }
.about summary svg { width: 20px; height: 20px; color: var(--blue); }
.about summary::after { content: "+"; margin-left: auto; font-family: var(--font); font-size: 22px; color: var(--blue); line-height: 1; }
.about[open] summary::after { content: "\2212"; }
.about-body { font-size: 16px; }
.about-body ul { margin: 10px 0 4px; padding-left: 20px; }
.about-body li { margin: 6px 0; }
/* Under the toolbar it is a drawer: tucked beneath the blue search panel, slightly inset, white. */
.toolbar-band .about {
  position: relative; z-index: 2; margin: -16px 22px 0; padding: 28px 24px 12px;
  background: #fff; border-radius: 0 0 14px 14px; box-shadow: var(--shadow-sm);
}
.toolbar-band .about summary { font-size: 16px; }
.toolbar-band .about[open] { padding-bottom: 16px; }
.toolbar-band .about-body { max-width: 1100px; padding-top: 4px; }
.toolbar-band .about-body ul { columns: 2; column-gap: 40px; }
.toolbar-band .about-body li { break-inside: avoid; }

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.results:focus { outline: none; }
.card {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); padding: 18px 18px 14px; position: relative;
  border: 2px solid transparent; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card.hot { border-color: var(--sky); box-shadow: var(--shadow); }
.card-top { display: flex; gap: 14px; align-items: flex-start; }
.badge-lvl {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--c); color: var(--k); box-shadow: inset 0 0 0 3px rgba(255,255,255,.35);
}
.badge-lvl svg { width: 26px; height: 26px; }
.card-main { flex: 1; min-width: 0; }
.network { display: block; font-size: 13.5px; color: var(--blue); font-weight: 600; margin-bottom: 1px; }
.card h3 { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 19px; line-height: 1.3; color: var(--navy); }
.card h3 button { all: unset; cursor: pointer; }
.card h3 button:hover { color: var(--blue); }
.card h3 button:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 3px; }
.campus { margin: 2px 0 0; color: var(--muted); font-size: 15.5px; }
.dist { flex: none; text-align: right; font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 18px; white-space: nowrap; line-height: 1.2; }
.dist small { display: block; font-family: var(--font); font-weight: 400; font-size: 13px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 10px 0 0 60px; font-size: 15px; }
.grades { background: var(--sky-soft); color: var(--navy); font-weight: 700; border-radius: 999px; padding: 2px 12px; font-size: 14.5px; }
.grades .q { font-weight: 400; color: var(--muted); }
.where { color: #3c4b5c; }
.via { font-size: 13.5px; color: #1f6b62; background: #e3f3f1; border-radius: 999px; padding: 2px 10px; }
.addr { margin: 6px 0 0 60px; font-size: 15.5px; color: #3c4b5c; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 12px 0 0 60px; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--blue); font-size: 15px; text-decoration: none; cursor: pointer; }
.act svg { width: 16px; height: 16px; }
.act:hover { color: #105dd3; text-decoration: underline; }
.act.more-btn { background: var(--sky); color: #fff; border-radius: 3px; padding: 6px 14px; text-decoration: none; }
.act.more-btn:hover { background: #3f97d2; color: #fff; text-decoration: none; }
.act.more-btn[aria-expanded="true"] { background: var(--navy); }
.card-top { padding-right: 42px; }
.save { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 0; background: #f4f6f9; cursor: pointer; color: #8a97a8; }
.save svg { width: 20px; height: 20px; }
.save svg path { fill: none; stroke: currentColor; stroke-width: 2; }
.save:hover { color: var(--coral); }
.save[aria-pressed="true"] { background: #fdecea; color: var(--coral); }
.save[aria-pressed="true"] svg path { fill: var(--coral); }

.details { margin: 14px 0 2px; display: grid; gap: 12px; }
.panel { border-radius: 12px; padding: 14px 16px; }
.panel.charter { background: var(--sky-soft); }
.panel.campus-panel { background: #fbf8f1; border: 1px solid #efe7d6; }
.panel h4 { margin: 0 0 8px; font-family: var(--font-head); font-size: 16px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.panel h4 .k { font-family: var(--font); font-weight: 400; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.panel dl { display: grid; grid-template-columns: 138px 1fr; gap: 6px 14px; margin: 0; font-size: 15.5px; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; }
.panel .src { color: var(--muted); font-size: 14px; }
.panel .note { margin: 10px 0 0; padding: 9px 12px; background: #fff6d6; color: #6b5000; border-radius: 8px; font-size: 14.5px; }
.panel .apply { margin: 10px 0 0; font-size: 15px; }
.siblings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.siblings li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.35; }
.siblings .g { display: block; }
.siblings .mini { width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--k); flex: none; }
.siblings .mini svg { width: 13px; height: 13px; }
.siblings button { all: unset; cursor: pointer; color: var(--blue); }
.siblings button:hover { text-decoration: underline; }
.siblings button:focus-visible { outline: 3px solid var(--ring); border-radius: 3px; }
.siblings .g { color: var(--muted); font-size: 14px; }
.siblings .here { font-weight: 700; color: var(--navy); }

/* "Showing 20 of 169" and the "Show 20 more" button under the list */
.more-row { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 0 8px; }
.more-count { margin: 0; color: var(--muted); font-size: 14.5px; }
.more-schools { height: 46px; padding: 0 30px; font-weight: 700; }

.empty { text-align: center; padding: 34px 16px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
.empty p { margin: 0 0 14px; color: var(--muted); }

.map-col { position: relative; min-height: 0; }
.map-frame { position: relative; height: 100%; }
/* The border is drawn as a ring in the shadow, so Leaflet's measurements are unchanged. */
#map {
  position: absolute; inset: 0; z-index: 1; border-radius: 18px; overflow: hidden; background: #f3efe6;
  box-shadow: 0 0 0 1px var(--frame), var(--shadow);
}
.map-close { display: none; }
/* Expanded map (desktop): app.js makes the frame fixed and animates it out to the window's right side. */
.map-frame.floating { position: fixed; z-index: 1400; }
.map-frame.animating { transition: top .38s cubic-bezier(.2, .75, .25, 1), left .38s cubic-bezier(.2, .75, .25, 1), width .38s cubic-bezier(.2, .75, .25, 1), height .38s cubic-bezier(.2, .75, .25, 1); }
.map-frame.floating #map { transition: border-radius .38s, box-shadow .38s; }
body.map-expanded #map { border-radius: 0; box-shadow: -1px 0 0 var(--frame), -18px 0 36px -18px rgba(34, 62, 92, .45); }
.map-expand {
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: #fff; color: var(--navy);
  box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer;
}
.map-expand:hover { background: var(--sky-soft); }
/* Recenter: a square button under the zoom buttons, in the same style */
.map-recenter {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: #fff; color: var(--navy);
  box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer;
}
.map-recenter:hover { background: var(--sky-soft); }
.map-recenter svg { width: 20px; height: 20px; }
.map-expand svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- map pieces */
.leaflet-container { font-family: var(--font); font-size: 14px; background: #f3efe6; }
.leaflet-bar a { color: var(--navy); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-sm) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; }
/* Padding sits on the wrapper: a margin on the content would collapse through it and touch the edges. */
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px 16px; }
.leaflet-popup-content { margin: 0; min-width: 230px; line-height: 1.4; }
.leaflet-container a.leaflet-popup-close-button { top: 6px; right: 6px; width: 26px; height: 26px; font-size: 20px; color: var(--muted); }
.pop .item { display: flex; gap: 10px; align-items: flex-start; }
.pop-region { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.4; color: #4a5a6a; }
.pop-region .swatch { flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 3px; background: rgba(88, 169, 221, .35); border: 1.5px solid #3461a6; }
.pop .item + .item { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pop .badge-lvl { width: 34px; height: 34px; }
.pop .badge-lvl svg { width: 20px; height: 20px; }
.pop h4 { margin: 0; font-family: var(--font-head); font-size: 15px; color: var(--navy); line-height: 1.3; }
.pop .sub { margin: 1px 0 0; color: var(--muted); font-size: 13.5px; }
.pop .g { display: inline-block; margin-top: 4px; font-weight: 700; font-size: 13px; background: var(--sky-soft); color: var(--navy); border-radius: 999px; padding: 1px 9px; }
.pop button { all: unset; display: block; margin-top: 8px; cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; }
.pop button:hover { text-decoration: underline; }
.pop .sib { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; }
.pop .sib .all { margin-top: 0; font-size: 13.5px; }
/* "+ N other campuses": a big pill half on, half off the card's bottom edge (like the language switch). Hovering,
   focusing or tapping it lights up the school's other campuses and fades the card. */
.leaflet-popup-content-wrapper { position: relative; }
.pop.has-chip { padding-bottom: 16px; }
.pop .sib-chip { all: unset; display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 7px; border-radius: 999px; cursor: pointer;
  background: #fff6d1; border: 1.5px solid #e2b31c; color: var(--navy); font-weight: 700; font-size: 13px; }
.pop .sib-chip.edge { position: absolute; left: 18px; bottom: -21px; z-index: 2; padding: 9px 16px 9px 12px; gap: 8px; font-size: 15px;
  background: #f8cc27; border: 3px solid #fff; box-shadow: 0 5px 16px rgba(34, 62, 92, .32); transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.pop .sib-chip:hover, .pop .sib-chip:focus-visible, .pop .sib-chip.on { background: #f8cc27; }
.pop .sib-chip.edge:hover, .pop .sib-chip.edge:focus-visible, .pop .sib-chip.edge.on { background: #ffd84a; transform: translateY(-1px) scale(1.04); box-shadow: 0 8px 22px rgba(34, 62, 92, .38); }
.pop .sib-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.pop .sib-chip:hover { text-decoration: none; }
/* A small school building: these are other buildings of the same school. */
.pop .sib-chip .bldg { flex: none; width: 16px; height: 16px; fill: none; stroke: #223e5c; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.pop .sib-chip.edge .bldg { width: 19px; height: 19px; }
/* The pill shows "+9" until it's hovered, focused or switched on; then "other campuses" opens out to the right. */
.pop .sib-chip .words { white-space: nowrap; }
.pop .sib-chip.edge .words { display: inline-block; max-width: 0; margin-left: -8px; overflow: hidden; opacity: 0; vertical-align: bottom;
  transition: max-width .28s ease, margin-left .28s ease, opacity .2s ease; }
.pop .sib-chip.edge:hover .words, .pop .sib-chip.edge:focus-visible .words, .pop .sib-chip.edge.on .words { max-width: 14em; margin-left: 0; opacity: 1; }
/* The lit campuses: each pin drops back into the map and bounces; a yellow halo sits at its foot and pulses out. */
@keyframes sib-drop {
  0% { transform: translateY(-48px) scale(1.2); opacity: 0; }
  45% { transform: translateY(0) scale(1.2); opacity: 1; }
  62% { transform: translateY(-12px) scale(1.22); }
  78% { transform: translateY(0) scale(1.2); }
  88% { transform: translateY(-3px) scale(1.2); }
  100% { transform: translateY(0) scale(1.2); }
}
@keyframes sib-ping { 0% { transform: scale(.55); opacity: .95; } 100% { transform: scale(2.7); opacity: 0; } }
@keyframes sib-ring { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.pin.sib-lit { z-index: 900 !important; }
/* While the school's campuses are lit, every other pin and bubble dims (Leaflet sets opacity inline, hence !important). */
.leaflet-marker-pane .leaflet-marker-icon { transition: opacity .25s ease; }
.peeking .leaflet-marker-pane .leaflet-marker-icon:not(.sib-lit):not(.sib-here) { opacity: .25 !important; }
.pin.sib-lit .pin-svg { transform: scale(1.2); animation: sib-drop .75s cubic-bezier(.3, .7, .4, 1) var(--d, 0s) both; }
.sib-halo { pointer-events: none; }
.sib-halo .ring, .sib-halo .ping { position: absolute; inset: 8px; border-radius: 50%; }
.sib-halo .ring { background: rgba(248, 204, 39, .7); border: 2.5px solid #223e5c; animation: sib-ring .45s ease-out calc(var(--d, 0s) + .3s) both; }
.sib-halo .ping { border: 3px solid #f8cc27; opacity: 0; animation: sib-ping 1.3s ease-out calc(var(--d, 0s) + .35s) 3; }
@media (prefers-reduced-motion: reduce) {
  .pin.sib-lit .pin-svg, .sib-halo .ring { animation: none; }
  .sib-halo .ping { display: none; }
}
.leaflet-popup .leaflet-popup-content-wrapper, .leaflet-popup .leaflet-popup-tip-container, .leaflet-popup .leaflet-popup-close-button,
.leaflet-popup .pop * { transition: opacity .18s ease, background-color .18s ease, box-shadow .18s ease; }
.leaflet-popup.peek .leaflet-popup-content-wrapper { background: transparent; box-shadow: none; }
.leaflet-popup.peek .leaflet-popup-tip-container, .leaflet-popup.peek .leaflet-popup-close-button { opacity: 0; }
.leaflet-popup.peek .pop *:not(.sib-chip):not(.sib-chip *):not(:has(.sib-chip)) { opacity: .07; }
.leaflet-popup.peek .sib-chip { box-shadow: 0 3px 12px rgba(34, 62, 92, .3); }

.cluster { background: none; }
.cluster span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--blue); color: #fff; font: 700 15px/1 var(--font-head);
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(88, 169, 221, .35), 0 3px 8px rgba(34, 62, 92, .35);
  transition: transform .15s;
}
.cluster:hover span { transform: scale(1.08); background: var(--navy); }
/* Hover label on a pin: a small card in the site's style, not the browser's plain tooltip. */
.leaflet-tooltip.pin-tip {
  background: #fff; color: var(--ink); border: 0; border-radius: 12px; padding: 10px 14px 10px 10px;
  box-shadow: var(--shadow); font-family: var(--font); white-space: normal; width: max-content; max-width: 280px;
}
.leaflet-tooltip-top.pin-tip::before { border-top-color: #fff; }
.pin-tip .tip { display: flex; gap: 10px; align-items: flex-start; }
.pin-tip .badge-lvl { width: 30px; height: 30px; box-shadow: none; }
.pin-tip .badge-lvl svg { width: 18px; height: 18px; }
.pin-tip strong { display: block; font-family: var(--font-head); font-size: 14.5px; line-height: 1.3; color: var(--navy); }
.pin-tip .sub { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }
.pin-tip .g { display: inline-block; margin-top: 4px; font-weight: 700; font-size: 12.5px; background: var(--sky-soft); color: var(--navy); border-radius: 999px; padding: 1px 9px; }
.pin-tip .more { display: block; margin-top: 4px; font-size: 12.5px; color: var(--blue); }
.pin { background: none; border: 0; }
.pin .pin-svg { display: block; filter: drop-shadow(0 3px 3px rgba(34, 62, 92, .35)); transform-origin: 50% 100%; transition: transform .18s cubic-bezier(.3, 1.6, .6, 1); }
.pin:hover .pin-svg, .pin.hot .pin-svg { transform: translateY(-3px) scale(1.25); }
.pin.hot .pin-svg path.body { stroke: var(--gold); }
.pin-count {
  position: absolute; right: -7px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #fff; color: var(--navy); font: 700 12px/20px var(--font); text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-svg { filter: drop-shadow(0 0 0 var(--sky)) drop-shadow(0 0 4px var(--sky)); }
.home-pin .pin-svg { animation: hop 1.6s ease-in-out 1; }
.home-pin .pulse { position: absolute; left: 50%; bottom: 0; width: 34px; height: 12px; margin-left: -17px; border-radius: 50%; background: rgba(248, 204, 39, .55); animation: pulse 2.2s ease-out infinite; }
@keyframes hop { 0%, 100% { transform: none; } 30% { transform: translateY(-10px); } 55% { transform: none; } 70% { transform: translateY(-4px); } }
@keyframes pulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.map-key { background: #fff; border-radius: 12px; box-shadow: var(--shadow-sm); font-size: 13.5px; color: #33475b; overflow: hidden; }
.map-key button.key-toggle { all: unset; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 14px; }
.map-key button.key-toggle:focus-visible { outline: 3px solid var(--ring); }
.map-key button.key-toggle::after { content: "\25BE"; font-size: 12px; color: var(--muted); }
.map-key.closed button.key-toggle::after { content: "\25B8"; }
.map-key ul { list-style: none; margin: 0; padding: 0 12px 10px; display: grid; gap: 5px; }
.map-key.closed ul { display: none; }
.map-key li { display: flex; align-items: center; gap: 8px; }
.map-key .badge-lvl { width: 24px; height: 24px; box-shadow: none; }
.map-key .badge-lvl svg { width: 15px; height: 15px; }

.view-toggle { display: none; }

/* ---------------------------------------------------------------- data notes, above the footer */
.data-notes { background: #fff; padding: 0 0 8px; }
.notes { font-size: 14px; line-height: 1.6; color: var(--muted); }
.notes > * { max-width: 980px; }
.notes h3 { margin: 0 0 6px; font-family: var(--font-head); color: var(--navy); font-size: 16px; }
.notes p { margin: 0 0 8px; }

/* ---------------------------------------------------------------- footer (the same as njcharters.org's) */
.site-footer { color: #fff; font-size: 14px; line-height: 21px; }
.footer-slant { display: block; width: 100%; height: 100px; fill: var(--navy); margin-bottom: -1px; }
.footer-body {
  background: var(--navy) url("assets/footer-shape.svg") no-repeat 100% 50% / contain;
  padding: 64px 0 24px;
}
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 562px); gap: 40px; }
.footer-logo { display: inline-block; margin-bottom: 18px; }
.footer-logo img { width: 300px; height: auto; display: block; }
.footer-org p { margin: 0 0 14px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #9ce1ff; text-decoration: underline; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; padding-left: 11px; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.footer-links h3 { margin: 0 0 11px; font-family: var(--font); font-weight: 600; font-size: 16px; line-height: 24px; color: var(--sky); }
.footer-base {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(90, 171, 221, .15);
}
.footer-base p { margin: 0; }
.footer-base p a { color: #9ce1ff; }
.social { display: flex; gap: 16px; }
.social a { display: grid; place-items: center; width: 24px; height: 24px; color: #fff; }
.social a:hover { color: #9ce1ff; }
.social svg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- tablet and phone */
@media (max-width: 1100px) {
  :root { --gutter: 24px; }
  .deco { display: none; }
  .site-nav { display: none; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field.wide { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  :root { --gutter: 14px; }
  .map-expand { display: none !important; }   /* phones already get a full-screen map */
  .header-inner { min-height: 64px; }
  .brand img { height: 34px; }
  .hero { padding: 30px 0 38px; }
  .hero-inner { min-height: 0; }
  .hero h1 { font-size: 34px; margin-bottom: 12px; }
  .lede { font-size: 16.5px; padding-right: 70px; }
  .hero-art { position: absolute; right: -4px; top: -16px; width: 110px; height: 170px; margin: 0; opacity: .75; }
  .hero-map { right: 0; top: 0; height: 170px; }
  .search-card { padding: 34px 16px 18px; top: 0; border-radius: 14px; }   /* room under the language pill */
  .toolbar-band .about { margin: -14px 10px 0; padding: 26px 16px 10px; }
  .toolbar-band .about-body ul { columns: 1; }
  .lang-switch { right: 12px; top: 0; padding: 4px; }
  .lang-globe { width: 32px; height: 32px; }
  .lang-globe svg { width: 19px; height: 19px; }
  .lang-switch button { font-size: 14.5px; padding: 9px 14px; }
  .search-main { flex-direction: column; align-items: stretch; }
  .search-buttons { justify-content: space-between; }
  .search-buttons .btn-primary { flex: 1; }
  .finder { display: block; padding-top: 22px; padding-bottom: 90px; }
  .results-col { display: block; }
  .list-box { overflow: visible; padding: 0; background: none; border: 0; border-radius: 0; }
  .map-col { display: none; }
  body[data-view="map"] { overflow: hidden; }
  body[data-view="map"] .map-col { display: block; position: fixed; inset: 0; z-index: 1500; background: #fff; }
  body[data-view="map"] .map-frame { position: absolute; inset: 0; height: auto; top: 0; }
  body[data-view="map"] #map { border-radius: 0; box-shadow: none; }
  body[data-view="map"] .map-close {
    display: inline-flex; align-items: center; gap: 8px; position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000;
    height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font-size: 16px; box-shadow: var(--shadow); cursor: pointer;
  }
  .map-close svg { width: 18px; height: 18px; }
  .leaflet-popup-content-wrapper { padding: 14px 14px 12px; }
  .leaflet-popup-content { min-width: 0; }
  .pop .sib-chip.edge { left: 12px; font-size: 14px; padding: 8px 14px 8px 10px; }
  .view-toggle {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1200;
    height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font-size: 16px;
    box-shadow: var(--shadow); cursor: pointer;
  }
  .view-toggle svg { width: 20px; height: 20px; }
  body[data-view="map"] .view-toggle { display: none; }
  .meta, .addr, .actions { margin-left: 0; }
  .panel dl { grid-template-columns: 1fr; gap: 0; }
  .panel dd { margin-bottom: 8px; }
  .footer-slant { height: 56px; }
  .footer-body { padding: 40px 0 88px; background-size: auto 70%; background-position: 100% 100%; }   /* room under the floating Map button */
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-cols { padding-left: 0; }
  .footer-logo img { width: 240px; }
}
@media (max-width: 480px) {
  .search-buttons { flex-direction: column; align-items: stretch; }
  .search-buttons .btn-primary { flex: none; }
  .search-buttons .btn-link { height: 40px; }
  .results-tools { width: 100%; }
  .sort { flex: 1; min-width: 0; }
  .sort select { flex: 1; min-width: 0; }
  .filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .field select, .field input[type="search"] { font-size: 15px; padding: 0 6px; }
  .count { font-size: 22px; }
}

/* ---------------------------------------------------------------- print: the list only */
@media print {
  .site-header, .hero-art, .toolbar-band, .lang-switch, .map-col, .view-toggle, .results-tools, .save, .actions, .about, .site-footer { display: none !important; }
  body { background: #fff; }
  .finder { display: block; }
  .list-box { overflow: visible; padding: 0; background: none; border: 0; }
  .deco { display: none; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid var(--line); }
}
