/* MN — "The almanac" v2. Birch page, lake-blue headings & contents, one pine accent. */
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --birch: #f7f6f1;      /* page */
  --paper: #fdfcf9;      /* raised */
  --ink: #1b2630;        /* body (14:1) */
  --lake: #24486a;       /* headings, contents (8.6:1) */
  --lake-2: #46596a;     /* secondary (6.8:1) */
  --pine: #2b6447;       /* accent (6.6:1; white on pine 6.9:1) */
  --pine-dark: #1f4b35;
  --rule: #d9dbd5;
  --rule-strong: #a3adb5;
  --display: "Fraunces", Georgia, serif;
  --ui: "Outfit", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--birch); color: var(--ink); font: 400 1.0625rem/1.65 var(--ui); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--pine-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }
p { margin: 0 0 1rem; }
h1, h2, h3 { font-family: var(--display); color: var(--lake); margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .75rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: calc(75rem + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 5; background: var(--birch); border-bottom: 1px solid var(--rule); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 64px; }
.brand { margin: 0; font-family: var(--display); font-variation-settings: "opsz" 48; font-weight: 600; font-size: 1.35rem; line-height: 1; }
.brand { color: var(--lake); display: flex; align-items: center; min-height: 44px; }
.brand a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.brand a:hover { color: var(--pine); }
.brand em { font-weight: 400; color: var(--lake-2); }
.topnav { display: flex; gap: 0 1.6rem; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.topnav a:hover { color: var(--pine); text-decoration: underline; }
.menu { display: none; }

/* ---------- Hero: Contents spread ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 4.5rem; align-items: start; padding-top: 4.5rem; padding-bottom: 3.5rem; }
.next-election {
  display: inline-block; margin-bottom: 1.75rem; padding: .6rem 0; min-height: 44px; line-height: 1.5;
  border-top: 2px solid var(--pine); color: var(--pine); text-decoration: none; font-size: .95rem;
}
.next-election[hidden] { display: none; }
.next-election [data-part="date"] { font-weight: 600; color: var(--ink); }
.next-election:hover [data-part="type"] { text-decoration: underline; }
h1 {
  font-size: clamp(2.3rem, 1.3rem + 3vw, 4rem); line-height: 1.05; letter-spacing: -0.005em;
  font-weight: 500; font-variation-settings: "opsz" 110; margin-bottom: 1.5rem; text-wrap: balance;
}
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--lake-2); max-width: 36rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.btn, .btn-ghost {
  display: inline-flex; align-items: center; min-height: 48px; padding: .7rem 1.3rem;
  font: 600 1rem/1.25 var(--ui); text-decoration: none; border-radius: 2px;
}
.btn { background: var(--pine); color: #fff; border: 2px solid var(--pine); }
.btn:hover { background: var(--pine-dark); border-color: var(--pine-dark); color: #fff; }
.btn-ghost { color: var(--lake); border: 2px solid var(--lake); background: transparent; }
.btn-ghost:hover { background: var(--lake); color: #fff; }

.contents { border-top: 3px double var(--lake); padding-top: .6rem; }
.contents-title { margin: 0 0 .25rem; font-family: var(--display); font-variation-settings: "opsz" 24; font-style: italic; font-size: 1.05rem; color: var(--lake-2); }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents li { border-bottom: 1px solid var(--rule); }
.contents a { display: grid; grid-template-columns: 3.6rem 1fr; gap: 1rem; align-items: baseline; padding: .85rem 0; text-decoration: none; color: var(--lake); }
.contents .n { font-family: var(--display); font-variation-settings: "opsz" 144; font-weight: 300; font-size: 2.2rem; line-height: 1; color: var(--pine); }
.contents .l { display: block; font-family: var(--display); font-variation-settings: "opsz" 48; font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.contents .d { display: block; color: var(--lake-2); font-size: .95rem; line-height: 1.4; margin-top: .15rem; }
.contents a:hover .l { color: var(--pine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

/* ---------- Plate ---------- */
.plate { margin: 0 0 .5rem; border: 1px solid var(--rule-strong); background: var(--paper); padding: .75rem; }
.plate img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; object-position: 50% 45%; }
.plate figcaption { font-size: .82rem; line-height: 1.45; margin-top: .6rem; color: var(--lake-2); }

/* ---------- Sections ---------- */
main > section.wrap, main > .pair.wrap { margin-top: 5.5rem; }
main section { scroll-margin-top: 80px; }
.sec-head { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--lake); }
.sec-row { display: flex; align-items: baseline; gap: 1rem; }
.sec-n { margin: 0; flex: none; font-family: var(--display); font-variation-settings: "opsz" 144; font-weight: 300; font-size: clamp(2.6rem, 2rem + 2vw, 4rem); line-height: .9; color: var(--pine); }
.kicker { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--lake-2); }
h2 { font-size: clamp(1.7rem, 1.1rem + 1.8vw, 2.75rem); line-height: 1.1; font-weight: 500; font-variation-settings: "opsz" 110; }
h3 { font-size: 1.3rem; line-height: 1.25; font-weight: 600; font-variation-settings: "opsz" 36; }

