/* ============================================================
   Pflugerville Fire Department (ESD 2) reference — design system
   Municipal look: indigo/purple brand, maroon CTA bands, gold accents,
   bright white content, photo-forward. Light theme only.
   ============================================================ */

:root {
  color-scheme: light;

  /* Brand */
  --brand: #3a2b8f;
  --brand-dark: #2c2170;
  --brand-2: #4a3aa9;
  --maroon: #8a2b2b;
  --maroon-dark: #742222;
  --gold: #f2c33f;
  --gold-ink: #4a3708;
  --red: #c0342a;
  --red-dark: #a02a22;

  /* Surfaces & ink */
  --page: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #eceef4;
  --text-primary: #20242e;
  --text-secondary: #444a56;
  --muted: #6f7683;
  --grid: #e7e9f0;
  --axis: #c7cbd6;
  --border: #e3e5ee;
  --border-strong: #d1d4e0;

  /* Chart series (validated CVD-safe palette) */
  --series-1: #2a78d6;
  --series-2: #008300;
  --series-3: #e87ba4;
  --series-4: #eda100;
  --series-5: #1baf7a;
  --series-6: #eb6834;
  --series-8: #e34948;
  --status-good: #0ca30c;
  --status-critical: #d03b3b;
  --status-warning: #b06a00;

  --maxw: 1180px;
  --readw: 730px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,24,40,.05), 0 6px 20px rgba(20,24,40,.07);
  --shadow-lg: 0 2px 6px rgba(20,24,40,.08), 0 18px 40px rgba(20,24,40,.12);
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Oswald", "Source Sans 3", system-ui, sans-serif;
  --hero-img: url("/assets/img/photos/banner.jpg");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: light; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; font-family: var(--font); background: var(--page); color: var(--text-primary); line-height: 1.62; font-size: 1.04rem; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--maroon); }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.prose { max-width: var(--readw); }
.prose > * + * { margin-top: 1.1em; }

