/* CO — "Trailhead". Bitter (sign plates, headings) + Outfit (body).
   Forest brown, aspen gold, alpine-lake blue, granite grey on snow cream. */
@font-face { font-family: "Bitter"; src: url("/assets/fonts/bitter.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 {
  --snow: #f8f4ea;       /* page */
  --white: #ffffff;
  --ink: #2a2520;        /* text, 13.8:1 on snow */
  --forest: #3b2a1c;     /* sign plates, footer */
  --plate-text: #f4ebd6; /* 11.5:1 on forest */
  --gold: #e3ae3a;       /* aspen gold: on lake 5.5:1, on forest 6.8:1 */
  --gold-text: #8a5b12;  /* gold for text on snow, 5.3:1 */
  --lake: #173f52;       /* hero band */
  --lake-link: #1e5a73;  /* links on snow, 6.9:1 */
  --granite: #565d63;    /* secondary text, 6.1:1 */
  --rule: #d8d0bf;
  --slab: "Bitter", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--snow); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
a { color: var(--lake-link); text-underline-offset: 3px; }
a:hover { color: var(--forest); }
:focus-visible { outline: 3px solid var(--lake-link); outline-offset: 3px; }
.band :focus-visible, .foot :focus-visible { outline-color: var(--gold); }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -100px; background: var(--forest); color: var(--plate-text); padding: 12px 16px; z-index: 20; }
.skip:focus { top: 8px; }

/* Masthead */
.masthead { background: var(--snow); border-bottom: 1px solid var(--rule); position: relative; z-index: 10; }
.mast-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.home { text-decoration: none; color: inherit; display: flex; align-items: center; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-code { font: 800 0.875rem/1 var(--slab); letter-spacing: 0.14em; background: var(--forest); color: var(--plate-text); padding: 7px 8px 7px 10px; border-radius: 3px; }
.brand-name { font: 700 1.0625rem/1.2 var(--slab); color: var(--ink); }
.nav-wide ul { display: flex; gap: 2px; }
.nav-wide a, .menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.nav-wide a:hover, .menu a:hover { color: var(--lake-link); text-decoration: underline; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; padding: 0 16px; display: flex; align-items: center; font: 700 0.875rem/1 var(--slab); letter-spacing: 0.12em; text-transform: uppercase; background: var(--forest); color: var(--plate-text); border-radius: 3px; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); background: var(--white); border: 2px solid var(--forest); border-radius: 3px; }
.menu li + li { border-top: 1px solid var(--rule); }
.menu a { min-height: 48px; padding: 0 16px; }
@media (max-width: 960px) { .nav-wide { display: none; } .menu { display: block; } }