/* §1 steps: three columns */
.steps { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 3rem; }
.step { display: flex; flex-direction: column; border-top: 1px solid var(--rule-strong); padding-top: 1.1rem; }
.step-n { margin: 0 0 .6rem; font-family: var(--display); font-variation-settings: "opsz" 144; font-size: 2.6rem; line-height: 1; font-weight: 300; color: var(--lake-2); }
.step-accent { border-top: 3px solid var(--pine); }
.step-accent .step-n { color: var(--pine); font-weight: 500; }
.step h3 { margin-bottom: .5rem; }
.step-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: auto 0 0 !important; }
.step-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.note, .credit { font-size: .95rem; color: var(--lake-2); border-left: 3px solid var(--pine); padding: .1rem 0 .1rem 1rem; margin-top: 1.75rem; max-width: 52rem; }
.credit { border-left-color: var(--rule-strong); font-size: .88rem; }
.fallback { color: var(--lake-2); }

/* §2 + §3 side by side */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 0 3.5rem; align-items: start; }
.pair h2 { font-size: clamp(1.6rem, 1.1rem + 1vw, 2rem); }

.election { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1.25rem; align-items: baseline; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.election p { margin: 0; }
.election-date { font-family: var(--display); font-variation-settings: "opsz" 36; font-size: 1.25rem; font-weight: 600; color: var(--lake); font-variant-numeric: tabular-nums; }
.uocava { margin-top: 1.25rem; border: 1px solid var(--rule-strong); background: var(--paper); }
.uocava summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: .6rem 1rem; font-weight: 600; color: var(--lake); }
.uocava summary:hover { color: var(--pine); }
.uocava ul { margin: 0; padding: .25rem 1rem .5rem 2.25rem; font-size: .93rem; }
.uocava li { margin-bottom: .45rem; }
.fvap { padding: 0 1rem .75rem; margin: 0; font-size: .93rem; }
.fvap a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.bill { padding: 0 0 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.bill-meta { margin: 0 0 .3rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--lake-2); }
.bill-title { font-size: 1.15rem; font-weight: 500; line-height: 1.3; margin-bottom: .5rem; }
.bill-action { font-size: .92rem; color: var(--lake-2); margin-bottom: .25rem; }
.bill a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.updated { font-size: .82rem; color: var(--lake-2); margin: 0; }
.cta { margin-top: 1.5rem; }

