/* IL — Chicago poster. Full-width colour bands on a strict 12-column grid. */
@font-face {
  font-family: "Bricolage";
  src: url("/assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --blue: #b3ddf2;   /* Chicago flag light blue — ink text only */
  --red: #c8102e;    /* star red, darkened: white on it 5.9:1, it on white 5.9:1 */
  --ink: #14171a;
  --white: #ffffff;
  --display: "Bricolage", "Arial Narrow", Arial, sans-serif;
  --body: "Public Sans", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(12px, 1.8vw, 28px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 4px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.band-red :focus-visible, .band-ink :focus-visible { outline-color: var(--white); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--white); padding: 12px 16px; z-index: 10;
}
.skip:focus { left: 16px; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* ---------- bands ---------- */
.band { padding: clamp(56px, 8vw, 128px) 0; }
.band-white { background: var(--white); color: var(--ink); }
.band-blue  { background: var(--blue);  color: var(--ink); }
.band-red   { background: var(--red);   color: var(--white); }
.band-ink   { background: var(--ink);   color: var(--white); }

/* ---------- type ---------- */
h1, h2, h3, .brand, .kicker, .step-n {
  font-family: var(--display);
  margin: 0;
}
h1, h2 { text-wrap: balance; }
h1 {
  font-weight: 800;
  font-size: clamp(2.9rem, 10vw, 10rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
}
h2 {
  font-weight: 800;
  font-size: clamp(2.5rem, 6.6vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: clamp(32px, 4.5vw, 72px);
}
h3 {
  font-weight: 700;
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.kicker {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.band-white .kicker { color: var(--red); }
p { margin: 0 0 1em; }

/* ---------- masthead ---------- */
.masthead {
  background: var(--white);
  border-bottom: 6px solid var(--ink);
  position: sticky; top: 0; z-index: 5;
}
.masthead .grid { align-items: center; min-height: 72px; }
.brand { grid-column: 1 / 5; font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; line-height: 1; padding: 12px 0; }
.brand a { text-decoration: none; display: inline-block; padding: 12px 0; margin: -12px 0; }
.brand a:hover span { text-decoration: underline; }
.brand span { color: var(--red); }
.primary { grid-column: 5 / -1; justify-self: end; }
.nav-wide { display: flex; gap: 4px; }
.nav-wide a, .menu-panel a {
  font: 600 1rem/1 var(--display);
  text-decoration: none;
  padding: 14px 14px;
  min-height: 44px;
  display: flex; align-items: center;
}
.nav-wide a:hover { background: var(--blue); }
.menu { display: none; position: relative; }
.menu summary {
  list-style: none; cursor: pointer;
  font: 700 1rem/1 var(--display);
  min-height: 44px; min-width: 44px; padding: 14px 18px;
  background: var(--ink); color: var(--white);
  display: flex; align-items: center;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--red); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 13px);
  width: min(320px, calc(100vw - 32px));
  background: var(--white); border: 6px solid var(--ink);
  display: flex; flex-direction: column;
}
.menu-panel a { padding: 16px 20px; font-size: 1.15rem; border-bottom: 2px solid var(--ink); }
.menu-panel a:last-child { border-bottom: 0; }
.menu-panel a:hover { background: var(--blue); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 112px); }
.hero h1 { grid-column: 1 / -1; margin-bottom: clamp(40px, 5vw, 80px); }
.hero-copy { grid-column: 1 / 6; align-self: start; }
.lede { font-size: clamp(1.15rem, 1.45vw, 1.35rem); line-height: 1.5; margin-bottom: 32px; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.btn, .btn-ghost {
  display: inline-flex; align-items: center;
  min-height: 52px; padding: 14px 22px;
  font: 700 1.05rem/1.2 var(--display);
  text-decoration: none;
  border: 3px solid currentColor;
}
.band-red .btn { background: var(--white); color: var(--ink); border-color: var(--white); }
.band-red .btn:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.band-red .btn-ghost:hover { background: var(--white); color: var(--red); border-color: var(--white); }
.next {
  display: block;
  border-top: 3px solid var(--white);
  padding: 16px 0 0;
  font-size: 1.05rem; text-decoration: none;
}
.next[hidden] { display: none; }
.next [data-part="label"] { display: block; margin-bottom: 4px; }
.next [data-part="date"] { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 2.2vw, 2rem); letter-spacing: -0.02em; }
.next [data-part="type"] { white-space: nowrap; }
.next:hover [data-part="type"] { text-decoration: underline; }
.capitol { grid-column: 7 / -1; margin: 0; }
.capitol img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
.capitol figcaption { font-size: 0.85rem; line-height: 1.5; margin-top: 12px; }

/* ---------- check ---------- */
#check h2 { grid-column: 1 / 10; }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap);
  margin-bottom: clamp(32px, 4vw, 56px);
}
.step { border-top: 6px solid var(--ink); padding-top: 20px; display: flex; flex-direction: column; }
.step-accent { border-top-color: var(--red); }
.step-n { font-weight: 800; font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1; letter-spacing: -0.04em; margin-bottom: 16px; }
.step-accent .step-n { color: var(--red); }
.step h3 { margin-bottom: 12px; }
.step-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.step-links a, .note a, .credit a, .about-body a, .fallback a, .footer-links a { font-weight: 600; }
.band-white .step-links a { color: var(--red); }
.step-links a { display: inline-flex; align-items: center; min-height: 44px; }
.note { grid-column: 1 / 9; font-size: 1rem; }
.band-white .note { border-left: 6px solid var(--blue); padding-left: 20px; }

/* ---------- elections ---------- */
#elections h2 { grid-column: 1 / 11; }
.elections { grid-column: 1 / 9; }
.credit { grid-column: 9 / -1; font-size: 0.95rem; align-self: start; border-top: 3px solid var(--ink); padding-top: 16px; }
.fallback { font-size: 1.15rem; max-width: 40ch; }
.election {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); column-gap: var(--gap);
  align-items: baseline;
  border-top: 3px solid var(--ink); padding: 18px 0;
}
.election:first-child { border-top-width: 6px; }
.election p { margin: 0; }
.election-date { font: 800 clamp(1.6rem, 3vw, 2.75rem)/1 var(--display); letter-spacing: -0.02em; }
.election-type { font-weight: 600; font-size: 1.05rem; }
.uocava { border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); margin-top: 8px; }
.uocava summary {
  cursor: pointer; min-height: 52px; padding: 14px 0;
  font: 700 1.1rem/1.3 var(--display);
  display: flex; align-items: center;
}
.uocava ul { margin: 0 0 16px; padding-left: 1.2em; font-size: 0.95rem; }
.uocava li { margin-bottom: 6px; }
.fvap { font-size: 0.95rem; }
.fvap a { font-weight: 700; display: inline-block; padding: 10px 0; }

/* ---------- legislation ---------- */
#legislation h2 { grid-column: 1 / 11; }
.bills {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 32px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.bills > .fallback, .bills > .updated { grid-column: 1 / -1; }
.bill { border-top: 6px solid var(--red); padding-top: 20px; display: flex; flex-direction: column; }
.bill-meta { font: 700 0.9rem/1.3 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
.bill-title { margin-bottom: 14px; }
.bill-action { font-size: 0.95rem; }
.bill a { margin-top: auto; font-weight: 700; color: var(--red); display: inline-flex; align-items: center; min-height: 44px; }
.updated { font-size: 0.9rem; margin: 0; }
.cta { margin: 0; }

/* ---------- resources ---------- */
.res-core { grid-column: 1 / 7; }
.res-info { grid-column: 7 / -1; }
.res-info h3 { display: flex; align-items: center; min-height: 56px; padding: 10px 0; border-bottom: 2px solid currentColor; font-weight: 800; }
.res-col { border-top: 6px solid currentColor; margin-bottom: 40px; }
.links { list-style: none; margin: 0; padding: 0; }
.links li { border-bottom: 2px solid currentColor; }
.links a {
  display: flex; align-items: center; min-height: 56px; padding: 10px 0;
  font: 700 clamp(1.15rem, 1.6vw, 1.45rem)/1.2 var(--display);
  text-decoration: none;
}
.links a::after { content: "→"; margin-left: auto; padding-left: 16px; }
.links a:hover { text-decoration: underline; }
.band-red .note { grid-column: 1 / 9; font-size: 1.05rem; }

/* ---------- counties ---------- */
#counties h2 { grid-column: 1 / 11; }
.county-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--gap);
  border-top: 6px solid var(--ink);
}
.county-grid li { border-bottom: 1px solid var(--ink); }
.county-grid a {
  display: flex; align-items: center; min-height: 48px;
  font: 700 1.05rem/1.15 var(--display); letter-spacing: -0.005em;
  text-decoration: none;
}
.county-grid a:hover { color: var(--red); text-decoration: underline; }

/* ---------- about ---------- */
#about h2, .split h2 { grid-column: 1 / 6; margin-bottom: 24px; }
.about-body { grid-column: 7 / -1; font-size: 1.15rem; }
.about-body p:last-child { margin: 0; }

/* ---------- footer ---------- */
footer.band { padding: 56px 0; }
.foot-brand { grid-column: 1 / 5; font-size: 1.6rem; }
.footer-links { grid-column: 5 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 28px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- county pages ---------- */
.county-hero .kicker { color: var(--white); }
.county-hero.no-image .hero-copy { grid-column: 1 / 8; }
.steps-2 { grid-column: 1 / 10; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.res-county { grid-column: 1 / 9; }
.credit-line { font-size: 0.9rem; }

/* county facts: poster numerals on a 4-up grid */
.facts {
  margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 32px;
}
.fact { border-top: 6px solid var(--ink); padding-top: 16px; }
.fact dt { font: 700 0.9rem/1.3 var(--display); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; }
.band-white .fact dt { color: var(--red); }
.fact dd { margin: 0; font: 800 clamp(1.6rem, 2.6vw, 2.5rem)/1.05 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }

/* largest communities: ranked rows, name left / population right */
.places { grid-column: 1 / 9; list-style: none; margin: 0; padding: 0; border-top: 6px solid var(--ink); counter-reset: place; }
.places li {
  display: flex; align-items: baseline; gap: 16px;
  border-bottom: 2px solid var(--ink); padding: 14px 0;
  counter-increment: place;
}
.places li::before { content: counter(place, decimal-leading-zero); font: 800 1rem/1 var(--display); min-width: 2.2em; }
.place-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 700 clamp(1.2rem, 1.8vw, 1.6rem)/1.15 var(--display); letter-spacing: -0.01em; }
.seat {
  display: inline-block;
  font: 700 0.75rem/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--ink); color: var(--white); padding: 6px 8px;
}
.place-pop { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.neighbor-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 0; row-gap: 0; }
.neighbor-grid li { border-top: 6px solid var(--ink); border-bottom: 0; }
.neighbor-grid a { min-height: 72px; font-size: clamp(1.2rem, 1.8vw, 1.6rem); }
.neighbor-grid a::after { content: "→"; margin-left: auto; padding-left: 12px; }
.band-blue .neighbor-grid a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-wide { display: none; }
  .menu { display: block; }
  .hero-copy { grid-column: 1 / 7; }
  .capitol { grid-column: 7 / -1; }
  .county-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .grid > *, .hero-copy, .capitol, .res-core, .res-info, .note, .band-red .note,
  .elections, .credit, #about h2, .split h2, .places, .about-body, .steps-2, .res-county, .county-hero.no-image .hero-copy, .foot-brand, .footer-links,
  #check h2, #elections h2, #legislation h2, #counties h2 { grid-column: 1 / -1; }
  .brand { grid-column: 1 / 9; }
  .primary { grid-column: 9 / -1; }
  .capitol { margin-top: 40px; }
  .steps, .bills { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .credit { margin-top: 32px; border-top: 0; padding-top: 0; }
  .county-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neighbor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-links { justify-content: flex-start; margin-top: 16px; }
  .election { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
}
@media (max-width: 420px) {
  h1 { letter-spacing: -0.03em; text-wrap: pretty; }
  .brand { font-size: 1.2rem; }
  .actions .btn, .actions .btn-ghost { width: 100%; }
}
