/* ============ Berkley School Zone Checker — V2 ============
   Mobile-first. Tokens match the bus finder (bus-finder-v2.css). */

:root {
  --ink: #101418;
  --ink-soft: #45505c;
  --ink-faint: #5d6874;
  --paper: #f4f5f7;
  --surface: #ffffff;
  --hairline: #e3e6ea;
  --field: #f1f3f5;
  --brand-navy: #000078;
  --brand-teal: #007884;
  --in: #0b7a55;
  --in-tint: #e6f4ee;
  --out: #b3541e;
  --out-tint: #fbeee6;
  --check: #9a6700;
  --check-tint: #fdf3dc;
  --radius: 14px;
  --radius-lg: 18px;
  --pad: 20px;
  --focus: 0 0 0 3px #ffffff, 0 0 0 6px var(--brand-navy);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.zc-visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
html.embed { background: transparent; }
body { margin: 0; }

.zc {
  margin: 0 auto;
  max-width: 1180px;
  padding: 18px 16px 32px;
}
html.embed .zc { padding: 2px 0 6px; }

.zc a { color: var(--brand-navy); text-underline-offset: 2px; }
.zc :focus-visible { border-radius: 8px; box-shadow: var(--focus); outline: none; }
.zc h1, .zc h2, .zc h3, .zc p { margin: 0; }

.zc-intro { margin-bottom: 16px; }
.zc-intro h1 { color: var(--brand-navy); font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.02em; line-height: 1.15; }
.zc-intro p { color: var(--ink-soft); font-size: 17px; margin-top: 8px; max-width: 60ch; }
html.embed .zc-intro { display: none; }

.zc-noscript {
  background: var(--check-tint);
  border-left: 4px solid var(--check);
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.zc-layout { display: grid; gap: 14px; }

.zc-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--pad);
}
.zc-card h2 { color: var(--brand-navy); font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; }

/* ---------- search ---------- */
.zc-form {
  display: grid;
  gap: 8px 10px;
  grid-template-columns: 1fr auto;
  margin-top: 14px;
}
.zc-label { color: var(--ink); font-size: 15px; font-weight: 700; grid-column: 1 / -1; }
.zc-field { min-width: 0; position: relative; }
.zc-field input {
  appearance: none;
  background: var(--field);
  border: 1.5px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  height: 52px;
  padding: 0 44px 0 14px;
  width: 100%;
}
.zc-field input::placeholder { color: var(--ink-faint); opacity: 1; }
/* The clear button only appears once something is typed, so the example text can use its space. */
.zc-field input:placeholder-shown { padding-right: 14px; }
.zc-field input:focus { background: var(--surface); border-color: var(--brand-navy); box-shadow: 0 0 0 1.5px var(--brand-navy); outline: none; }
.zc-clear {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  height: 44px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 4px;
  top: 4px;
  width: 44px;
}
.zc-clear svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-width: 2.2; width: 18px; }