/* §4 resources: two columns */
.res-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 4rem; }
.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.index-list li { border-bottom: 1px solid var(--rule); }
.index-list a { display: flex; align-items: center; min-height: 50px; padding: .4rem 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.index-list a::after { content: "→"; margin-left: auto; padding-left: .75rem; color: var(--pine); }
.index-list a:hover { color: var(--pine); text-decoration: underline; }
.sub { font-size: 1.05rem; font-family: var(--ui); font-weight: 600; color: var(--lake-2); margin: 0 0 .6rem; }
.res-cols .note { margin-top: 1.5rem; }

/* §5 counties: wide grid */
.counties { list-style: none; margin: 0; padding: 0; columns: 5 11rem; column-gap: 2rem; }
.counties li { break-inside: avoid; border-bottom: 1px solid var(--rule); }
.counties a { display: flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-family: var(--display); font-variation-settings: "opsz" 24; font-size: 1.1rem; }
.counties a:hover { color: var(--pine); text-decoration: underline; }

/* County pages */
.hero-county { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); padding-top: 3.5rem; padding-bottom: 3rem; }
.hero-kicker { margin-bottom: 1rem; }
.hero-county h1 { font-size: clamp(2.1rem, 1.3rem + 2.4vw, 3.4rem); }
.contents-small .n { font-size: 1.8rem; }
.contents-small .l { font-size: 1.15rem; }
.contents-small a { grid-template-columns: 3rem 1fr; padding: .7rem 0; }
.steps-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary { max-width: 52rem; }
.summary > p:first-child { font-size: 1.15rem; line-height: 1.65; }
.note-top { margin-top: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 2.5rem; margin: 0; }
.facts > div { border-top: 1px solid var(--rule-strong); padding: .9rem 0 1.1rem; }
.facts dt { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--lake-2); margin-bottom: .35rem; }
.facts dd { margin: 0; font-family: var(--display); font-variation-settings: "opsz" 48; font-size: 1.6rem; line-height: 1.2; font-weight: 500; color: var(--lake); font-variant-numeric: tabular-nums; }
.places { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.places li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.place-name { font-family: var(--display); font-variation-settings: "opsz" 24; font-size: 1.15rem; color: var(--ink); }
.place-pop { color: var(--lake-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat { font-family: var(--ui); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--pine); margin-left: .4rem; white-space: nowrap; }
.history { max-width: 46rem; }
.history > p:first-child { font-size: 1.08rem; line-height: 1.7; }
.pair-county { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.neighbors { columns: 4 11rem; }

/* §6 about */
.about-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 4rem; }
#about { padding-bottom: 4rem; }

.foot { border-top: 1px solid var(--rule-strong); padding: 1.25rem 0 2.5rem; font-size: .92rem; color: var(--lake-2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 1.75rem; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--lake); }

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .topnav { display: none; }
  .menu { display: block; }
  .hero { grid-template-columns: 1fr; gap: 3rem; }
  .pair { grid-template-columns: 1fr; }
  .pair > section + section { margin-top: 4.5rem; }
  .steps { gap: 0 1.75rem; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .masthead-in { min-height: 56px; }
  .brand { font-size: 1.2rem; }
  .menu summary {
    list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center;
    padding: 0 .95rem; border: 1px solid var(--lake); color: var(--lake); font-weight: 600; font-size: .95rem;
  }
  .hero { padding-top: 2.25rem; padding-bottom: 2.5rem; gap: 2.5rem; }
  .lede { font-size: 1.1rem; }
  .btn, .btn-ghost { width: 100%; justify-content: center; text-align: center; }
  .contents a { grid-template-columns: 2.8rem 1fr; gap: .75rem; padding: .75rem 0; }
  .contents .n { font-size: 1.8rem; }
  .contents .l { font-size: 1.15rem; }
  .contents-small .d { display: none; }
  .contents-small a { padding: .45rem 0; align-items: center; min-height: 48px; }
  .contents-small .n { font-size: 1.5rem; }
  .plate { padding: .5rem; }
  .plate img { aspect-ratio: 3 / 2; }
  main > section.wrap, main > .pair.wrap { margin-top: 3.5rem; }
  .pair > section + section { margin-top: 3.5rem; }
  .sec-row { gap: .6rem; }
  .steps { grid-template-columns: 1fr; }
  .step { padding-bottom: 1.25rem; }
  .res-cols, .about-cols { grid-template-columns: 1fr; }
  .res-cols > div + div { margin-top: 2rem; }
  .counties { columns: 2; column-gap: 1.25rem; }
  .election { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
  .facts dd { font-size: 1.3rem; }
}

/* menu panel (used ≤1080px) */
.menu summary::-webkit-details-marker { display: none; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 .95rem; border: 1px solid var(--lake); color: var(--lake); font-weight: 600; }
.menu[open] summary { background: var(--lake); color: #fff; }
.menu nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 2px solid var(--lake); padding: .25rem var(--gutter) .75rem; }
.menu ol { list-style: none; margin: 0 auto; padding: 0; max-width: 75rem; }
.menu a { display: flex; align-items: baseline; gap: .85rem; min-height: 48px; padding: .7rem 0; color: var(--lake); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--rule); }
.menu .n { font-family: var(--display); color: var(--pine); min-width: 2rem; }