/* ---------- Photo slots ---------- */
.photo { display: block; position: relative; overflow: hidden; background: #e6e8ef; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Header (single line) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(20,20,50,.18); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; flex: none; }
.brand:hover { color: #fff; }
.brand .mark { width: 36px; height: 36px; flex: none; }
.brand .bt { font-family: var(--display); font-weight: 700; letter-spacing: .01em; font-size: 1.14rem; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.nav { margin-left: auto; display: flex; gap: 1px; align-items: center; flex-wrap: nowrap; }
.nav a { color: #e7e3ff; text-decoration: none; font-size: 0.8rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 8px 11px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--gold); border-radius: 6px 6px 0 0; }
.menu-toggle { display: none; }
@media (max-width: 1040px) {
  .brand .bt { font-size: 1.02rem; }
  .menu-toggle { display: inline-flex; margin-left: auto; background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 8px; padding: 10px 13px; font-size: 0.8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }
  .nav { position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--brand-dark); padding: 8px 16px 16px; gap: 2px; margin: 0; box-shadow: var(--shadow-lg); display: none; max-height: calc(100vh - 62px); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav a { padding: 13px 12px; font-size: 0.95rem; }
}

/* ---------- Hero (photo banner) ---------- */
.hero { position: relative; color: #fff; padding: 58px 0 52px; overflow: hidden; background: var(--brand-dark); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(120deg, rgba(38,29,96,.93), rgba(58,43,143,.80)), var(--hero-img); background-size: cover; background-position: center; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.05; letter-spacing: .01em; margin: 0 0 16px; text-transform: uppercase; max-width: 20ch; }
.hero p.lede { font-size: clamp(1.06rem, 2.1vw, 1.28rem); color: #eceafb; max-width: 64ch; margin: 0 0 24px; }
.hero .kicker { display: inline-block; font-family: var(--display); font-size: 0.82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); background: rgba(0,0,0,.28); padding: 6px 14px; border-radius: 100px; margin-bottom: 18px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.95rem; letter-spacing: .02em; padding: 13px 22px; border-radius: 8px; text-decoration: none; cursor: pointer; border: 2px solid transparent; text-transform: uppercase; transition: transform .06s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold); color: var(--gold-ink); }
.btn--primary:hover { background: #ffd25a; color: var(--gold-ink); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn--solid { background: var(--maroon); color: #fff; }
.btn--solid:hover { background: var(--maroon-dark); color: #fff; }

/* ---------- Sections & headings ---------- */
main { display: block; }
section { padding: 52px 0; }
section.alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3.4vw, 2.15rem); line-height: 1.12; letter-spacing: .005em; margin: 0 0 .5em; color: var(--text-primary); text-transform: uppercase; }
h3 { font-size: 1.28rem; margin: 1.6em 0 .4em; font-weight: 700; letter-spacing: -.01em; }
h4 { font-size: 1.06rem; margin: 1.3em 0 .3em; font-weight: 700; }
.section-intro { color: var(--text-secondary); max-width: 70ch; font-size: 1.08rem; }
.eyebrow { font-family: var(--display); font-size: 0.85rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon); margin: 0 0 10px; position: relative; padding-bottom: 8px; }
.eyebrow::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; background: var(--red); border-radius: 2px; }
p, li { color: var(--text-secondary); }
strong { color: var(--text-primary); }
.lead { font-size: 1.16rem; color: var(--text-primary); font-weight: 500; }

/* ---------- Apparatus hero band (home) ---------- */
.apparatus { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--brand-dark); }
.apparatus .bay { aspect-ratio: 16/9; overflow: hidden; background: #d9dce6; }
.apparatus .bay img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .apparatus { grid-template-columns: 1fr; } }

/* ---------- Stat band (purple) ---------- */
.statband { background: var(--brand); color: #fff; padding: 34px 0; }
.statband .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.statband .sb { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 18px 20px; text-align: center; }
.statband .sb .lbl { font-size: 0.82rem; color: #d9d5f4; font-weight: 600; letter-spacing: .02em; }
.statband .sb .num { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.05; margin-top: 4px; letter-spacing: .01em; }
.statband .sb .num.gold { color: var(--gold); }

/* ---------- Stat tiles (light) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 26px 0; }
.stat { background: var(--surface-1); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.stat .num { font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: .01em; color: var(--text-primary); line-height: 1; }
.stat .num.red { color: var(--maroon); }
.stat .num.green { color: var(--status-good); }
.stat .lbl { margin-top: 10px; font-size: 0.94rem; color: var(--text-secondary); font-weight: 500; }
.stat .sub { margin-top: 5px; font-size: 0.8rem; color: var(--muted); }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card h3 { margin-top: 0; }
.card .card-num { font-family: var(--display); font-size: 0.95rem; font-weight: 700; color: var(--maroon); letter-spacing: .06em; }
.card p { margin: .5em 0 0; }
.card--link { text-decoration: none; overflow: hidden; padding: 0; transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card--link .card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card--link h3 { color: var(--text-primary); margin: 8px 0 0; }
.card--link p { color: var(--text-secondary); }
.card .go { margin-top: auto; padding-top: 14px; font-weight: 800; color: var(--brand); font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; }
.card__media { aspect-ratio: 16/9; overflow: hidden; border-bottom: 1px solid var(--border); background: #e6e8ef; }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Charts ---------- */
.chart { margin: 26px 0; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 14px; box-shadow: var(--shadow); }
.chart__cap { margin-bottom: 8px; }
.chart__title { display: block; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; color: var(--text-primary); }
.chart__sub { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-top: 5px; }
.chart__plot { width: 100%; overflow-x: auto; }
.svg { width: 100%; height: auto; display: block; }
.svg .ax { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.svg .barval { fill: var(--text-secondary); font-size: 12.5px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.svg .dlabel { font-size: 13px; font-weight: 700; font-family: var(--font); }
.svg .legend { fill: var(--text-secondary); font-size: 13.5px; font-family: var(--font); }
.svg .donut-center { fill: var(--text-primary); font-family: var(--display); font-size: 34px; font-weight: 700; }
.svg .donut-sub { fill: var(--muted); font-size: 15px; font-family: var(--font); }
.chart__src { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }
.chart__data { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.chart__data summary { cursor: pointer; font-size: 0.85rem; font-weight: 700; color: var(--brand); }
.chart__data table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.86rem; }
.chart__data th, .chart__data td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.chart__data th[scope="row"], .chart__data thead th:first-child { text-align: left; }
.chart__data thead th { color: var(--muted); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--surface-1); }
table.data th, table.data td { padding: 12px 15px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { background: var(--brand); color: #fff; font-weight: 700; position: sticky; top: 0; text-transform: uppercase; font-size: 0.8rem; letter-spacing: .03em; }
table.data tbody tr:nth-child(even) { background: var(--surface-2); }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* ---------- Callouts ---------- */
.callout { border-left: 4px solid var(--brand); background: var(--surface-2); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 22px 0; }
.callout.warn { border-left-color: var(--maroon); }
.callout.good { border-left-color: var(--status-good); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .tag { font-family: var(--display); font-size: 0.78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--maroon); }

/* ---------- Maroon CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--maroon-dark), var(--maroon)); color: #fff; }
.cta-band h2 { color: var(--gold); text-align: center; }
.cta-band .inner { max-width: 760px; margin: 0 auto; text-align: center; }
.cta-band p { color: #f3e7e7; font-size: 1.1rem; }
.cta-band .btn--primary { margin-top: 8px; }

/* ---------- Myth / Fact ---------- */
.mf { display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 16px 0; background: var(--surface-1); box-shadow: var(--shadow); }
.mf__claim { padding: 16px 20px; background: color-mix(in srgb, var(--maroon) 8%, var(--surface-1)); border-bottom: 1px solid var(--border); }
.mf__claim .tag { font-family: var(--display); font-size: 0.76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--maroon); display: block; margin-bottom: 4px; }
.mf__claim p { margin: 0; color: var(--text-primary); font-weight: 600; font-size: 1.04rem; }
.mf__fact { padding: 16px 20px; }
.mf__fact .tag { font-family: var(--display); font-size: 0.76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--status-good); display: block; margin-bottom: 4px; }
.mf__fact p { margin: 0; }
.mf__source { margin-top: 10px !important; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 9px; }
.mf__source a { color: var(--brand); }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin: 30px 0; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); }
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item::before { content: ""; position: absolute; left: -30px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-1); border: 3px solid var(--brand); }
.tl-item.tl-vote::before { border-color: var(--maroon); }
.tl-item.tl-audit::before { border-color: var(--status-good); }
.tl-item.tl-legal::before { border-color: var(--gold); }
.tl-date { font-family: var(--display); font-size: 0.85rem; font-weight: 600; color: var(--maroon); letter-spacing: .04em; text-transform: uppercase; }
.tl-item h3 { margin: 3px 0 5px; font-size: 1.14rem; }
.tl-item p { margin: 0; font-size: 0.97rem; }

/* ---------- TL;DR ---------- */
.tldr { background: var(--surface-1); border: 1px solid var(--border); border-left: 5px solid var(--gold); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.tldr h2 { font-size: 1.35rem; margin-bottom: 12px; }
.tldr ul { margin: 0; padding-left: 20px; }
.tldr li { margin: 8px 0; }
.tldr li::marker { color: var(--maroon); }

/* ---------- Infobox ---------- */
.infobox { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 82px; }
.infobox__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--brand); color: #fff; }
.infobox__title { font-family: var(--display); font-size: 1.1rem; margin: 0; color: #fff; font-weight: 700; text-transform: uppercase; }
.infobox__sub { margin: 2px 0 0; font-size: 0.78rem; color: var(--gold); }
.infobox__list { margin: 0; padding: 6px 0; }
.infobox__row { display: grid; grid-template-columns: 42% 58%; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--border); }
.infobox__row:last-child { border-bottom: 0; }
.infobox__row dt { font-size: 0.82rem; color: var(--muted); font-weight: 600; margin: 0; }
.infobox__row dd { font-size: 0.9rem; color: var(--text-primary); margin: 0; font-weight: 600; }
.infobox__row dd a { font-weight: 600; }
.infobox__note { margin: 0; padding: 12px 18px; font-size: 0.76rem; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); }
@media (max-width: 720px) { .infobox { position: static; } }

/* ---------- Page nav ---------- */
.pagenav { display: flex; justify-content: space-between; gap: 16px; margin: 44px 0 10px; flex-wrap: wrap; }
.pagenav a { text-decoration: none; font-weight: 700; padding: 15px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); flex: 1; min-width: 240px; box-shadow: var(--shadow); color: var(--text-primary); }
.pagenav a:hover { border-color: var(--brand); }
.pagenav .dir { display: block; font-family: var(--display); font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pagenav .t { display: block; margin-top: 3px; color: var(--brand); }
.pagenav .next { text-align: right; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark); color: #cfd0e6; margin-top: 48px; padding: 44px 0 34px; }
.site-footer a { color: #eae8fb; }
.site-footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-family: var(--display); font-size: 0.9rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 7px 0; }
.site-footer li a { color: #cfd0e6; text-decoration: none; font-size: 0.93rem; }
.site-footer li a:hover { color: #fff; }
.site-footer .disc { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); font-size: 0.82rem; color: #a9aad0; max-width: 96ch; }
.site-footer .emerg { font-weight: 700; color: #fff; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt0 { margin-top: 0; }
.small { font-size: 0.88rem; color: var(--muted); }
hr.rule { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.pill { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); }
