@font-face { font-family: "Bitter"; src: url("/assets/fonts/bitter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/assets/fonts/sora.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --sand: #f4ead9;
  --sand-deep: #e9d8bc;
  --ink: #2a1f18;
  --muted: #5a4638;
  --terra: #9c4126;
  --terra-deep: #7e3119;
  --turq: #095e5a;
  --turq-fill: #3fb8ac;
  --rule: #cdb593;
  --display: "Bitter", Georgia, serif;
  --body: "Sora", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--sand); color: var(--ink); font: 400 1rem/1.65 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--turq); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--terra-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--sand); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- split ---------- */
.photo { margin: 0; position: relative; background: var(--ink); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 16px; background: rgba(32, 23, 17, .86); color: #f4ead9;
  font-size: .75rem; line-height: 1.5;
}
.photo figcaption a { color: #f4ead9; }
.photo figcaption a:hover { color: #fff; }


/* mobile first: photo on top, tall crop */
.photo { height: min(58vh, 500px); }
.photo img { object-position: 50% 72%; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 16px; background: var(--sand); border-bottom: 1px solid var(--rule);
}
.brand { white-space: nowrap; font: 700 1.125rem/1.2 var(--display); color: var(--ink); padding: 12px 0; }
.brand a { color: inherit; text-decoration: none; display: inline-block; padding: 10px 0; margin: -10px 0; }
.brand a:hover span { color: var(--terra-deep); }
.brand span { color: var(--terra); }
.nav-wide { display: none; }
.top ul { list-style: none; margin: 0; padding: 0; }
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; min-height: 44px; min-width: 44px; display: flex; align-items: center;
  padding: 0 16px; border: 1.5px solid var(--ink); font: 600 .875rem var(--body);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: var(--sand); }
.menu ul { box-shadow: 0 12px 24px rgba(42,31,24,.18); position: absolute; right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); background: var(--sand); border: 1.5px solid var(--ink); padding: 6px 0; }
.menu a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--ink); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--sand-deep); }

