/* VA — "Capitol front" */
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #faf6ee;      /* cream paper */
  --paper-2: #f2ebdd;    /* aside / hover wash */
  --ink: #1f2433;        /* 14.3:1 on paper */
  --ink-2: #5a5d68;      /* 6.1:1 on paper, 5.5:1 on paper-2 */
  --navy: #14284b;       /* Old Dominion navy, 13.6:1 on paper */
  --on-navy: #f4ead8;    /* 12.3:1 on navy */
  --on-navy-2: #c9d3e6;  /* 9.7:1 on navy */
  --brick: #9b2f22;      /* 6.9:1 on paper, 6.3:1 on paper-2 */
  --brick-ink: #7d2419;  /* hover, 9.1:1 */
  --rule: #d9cfbd;       /* hairlines (non-text) */
  --serif: "Lora", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --col: 680px;
  --margin: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brick); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brick-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.18; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--paper); padding: 10px 14px; }

/* ---------- masthead ---------- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.mast-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.home { color: var(--ink); text-decoration: none; display: inline-flex; }
.home:hover .brand-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.brand { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; color: var(--navy); }
.brand-name { font: 600 1.3125rem/1.15 var(--serif); }
.brand-sub { white-space: nowrap; font: 500 0.75rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-top: 2px; }
.nav-wide ul { display: flex; gap: 4px; }
.nav-wide a, .menu a { font: 500 0.9375rem/1 var(--sans); color: var(--ink); text-decoration: none; display: flex; align-items: center; min-height: 44px; }
.nav-wide a { padding: 0 12px; border-bottom: 2px solid transparent; }
.nav-wide a:hover { color: var(--brick); border-bottom-color: var(--brick); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font: 600 0.9375rem/1 var(--sans); color: var(--navy); border: 1.5px solid var(--navy); padding: 0 18px; min-height: 44px; display: flex; align-items: center; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--navy); color: var(--on-navy); }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); background: var(--paper); border: 1.5px solid var(--navy); z-index: 5; }
.menu li + li { border-top: 1px solid var(--rule); }
.menu a { padding: 0 18px; min-height: 48px; }
.menu a:hover { color: var(--brick); background: var(--paper-2); }
@media (max-width: 960px) { .nav-wide { display: none; } .menu { display: block; } }
@media (max-width: 420px) { .brand-sub { display: none; } .brand-name { font-size: 1.1875rem; } }

/* ---------- capitol front ---------- */
/* Grid rows: photo / band / caption. The figure spans all three via subgrid so its caption
   lands under the band; the band sits in the middle row and, on wide screens, laps up over
   the lower edge of the photo. Text only ever sits on the solid navy band. */