/* Trailhead hero: photo, then a solid band carrying the text, then the credit */
.hero-img { width: 100%; height: min(70vh, 720px); min-height: 280px; object-fit: cover; object-position: 50% 30%; }
.band { background: var(--lake); color: var(--white); }
.band-inner { padding: 40px 0 44px; }
.hero-plain .band { background: var(--forest); }
.hero-plain .band-inner { padding-top: 24px; }
.band a { color: var(--white); }
h1 { font: 800 clamp(2rem, 4.2vw, 3.375rem)/1.1 var(--slab); letter-spacing: -0.01em; max-width: 20em; }
.lede { margin-top: 16px; font-size: 1.1875rem; line-height: 1.55; max-width: 40em; color: #e4edf1; }
.hero-plain .lede { color: var(--plate-text); }
.actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .btn-ghost { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 20px; font-weight: 600; font-size: 1rem; line-height: 1.25; text-decoration: none; border: 2px solid transparent; border-radius: 3px; }
.btn { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.band .btn { color: var(--ink); }
.btn:hover, .band .btn:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.btn-ghost { border-color: currentColor; color: var(--lake-link); }
.btn-ghost:hover { background: var(--lake-link); border-color: var(--lake-link); color: var(--white); }
.band .btn-ghost:hover { background: var(--white); border-color: var(--white); color: var(--lake); }
.hero-credit { display: block; padding: 10px 0; }

/* Next election, under the actions */
#lt-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.3); color: var(--white); text-decoration: none; min-height: 44px; }
#lt-next[hidden] { display: none; }
#lt-next [data-part="label"] { font: 700 0.8125rem/1.3 var(--slab); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
#lt-next [data-part="date"] { font: 800 1.625rem/1.2 var(--slab); }
#lt-next [data-part="type"] { text-decoration: underline; text-underline-offset: 3px; }
#lt-next:hover [data-part="type"] { color: var(--gold); }

/* Sections: each introduced by its sign plate */
.sec { padding: 64px 0 8px; scroll-margin-top: 16px; }
.plate { display: inline-block; max-width: 100%; background: var(--forest); color: var(--plate-text); font: 700 1rem/1.3 var(--slab); letter-spacing: 0.2em; text-transform: uppercase; padding: 13px 22px; border-radius: 4px; box-shadow: inset 0 0 0 4px var(--forest), inset 0 0 0 5px rgba(244, 235, 214, 0.45); }
h2 { font: 800 clamp(1.75rem, 3.2vw, 2.5rem)/1.15 var(--slab); margin: 18px 0 26px; max-width: 24em; }
h3 { font: 700 1.1875rem/1.3 var(--slab); }

/* Steps as a trail: distance-marker numbers on one line of travel */
.trail { position: relative; max-width: 50em; }
.step { position: relative; padding: 0 0 30px 0; }
/* the line of travel between markers */
.step:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 44px; bottom: -2px; border-left: 2px dashed var(--granite); opacity: 0.5; }
.step-body h3 { display: flex; align-items: baseline; gap: 0; }
.mile { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; margin-right: 10px; background: var(--gold); color: var(--ink); font: 800 1rem/1 var(--slab); border-radius: 3px; align-self: center; }
.sep { color: var(--gold-text); margin-right: 8px; font-weight: 800; }
.sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.step-body p { margin-top: 6px; padding-left: 46px; }
.step + .step { padding-top: 0; }
.step-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.step-links a, .links a, .bill a, .fvap a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.note { margin-top: 8px; max-width: 50em; padding: 16px 20px; background: var(--white); border-left: 5px solid var(--gold); }
.credit { font-size: 0.875rem; color: var(--granite); margin-top: 18px; }
.cta { margin-top: 26px; }
.fallback { color: var(--granite); max-width: 50em; }

/* Elections (live) */
.elections { max-width: 50em; border-top: 2px solid var(--forest); }
.election { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 20px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.election-date { font: 800 1.375rem/1.25 var(--slab); color: var(--lake); }
.election-type { font-weight: 500; }
.elections > .fallback { padding-top: 16px; }
.uocava { margin-top: 18px; background: var(--white); border: 1px solid var(--rule); border-radius: 3px; }
.uocava summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-weight: 600; }
.uocava[open] summary { border-bottom: 1px solid var(--rule); }
.uocava ul { padding: 12px 16px 0 34px; list-style: disc; }
.uocava li { padding: 3px 0; font-size: 0.9375rem; }
.fvap { padding: 6px 16px 10px; font-size: 0.9375rem; }

/* Bills (live) */
.bills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bills > .fallback, .bills > .updated { grid-column: 1 / -1; }
.bill { background: var(--white); border: 1px solid var(--rule); border-top: 5px solid var(--lake); border-radius: 3px; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bill-meta { font: 700 0.8125rem/1.3 var(--slab); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); }
.bill-title { font: 700 1.1875rem/1.3 var(--slab); overflow-wrap: anywhere; }
.bill-action { font-size: 0.9375rem; color: var(--granite); }
.bill a { margin-top: auto; }
.updated { font-size: 0.875rem; color: var(--granite); }

/* Resources */
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.sub { font: 700 0.875rem/1.3 var(--slab); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 8px; }
.links { border-top: 2px solid var(--forest); max-width: 40em; }
.links li { border-bottom: 1px solid var(--rule); }
.links a { width: 100%; padding: 6px 0; color: var(--ink); text-decoration: none; }
.links a:hover { color: var(--lake-link); text-decoration: underline; }

/* Counties */
.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); column-gap: 24px; border-top: 2px solid var(--forest); }
.county-grid li { border-bottom: 1px solid var(--rule); }
.county-grid a { display: flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 500; }
.county-grid a:hover { color: var(--lake-link); text-decoration: underline; }

/* About + capitol photo */
.about-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.about-grid h2 { margin-top: 18px; }
.prose p { max-width: 40em; }
.prose p + p { margin-top: 14px; }
.capitol { margin-top: 18px; }
.capitol img { border-radius: 3px; }
.capitol .credit { margin-top: 8px; }

/* County breadcrumb (inside the band) */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 0.875rem; margin-bottom: 14px; color: #e4edf1; }
.crumbs li { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--gold); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }

/* Footer */
.foot { background: var(--forest); color: var(--plate-text); margin-top: 72px; padding: 40px 0; }
.foot a { color: var(--plate-text); }
.foot a:hover { color: var(--gold); }
.foot-inner { display: grid; gap: 14px; }
.foot-brand { font: 700 1.0625rem/1.3 var(--slab); }
.foot .brand-code { box-shadow: inset 0 0 0 1px rgba(244, 235, 214, 0.5); margin-right: 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
.foot p { font-size: 0.875rem; }

@media (max-width: 960px) {
  .bills { grid-template-columns: minmax(0, 1fr); }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 640px) {
  .hero-img { height: 46vh; }
  .band-inner { padding: 28px 0 32px; }
  .sec { padding-top: 48px; }
  .res-grid { grid-template-columns: minmax(0, 1fr); }
  .election { grid-template-columns: minmax(0, 1fr); }
  .county-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .plate { letter-spacing: 0.14em; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* County details: facts, communities, history, neighbors */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 24px; margin: 0; border-top: 2px solid var(--forest); max-width: 60em; }
.fact { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.fact dt { font: 700 0.8125rem/1.3 var(--slab); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); }
.fact dd { margin: 4px 0 0; font: 700 1.25rem/1.3 var(--slab); color: var(--ink); }
.places { width: 100%; max-width: 40em; border-collapse: collapse; border-top: 2px solid var(--forest); }
.places thead th { font: 700 0.8125rem/1.3 var(--slab); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); text-align: left; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.places th, .places td { padding: 10px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.places tbody th { font-weight: 500; padding-right: 16px; }
.places td, .places thead th:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat { display: inline-block; margin-left: 6px; padding: 1px 8px; background: var(--forest); color: var(--plate-text); font: 700 0.6875rem/1.6 var(--slab); letter-spacing: 0.12em; text-transform: uppercase; border-radius: 3px; vertical-align: 1px; }