/* ---------- content ---------- */
main { padding: 0 16px; }
.hero .kicker { margin-bottom: 14px; }
.hero { padding: 40px 0 48px; border-bottom: 1px solid var(--rule); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); }
h1 { font-weight: 700; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.15rem); line-height: 1.08; letter-spacing: -.015em; margin: 0 0 20px; text-wrap: balance; }
.lede { font-size: 1.075rem; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .btn-ghost {
  display: inline-flex; align-items: center; min-height: 48px; padding: 12px 20px;
  font: 600 .95rem/1.3 var(--body); text-decoration: none; border: 2px solid var(--terra);
}
.btn { background: var(--terra); color: #fff; }
.btn:hover { background: var(--terra-deep); border-color: var(--terra-deep); color: #fff; }
.btn-ghost { color: var(--terra-deep); background: transparent; }
.btn-ghost:hover { background: var(--terra); color: #fff; }
.next {
  display: block; margin-top: 28px; padding: 14px 16px; min-height: 44px;
  border-left: 6px solid var(--turq-fill); background: var(--sand-deep);
  color: var(--ink); text-decoration: none; font-size: .95rem;
}
.next:hover { color: var(--ink); background: #e2cca9; }
.next[hidden] { display: none; }
.next [data-part="label"] { color: var(--muted); }
.next [data-part="date"] { font-family: var(--display); font-weight: 700; font-size: 1.08em; }
.next [data-part="type"] { color: var(--ink); }

.block { padding: 48px 0; border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.kicker { margin: 0 0 6px; font: 600 .78rem/1.4 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--terra); }
h2 { font-weight: 700; font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.15; margin: 0 0 24px; text-wrap: balance; }
h3 { font-weight: 600; font-size: 1.2rem; line-height: 1.3; margin: 0 0 6px; }
.note, .credit { font-size: .9rem; color: var(--muted); }
.note { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.credit { margin: 20px 0 0; }

.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0 12px; padding: 20px 0; border-top: 1px solid var(--rule); }
.step:first-child { border-top: 0; padding-top: 4px; }
.step-n { font: 700 1.6rem/1.2 var(--display); color: var(--terra); }
.step p { margin: 0 0 8px; }
.step-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.step-links a, .credit a, .note a, .cta a, #about a { font-weight: 600; }
.step-links a { display: inline-flex; align-items: center; min-height: 44px; }
.step-accent { background: var(--sand-deep); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-left: 6px solid var(--turq-fill); }
.step-accent + .step { border-top: 0; }

/* elections (app.js) */
.elections > p { margin: 0; }
.election { display: grid; grid-template-columns: 1fr; padding: 14px 0; border-top: 1px solid var(--rule); }
.election:first-child { border-top: 2px solid var(--ink); }
.election p { margin: 0; }
.election-date { font: 700 1.2rem/1.3 var(--display); }
.election-type { color: var(--muted); font-size: .95rem; }
.uocava { margin-top: 20px; border: 1.5px solid var(--ink); }
.uocava summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 10px 16px; font-weight: 600; }
.uocava[open] summary { border-bottom: 1px solid var(--rule); }
.uocava ul { margin: 0; padding: 12px 16px 4px 36px; font-size: .9rem; }
.uocava li { margin-bottom: 8px; }
.fvap { margin: 0; padding: 4px 16px 14px; font-size: .9rem; }
.fvap a { font-weight: 600; }

/* bills (app.js) */
.bills > p:not(.updated) { margin: 0; }
.bill { padding: 20px 0; border-top: 1px solid var(--rule); }
.bill:first-child { border-top: 2px solid var(--ink); }
.bill-meta { margin: 0 0 4px; font: 600 .78rem/1.4 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--terra); }
.bill-title { font-size: 1.15rem; margin: 0 0 8px; }
.bill-action { margin: 0 0 6px; font-size: .9rem; color: var(--muted); }
.bill a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.updated { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.cta { margin: 24px 0 0; }

/* resources */
.links { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.links li { border-bottom: 1px solid var(--rule); }
.links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.links a::after { content: "→"; color: var(--terra); }
.links a:hover { color: var(--terra-deep); }
.links a:hover::after { color: var(--turq); }
.sub { margin: 40px 0 14px; font-size: 1.25rem; }
/* info list is filled live by app.js; until it has items, hide the empty pair */
.links:empty, .sub:has(+ .links:empty) { display: none; }

/* counties */
.counties { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; border-top: 2px solid var(--ink); }
.counties li { border-bottom: 1px solid var(--rule); }
.counties a { display: flex; align-items: center; min-height: 44px; padding: 4px 0; line-height: 1.3; font-size: .95rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.counties a:hover { color: var(--terra-deep); text-decoration: underline; }

#about p { max-width: 36em; }
#about p { margin: 0 0 16px; }

/* county details */
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.facts div { padding: 14px 16px 16px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font: 600 .78rem/1.4 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--terra); margin-bottom: 4px; }
.facts dd { margin: 0; font: 700 1.2rem/1.3 var(--display); }
.places { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.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 { margin-left: 8px; font: 600 .72rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--terra); white-space: nowrap; }
.place-pop { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.history { margin: 0; max-width: 40em; }

/* footer */
.foot { padding: 28px 16px 40px; background: var(--ink); color: var(--sand); font-size: .875rem; }
.foot ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot a { color: var(--sand); display: inline-flex; align-items: center; min-height: 44px; }
.foot a:hover { color: #fff; }

/* ---------- desktop: split hero, then full-width sheet ---------- */
@media (min-width: 960px) {
  body.home { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
  .home main { display: contents; }
  .home .photo { grid-column: 1; grid-row: 1 / 3; height: auto; min-height: 100vh; }
  .county.home .photo { min-height: 72vh; }
  .photo img { position: absolute; inset: 0; object-position: 50% 62%; }
  .county .photo img { object-position: 50% 50%; }
  .photo figcaption { padding: 14px 28px; }
  .home .top { grid-column: 2; grid-row: 1; position: static; padding: 10px 48px; }
  .home .hero { grid-column: 2; grid-row: 2; align-self: center; padding: 64px 48px 72px; border-bottom: 0; }
  .home .sheet, .foot { grid-column: 1 / -1; }
  /* county page without an image: full-width sand hero */
  .flat .top { padding-left: max(48px, calc((100vw - 76rem) / 2 + 48px)); padding-right: max(40px, calc((100vw - 76rem) / 2 + 40px)); }
  .flat main { padding: 0; }
  .flat .hero { max-width: 76rem; margin: 0 auto; padding: 88px 48px 80px; border-bottom: 0; }
  .flat .hero h1 { font-size: clamp(2.6rem, 1.6rem + 2.6vw, 3.8rem); max-width: 16em; }
  .flat .hero .lede { max-width: 38em; }
  .flat .sheet > .block:first-child { border-top: 1px solid var(--rule); }
  .sheet { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 48px; border-top: 0; }
  .foot { padding: 32px max(48px, calc((100vw - 76rem) / 2 + 48px)) 48px; }
  .block { padding: 72px 0; }

  /* steps: three columns */
  #check h2 { max-width: 20em; }
  .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
  .step, .step:first-child { grid-template-columns: 1fr; align-content: start; padding: 24px 28px 28px; border-top: 0; border-left: 1px solid var(--rule); }
  .step:first-child { border-left: 0; padding-left: 0; }
  .step-n { margin-bottom: 10px; }
  .steps .step-accent { margin: 0; border-left: 0; border-top: 6px solid var(--turq-fill); padding-top: 18px; }
  .step-accent + .step { border-left: 0; }

  /* elections + legislation side by side */
  .pair { display: grid; grid-template-columns: 5fr 7fr; gap: 0 64px; border-bottom: 1px solid var(--rule); }
  .pair .block { border-bottom: 0; }
  .pair #legislation { border-left: 1px solid var(--rule); padding-left: 64px; margin-left: -32px; }
  .pair #elections { padding-right: 0; }

  /* resources: core list in two columns + side column */
  .res { display: grid; grid-template-columns: 2fr 1fr; gap: 0 56px; align-items: start; }
  .res-col:first-child .links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .res-col .sub { margin-top: 0; }
  .res-col .note { margin-top: 0; border-top: 2px solid var(--ink); padding-top: 14px; }
  .sub:not(:has(+ .links:empty)) ~ .note { border-top: 1px solid var(--rule); margin-top: 24px; }

  /* counties: wide grid */
  .counties { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); column-gap: 32px; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts div { padding: 18px 24px 22px 0; }
  .facts dd { font-size: 1.45rem; }
  #history { border-left: 1px solid var(--rule); padding-left: 64px; margin-left: -32px; }
  .pair #places, .pair #history { border-bottom: 0; }
  .steps-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-2 .step-accent:first-child { padding-left: 28px; }
  .steps-2 .step-accent + .step { border-left: 0; }

  /* about: heading left, text right */
  #about-county { display: grid; grid-template-columns: 1fr 2fr; gap: 0 56px; }
  #about-county .about-body { max-width: 40em; columns: auto; }
  #about-county .about-body p { margin: 0 0 12px; }
  #about-county h2 { margin: 0; }
  #about { display: grid; grid-template-columns: 1fr 2fr; gap: 0 56px; }
  .about-body { columns: 2; column-gap: 40px; }
  #about .about-body p { margin: 0 0 16px; break-inside: avoid; }
}
@media (min-width: 1240px) {
  .menu { display: none; }
  .nav-wide { display: flex; gap: 0; margin-right: -6px; }
  .nav-wide a { white-space: nowrap; display: flex; align-items: center; min-height: 44px; padding: 0 7px; color: var(--ink); text-decoration: none; font-size: .8rem; font-weight: 500; }
  .nav-wide a:hover { color: var(--terra-deep); text-decoration: underline; }
  .top { padding: 10px 40px 10px 48px; }
  .brand span { display: block; }
}