.front { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
.front-photo { margin: 0; grid-column: 1; grid-row: 1 / 4; display: grid; grid-template-rows: subgrid; }
.front-photo img { grid-row: 1; width: 100%; aspect-ratio: 1024 / 665; object-fit: cover; object-position: 50% 40%; }
.front-photo figcaption { grid-row: 3; padding: 10px 16px 0; font-size: 0.8125rem; line-height: 1.5; color: var(--ink-2); }
.front-photo figcaption a { color: var(--ink-2); }
.band { grid-column: 1; grid-row: 2; position: relative; z-index: 1; background: var(--navy); color: var(--on-navy); padding: 24px 16px 28px; }
.band-kicker { font: 600 0.8125rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-navy-2); margin-bottom: 10px; }
.band h1 { font-size: clamp(1.875rem, 1.3rem + 2.6vw, 3.25rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; max-width: 26ch; text-wrap: balance; }
@media (min-width: 720px) {
  .front-photo img { aspect-ratio: auto; height: min(68vh, 620px); }
  .front-photo figcaption { padding: 12px 32px 0; text-align: right; }
  .band { padding: 32px 32px 36px; }
}
@media (min-width: 1000px) {
  .band { width: min(1068px, calc(100% - 64px)); justify-self: center; margin-top: -132px; padding: 40px 32px 44px; }
  .front-photo figcaption { width: min(1004px, calc(100% - 128px)); justify-self: center; padding: 12px 0 0; }
}
/* No photo: the band is the hero on its own. */
.front-solo .band { width: 100%; margin: 0; padding-top: 40px; padding-bottom: 44px; }
@media (min-width: 1000px) { .front-solo .band { padding: 64px max(32px, calc((100% - 1004px) / 2)) 64px; } }

/* ---------- reading column + margin notes ---------- */
.col { max-width: calc(var(--col) + 32px); margin: 0 auto; padding: 0 16px 24px; }
.sect { padding: 44px 0; border-top: 1px solid var(--rule); }
.sect.opening { border-top: 0; padding-top: 32px; }
@media (min-width: 1000px) {
  .col { max-width: calc(var(--col) + var(--margin) + 64px + 64px); padding: 0 32px 40px; }
  .sect { display: grid; grid-template-columns: minmax(0, var(--col)) var(--margin); column-gap: 64px; align-items: start; padding: 56px 0; }
  .sect > :not(.margin-note) { grid-column: 1; }
  .sect.opening { padding-top: 44px; }
  .sect-wide > .sect-main { grid-column: 1 / -1; }
}
.label { font: 600 0.8125rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--brick); margin-bottom: 10px; }
h2 { font-size: clamp(1.625rem, 1.25rem + 1.4vw, 2.125rem); margin-bottom: 24px; text-wrap: balance; }
.lede { font: 400 1.25rem/1.6 var(--serif); color: var(--ink); }
.credit { margin-top: 20px; font-size: 0.9375rem; color: var(--ink-2); }
.cta { margin-top: 28px; }

/* pull-quote asides: inline under the section on narrow screens, in the margin on wide ones */
.margin-note { margin-top: 28px; padding: 18px 0 18px 20px; border-left: 3px solid var(--brick); font: italic 400 1.0625rem/1.55 var(--serif); color: var(--ink); }
.margin-note a { font-style: normal; font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 1000px) {
  .margin-note { grid-column: 2; grid-row: 1; margin-top: 72px; padding: 4px 0 4px 20px; position: sticky; top: 24px; }
}

/* actions */
.actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .btn-ghost { font: 600 0.9375rem/1.25 var(--sans); display: inline-flex; align-items: center; min-height: 48px; padding: 12px 18px; border: 2px solid var(--brick); text-decoration: none; }
.btn { background: var(--brick); color: #fff; }
.btn:hover { background: var(--brick-ink); border-color: var(--brick-ink); color: #fff; }
.btn-ghost { color: var(--navy); border-color: var(--navy); background: transparent; }
.btn-ghost:hover { color: var(--brick); border-color: var(--brick); background: var(--paper-2); }

/* next election */
.next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 24px; padding: 12px 16px; min-height: 48px; border-left: 3px solid var(--navy); background: var(--paper-2); color: var(--ink); text-decoration: none; }
#lt-next[hidden], .next[hidden] { display: none; }
.next [data-part="label"] { font-size: 0.875rem; color: var(--ink-2); }
.next [data-part="date"] { font: 600 1.125rem/1.3 var(--serif); color: var(--navy); }
.next [data-part="type"] { font-weight: 500; color: var(--brick); }
.next:hover [data-part="type"] { text-decoration: underline; }

/* steps */
.steps { counter-reset: none; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; padding: 20px 0; border-top: 1px solid var(--rule); }
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-no { font: 600 1.75rem/1 var(--serif); color: var(--ink-2); padding-top: 2px; }
.step-accent .step-no { color: var(--brick); }
.step-body h3 { font-size: 1.3125rem; margin-bottom: 6px; }
.step-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 0 24px; }
.step-links a { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

/* elections + bills (filled by app.js) */
.fallback { color: var(--ink-2); }
.elections { border-top: 1px solid var(--navy); }
.election { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.election-date { font: 600 1.1875rem/1.35 var(--serif); color: var(--navy); }
.election-type { color: var(--ink); }
@media (min-width: 560px) {
  .election { grid-template-columns: 220px minmax(0, 1fr); align-items: baseline; }
}
.elections > .fallback { padding-top: 16px; }
.uocava { border-bottom: 1px solid var(--rule); }
.uocava summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; color: var(--navy); }
.uocava summary:hover { color: var(--brick); }
.uocava ul { padding-bottom: 8px; }
.uocava li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.fvap { padding: 8px 0 16px; font-size: 0.9375rem; }
.fvap a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.bills { border-top: 1px solid var(--navy); }
.bills > .fallback { padding-top: 16px; }
.bill { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.bill-meta { font: 600 0.8125rem/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brick); margin-bottom: 6px; }
.bill-title { font-size: 1.1875rem; line-height: 1.35; }
.bill-action { margin-top: 8px; font-size: 0.9375rem; color: var(--ink-2); }
.bill a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-weight: 600; }
.updated { padding-top: 12px; font-size: 0.8125rem; color: var(--ink-2); }

