/* NJ — Wayfinding. One route line, numbered stops, station-sign plates. */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1d1f22;      /* charcoal: 16.5:1 on white */
  --ink-2: #4a4f55;    /* secondary text: 8.3:1 on white */
  --rule: #c9cdd2;
  --paper: #ffffff;
  --signal: #1747c9;   /* cobalt line colour: 7.5:1 on white */
  --rail: 48px;        /* x of the route line inside the page column */
  --disc: 56px;        /* stop marker diameter */
  --gut: 128px;        /* content offset from the page column edge */
  --line: 8px;
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-weight: 400;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 20;
  background: var(--ink); color: #fff; padding: 12px 16px; font-weight: 700;
}
.skip:focus { top: 8px; }

/* ---------- header: brand + the stop list ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 4px solid var(--ink);
}
.top-in {
  max-width: var(--max); margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 76px;
}
.brand { margin: 0; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.005em; text-transform: uppercase; }
.brand a { color: var(--ink); text-decoration: none; }
.brand-in { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.brand-code {
  display: inline-grid; place-items: center;
  background: var(--ink); color: #fff;
  font-size: 1rem; font-weight: 900; letter-spacing: 0.04em;
  width: 44px; height: 44px;
}
.stoplist ol, .menu ol { list-style: none; margin: 0; padding: 0; }
.stoplist ol { display: flex; gap: 4px; }
.stoplist a, .menu ol a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.n {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 4px solid var(--signal); background: #fff;
  font-size: 0.8125rem; font-weight: 800; letter-spacing: 0; line-height: 1;
}
.stoplist a:hover { color: var(--signal); }
.stoplist a:hover .n, .menu ol a:hover .n { background: var(--signal); color: #fff; }

.menu { display: none; position: relative; }
.menu summary {
  list-style: none; cursor: pointer;
  min-height: 44px; min-width: 88px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9375rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--signal); }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 16px);
  width: min(320px, calc(100vw - 32px));
  background: #fff; border: 4px solid var(--ink);
  padding: 8px 12px 16px;
}
.menu ol a { display: flex; min-height: 48px; border-bottom: 2px solid var(--rule); }
.menu-cta { margin: 14px 0 0; }
.menu-cta .btn { width: 100%; }

/* ---------- page column ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ---------- hero (before stop 1) ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "next next" "h1 h1" "copy fig";
  gap: 0 56px; align-items: start;
  padding: 64px 0 80px var(--gut);
}
.hero-copy { display: contents; }
.next { grid-area: next; justify-self: start;
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 6px;
  min-height: 44px; padding: 8px 14px; margin-bottom: 28px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: 0.9375rem; font-weight: 500;
}
.next [data-part="label"] { font-weight: 500; }
.next [data-part="date"] { font-weight: 800; }
.next [data-part="type"] { font-weight: 500; }
.next:hover { background: var(--signal); color: #fff; }
h1 {
  grid-area: h1; margin: 0 0 40px; max-width: 15em; text-wrap: balance;
  font-size: clamp(2.25rem, 4.6vw, 4.25rem);
  line-height: 1.02; font-weight: 850; letter-spacing: -0.03em;
}
.hero-text { grid-area: copy; }
.lede { margin: 0 0 32px; font-size: 1.25rem; color: var(--ink-2); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 12px 22px;
  font-weight: 750; font-size: 1rem; text-decoration: none; letter-spacing: 0.005em;
  border: 4px solid var(--signal);
}
.btn { background: var(--signal); color: #fff; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

.capitol { margin: 0; grid-area: fig; }
/* county pages: county name on a station plate, no next-election strip */
.hero-county { grid-template-areas: "next next" "h1 h1" "copy fig"; }
.hero .county-plate { grid-area: next; justify-self: start; margin-bottom: 28px; min-height: 56px; padding: 10px 22px; line-height: 1.15; max-width: 100%; }
.hero-solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "next" "h1" "copy"; }
.hero-solo .hero-text { max-width: 40em; }
.county-summary { max-width: 42em; margin: 0 0 12px; font-size: 1.1875rem; }
.capitol img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.capitol figcaption { margin-top: 10px; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.capitol figcaption a { color: var(--ink-2); }

/* ---------- the route ---------- */
.route section {
  position: relative;
  padding: 0 0 112px var(--gut);
}
/* the one line: each stop draws its own segment, so the line is continuous */
.route section::before {
  content: ""; position: absolute;
  left: calc(var(--rail) - var(--line) / 2); top: 0; bottom: 0;
  width: var(--line); background: var(--signal);
}
.route section:first-child::before { top: calc(var(--disc) / 2); }
.route section.terminus::before { bottom: auto; height: calc(var(--disc) / 2); }
.route section.terminus { padding-bottom: 96px; }

.sign { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; min-height: var(--disc); }
.stop {
  position: absolute; left: calc(var(--rail) - var(--disc) / 2); top: 0;
  width: var(--disc); height: var(--disc); border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: var(--line) solid var(--signal);
  font-size: 1.375rem; font-weight: 900; line-height: 1; color: var(--ink);
}
.terminus .stop { background: var(--ink); border-color: var(--ink); color: #fff; }
.plate {
  margin: 0;
  display: inline-flex; align-items: center;
  min-height: var(--disc); padding: 0 22px;
  background: var(--ink); color: #fff;
  font-size: 1.625rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1;
}
.kicker {
  margin: 0;
  font-size: 0.875rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-2);
}
h2 {
  margin: 28px 0 36px; max-width: 24em;
  font-size: clamp(1.875rem, 3.2vw, 2.875rem);
  line-height: 1.06; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance;
}
h3 { font-weight: 800; letter-spacing: -0.01em; }
.note, .credit { max-width: 46em; color: var(--ink-2); font-size: 1rem; margin: 32px 0 0; }
.fallback { margin: 0; max-width: 46em; }

/* stop 1 — three legs */
.legs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.leg { border-top: 6px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; }
.legs-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 980px; }
.leg-accent { border-top-color: var(--signal); }
.leg-n { margin: 0 0 6px; font-size: 0.875rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.leg-n::before { content: "Leg "; }
.leg h3 { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.15; }
.leg p { margin: 0 0 16px; }
.leg-links { margin-top: auto !important; display: flex; flex-direction: column; gap: 4px; }
.leg-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* stop 2 — departures board */
.board { border-top: 6px solid var(--ink); max-width: 980px; }
.board > .fallback { padding: 18px 0; border-bottom: 2px solid var(--ink); }
.election {
  display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 4px 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 2px solid var(--ink);
}
.election p { margin: 0; }
.election-date { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.election-type { font-size: 1.125rem; font-weight: 500; }
.uocava { margin-top: 24px; border: 3px solid var(--ink); padding: 0 18px; }
.uocava summary {
  min-height: 52px; display: flex; align-items: center; cursor: pointer;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9375rem;
}
.uocava[open] summary { border-bottom: 2px solid var(--rule); }
.uocava ul { margin: 14px 0; padding-left: 1.2em; font-size: 1rem; }
.uocava li { margin-bottom: 6px; }
.fvap { font-size: 1rem; margin: 0 0 16px; }
.fvap a { font-weight: 700; }

/* stop 3 — bills */
#lt-bills { max-width: 980px; border-top: 6px solid var(--ink); }
#lt-bills > .fallback { padding: 18px 0; }
.bill { padding: 22px 0; border-bottom: 2px solid var(--ink); }
.bill-meta { margin: 0 0 6px; font-size: 0.875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--signal); }
.bill-title { margin: 0 0 8px; font-size: 1.375rem; line-height: 1.25; font-weight: 750; }
.bill-action { margin: 0 0 8px; color: var(--ink-2); font-size: 1rem; }
.bill a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.updated { margin: 14px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.cta-row { margin: 32px 0 0; }

/* stop 4 — resources */
.links {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px;
  border-top: 6px solid var(--ink); max-width: 980px;
}
.links li { border-bottom: 2px solid var(--rule); }
.links a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 8px 0;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.0625rem;
}
.links a::after { content: "→"; color: var(--signal); font-weight: 800; }
.links a:hover { color: var(--signal); }
.sub { margin: 48px 0 16px; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* stop 5 — counties */
.counties {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 980px;
}
.counties a {
  display: flex; align-items: center; min-height: 48px; padding: 6px 14px;
  border: 2px solid var(--ink); color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 0.9375rem; line-height: 1.2;
}
.counties a:hover { background: var(--ink); color: #fff; }

/* county detail stops */
.facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; max-width: 980px; }
.facts div { border-top: 6px solid var(--ink); padding-top: 14px; }
.facts dt { font-size: 0.875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 1.375rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.places { list-style: none; margin: 0; padding: 0; max-width: 640px; border-top: 6px solid var(--ink); }
.places li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  min-height: 52px; padding: 12px 0; border-bottom: 2px solid var(--rule);
}
.place-name { font-weight: 700; font-size: 1.125rem; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.place-pop { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat {
  display: inline-block; padding: 3px 8px; background: var(--ink); color: #fff;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.3;
}

/* stop 6 — terminus */
.terminus p { max-width: 42em; margin: 0 0 18px; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #fff; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 48px 32px 56px calc(32px + var(--gut)); }
.foot-brand { margin-bottom: 16px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 28px; }
.foot-links a { color: #fff; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.foot-links a:hover { color: #c9d6ff; }
.foot p { color: #e4e6e9; }
.foot p a { color: #fff; }

/* ---------- narrower screens ---------- */
@media (max-width: 1080px) {
  .stoplist { display: none; }
  .menu { display: block; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "next" "h1" "copy" "fig"; gap: 0; }
  .capitol { margin-top: 40px; }
  .legs, .legs-2 { grid-template-columns: 1fr; }
  .counties { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --rail: 18px; --disc: 36px; --gut: 52px; --line: 6px; }
  body { font-size: 1.0625rem; }
  .top-in, main { padding: 0 16px; }
  .top-in { min-height: 64px; gap: 12px; }
  .menu summary { min-width: 0; padding: 0 14px; }
  .brand { font-size: 0.875rem; letter-spacing: 0.01em; white-space: nowrap; }
  .brand-code { width: 40px; height: 40px; font-size: 0.875rem; }
  .brand a { gap: 10px; }
  html { scroll-padding-top: 76px; }
  .hero { padding: 32px 0 56px; }
  h1 { margin-bottom: 24px; }
  .capitol { margin-top: 32px; }
  .lede { font-size: 1.125rem; }
  .actions { flex-direction: column; }
  .actions a { width: 100%; }
  .route section { padding-bottom: 80px; }
  .stop { font-size: 1rem; }
  .plate { font-size: 1.125rem; padding: 0 14px; letter-spacing: 0.07em; }
  .sign { gap: 8px 14px; }
  .kicker { flex-basis: 100%; font-size: 0.8125rem; }
  h2 { margin: 16px 0 28px; }
  .leg h3 { font-size: 1.3rem; }
  .election { grid-template-columns: 1fr; }
  .election-date { font-size: 1.25rem; }
  .links { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .facts dd { font-size: 1.1875rem; }
  .counties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counties a { font-size: 0.9375rem; padding: 6px 12px; }
  .hero .county-plate { min-height: 44px; margin-bottom: 20px; }
  .foot-in { padding: 40px 16px 48px; }
}
.nb { white-space: nowrap; }

/* Narrowest phones (≤400px): the one-line brand plus the menu button no longer fit; let the brand wrap. */
@media (max-width: 400px) {
  .brand { white-space: normal; font-size: 0.8125rem; line-height: 1.15; }
  .brand-code { width: 36px; height: 36px; flex: none; }
}