.zc-button {
  align-items: center;
  background: var(--brand-navy);
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  text-decoration: none;
}
.zc a.zc-button { color: #ffffff; }
.zc-button:hover { background: #00005c; }
.zc a.zc-button.is-quiet { background: var(--surface); border: 1.5px solid var(--brand-navy); color: var(--brand-navy); }
.zc a.zc-button.is-quiet:hover { background: #f0f0fa; }
.zc-button-link { font-size: 15px; min-height: 44px; padding: 0 18px; }

.zc-hint { color: var(--ink-soft); font-size: 13.5px; margin-top: 10px; }

.zc-suggestions {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 20, 24, 0.14);
  left: 0;
  list-style: none;
  margin: 6px 0 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1000;
}
.zc-suggestions li {
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  padding: 10px 10px;
}
.zc-suggestions li[aria-selected="true"], .zc-suggestions li:hover { background: #eef0fb; }
.zc-option-main { color: var(--ink); font-weight: 650; }
.zc-option-place { color: var(--ink-soft); }

/* ---------- answer ---------- */
.zc-answer {
  border-left: 5px solid var(--brand-navy);
  border-radius: 12px;
  margin-top: 16px;
  padding: 14px 16px 16px;
}
.zc-answer.is-in { background: var(--in-tint); border-left-color: var(--in); }
.zc-answer.is-out { background: var(--out-tint); border-left-color: var(--out); }
.zc-answer.is-check { background: var(--check-tint); border-left-color: var(--check); }
.zc-answer.is-unknown, .zc-answer.is-choose { background: var(--field); border-left-color: var(--ink-faint); }

.zc-badge { align-items: center; display: flex; font-size: 13px; font-weight: 800; gap: 7px; letter-spacing: 0.01em; }
.zc-dot { border-radius: 50%; display: inline-block; height: 10px; width: 10px; }
.is-in .zc-badge { color: #075c40; } .is-in .zc-dot { background: var(--in); }
.is-out .zc-badge { color: #8f3e12; } .is-out .zc-dot { background: var(--out); }
.is-check .zc-badge { color: #6e4a00; } .is-check .zc-dot { background: var(--check); }

.zc-answer-title { color: var(--ink); font-size: 18px; font-weight: 800; line-height: 1.35; margin-top: 4px !important; text-wrap: pretty; }
.zc-answer-place { color: var(--ink-soft); font-size: 14px; }
.zc-answer-place:empty { display: none; }
.zc-answer-note, .zc-answer-rule, .zc-answer-approx, .zc-answer-fix { color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; margin-top: 8px !important; text-wrap: pretty; }
.zc-answer-fix { color: var(--ink); margin: 0 0 6px !important; }
.zc-answer-rule { color: var(--ink); }
.zc-answer-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.zc-text-button {
  background: none;
  border: 0;
  color: var(--brand-navy);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 44px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.zc-choices { display: grid; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.zc-choice {
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  font: inherit;
  font-weight: 700;
  gap: 0 8px;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}
.zc-choice span { color: var(--ink-soft); font-weight: 500; }
.zc-choice:hover { border-color: var(--brand-navy); }

.zc-source { color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; margin-top: 12px !important; padding: 0 4px; }

/* ---------- map ---------- */
.zc-map-card { padding: 0; overflow: hidden; }
.zc-map-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 16px var(--pad) 12px;
}
.zc-map-actions { display: flex; gap: 8px; }
.zc-chip {
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  color: var(--brand-navy);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 0 16px;
}
.zc-chip:hover { border-color: var(--brand-navy); }

.zc-map {
  aspect-ratio: 4 / 3.4;
  background: #eef0f2;
  border-top: 1px solid var(--hairline);
  min-height: 300px;
  width: 100%;
  z-index: 0;
}
.zc-map.is-failed { align-items: center; display: flex; justify-content: center; padding: 20px; text-align: center; }
.zc-map.is-failed p { color: var(--ink-soft); }
.zc-map-key {
  align-items: center;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 4px 6px;
  padding: 10px var(--pad) 12px;
}
.zc-key-zone {
  background: rgba(0, 120, 132, 0.16);
  border: 2px solid var(--brand-navy);
  border-radius: 3px;
  display: inline-block;
  height: 14px;
  width: 18px;
}
.zc-touch-hint { display: none; }
html.touch .zc-touch-hint { display: inline; }

/* Leaflet details */
.zc .leaflet-container { font-family: inherit; }
.zc .leaflet-control-attribution { font-size: 10.5px; }
.zc .leaflet-bar a { color: var(--brand-navy); height: 36px; line-height: 36px; width: 36px; }
html.touch .zc .leaflet-bar a { font-size: 24px; height: 44px; line-height: 44px; width: 44px; }
.zc-tip {
  background: rgba(255, 255, 255, 0.95);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(16, 20, 24, 0.25);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 7px;
}
.zc-tip::before { display: none; }
.zc-tip-school { color: var(--brand-navy); }
.zc-pin svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); height: 42px; width: 32px; }
.zc-pin path { stroke: #ffffff; stroke-width: 2; }
.zc-pin circle { fill: #ffffff; }
.zc-pin.is-in path { fill: var(--in); }
.zc-pin.is-out path { fill: var(--out); }
.zc-pin.is-check path { fill: var(--check); }

/* ---------- A-Z ---------- */
.zc-streets { margin-top: 14px; padding: 0; }
.zc-streets-toggle {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  justify-content: space-between;
  min-height: 60px;
  padding: 14px var(--pad);
  text-align: left;
  width: 100%;
}
.zc-streets-title { color: var(--brand-navy); display: block; font-size: 17px; font-weight: 800; }
.zc-streets-count { color: var(--ink-soft); display: block; font-size: 13.5px; }
.zc-chevron { fill: none; height: 22px; stroke: var(--brand-navy); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; transition: transform 160ms ease; width: 22px; }
.zc-streets-toggle[aria-expanded="true"] .zc-chevron { transform: rotate(180deg); }
.zc-street-list { border-top: 1px solid var(--hairline); padding: 14px var(--pad) 18px; }
.zc-letter-picker { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); margin-bottom: 14px; }
.zc-letter-button {
  background: var(--field);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--brand-navy);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  min-height: 44px;
}
.zc-letter-button[aria-pressed="true"] { background: var(--brand-navy); color: #ffffff; }
.zc-letter { display: none; }
.zc-letter.is-current { display: block; }
.zc-streets-note { color: var(--ink-soft); column-span: all; font-size: 13.5px; margin-bottom: 10px !important; }
.zc-letter { break-inside: avoid; margin-bottom: 12px; }
.zc-letter h3 { color: var(--brand-navy); font-size: 15px; margin-bottom: 2px; }
.zc-letter ul { list-style: none; margin: 0; padding: 0; }
.zc-letter li { display: flex; flex-wrap: wrap; font-size: 14.5px; gap: 0 6px; padding: 3px 0; }
.zc-street-name { color: var(--ink); font-weight: 600; }
.zc-street-place { color: var(--ink-soft); }
.zc-part {
  background: var(--check-tint);
  border-radius: 999px;
  color: #6e4a00;
  font-size: 12px;
  font-weight: 750;
  padding: 0 8px;
}

/* Keep scrolled-to content clear of the school site's sticky header (111-121px from 960px). */
html.embed #zc-app * { scroll-margin-top: 16px; }

/* ---------- wider screens ---------- */

@media (min-width: 860px) {
  html.embed #zc-app * { scroll-margin-top: 140px; }
  .zc-layout { align-items: start; grid-template-columns: minmax(330px, 400px) 1fr; }
  .zc-map { aspect-ratio: auto; height: 540px; }
  .zc-letter-picker { display: none; }
  .zc-letters { columns: 3; column-gap: 28px; }
  .zc-letter { display: block; }
}
@media (min-width: 1100px) {
  .zc-letters { columns: 4; }
}
@media (max-width: 380px) {
  .zc { padding-left: 12px; padding-right: 12px; }
  :root { --pad: 16px; }
  .zc-button { padding: 0 16px; }
}
@media (max-width: 359px) {
  .zc-form { grid-template-columns: 1fr; }
  .zc-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .zc-chevron { transition: none; }
}