/* resources */
.links { border-top: 1px solid var(--navy); }
.links li { border-bottom: 1px solid var(--rule); }
.links a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.links a::after { content: "\2192"; color: var(--brick); }
.links a:hover { color: var(--brick); text-decoration: underline; }
.res-info { margin-top: 36px; }
.res-info h3 { font-size: 1.25rem; margin-bottom: 14px; }
.res-info:has(> ul:empty) { display: none; }

/* counties — all localities, compact columns */
.county-list { columns: 2 9.5rem; column-gap: 24px; border-top: 1px solid var(--navy); padding-top: 8px; }
@media (min-width: 720px) { .county-list { columns: 5 10rem; column-gap: 28px; } }
.county-list li { break-inside: avoid; }
.county-list a { display: flex; align-items: center; min-height: 44px; padding: 4px 0; font-size: 0.9375rem; line-height: 1.3; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.county-list a:hover { color: var(--brick); text-decoration: underline; }

/* about */
.about p { max-width: 66ch; }
.about p + p { margin-top: 16px; }
.about .credit { margin-top: 16px; }

/* footer */
.foot { background: var(--navy); color: var(--on-navy); margin-top: 24px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 36px; }
.foot-brand { font: 600 1.125rem/1.3 var(--serif); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot a { color: var(--on-navy); display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; }
.foot a:hover { color: #fff; text-decoration-thickness: 2px; }
.foot :focus-visible { outline-color: var(--on-navy); }
.band :focus-visible { outline-color: var(--on-navy); }

@media (max-width: 560px) {
  .actions .btn, .actions .btn-ghost, .cta .btn-ghost { width: 100%; justify-content: center; text-align: center; }
}

/* county pages */
.crumbs ol { display: flex; flex-wrap: wrap; font-size: 0.875rem; color: var(--ink-2); padding: 6px 0; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; padding: 0 10px; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); display: inline-flex; align-items: center; min-height: 44px; }
.crumbs a:hover { color: var(--brick); }
@media (max-width: 560px) { .crumbs li[aria-current] { display: none; } }

/* align masthead, crumbs and footer with the reading column + margin */
.mast-inner, .crumbs, .foot-inner { max-width: 1068px; }

/* county detail sections: facts, communities, history, neighbors */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--navy); }
.facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font: 600 0.8125rem/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.facts dd { margin: 0; font: 600 1.1875rem/1.4 var(--serif); color: var(--navy); }
@media (min-width: 560px) { .facts > div { grid-template-columns: 200px minmax(0, 1fr); align-items: baseline; } }
.places-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--navy); font: 600 0.8125rem/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.places li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.place-name { font-weight: 500; }
.seat { display: inline-block; margin-left: 8px; font: 600 0.75rem/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brick); }
.place-pop { font: 500 1rem/1.4 var(--serif); font-variant-numeric: tabular-nums lining-nums; color: var(--ink); white-space: nowrap; }
.history { font: 400 1.125rem/1.7 var(--serif); }
.neighbor-list { columns: 2 12rem; }
@media (min-width: 720px) { .neighbor-list { columns: 3 12rem; } }
