/* Stylesheet. Design rules: site/STYLE.md — statistics-office register,
   square corners by default, hairline borders, one restrained accent.
   NOTE: .chart polyline { fill: none } is load-bearing, not decorative --
   SVG polylines default to black fill. Keep it whatever else changes. */

/* -- tokens ------------------------------------------------------------- */
:root {
  --ink: #111;           /* primary text */
  --ink-soft: #444;      /* secondary text, section labels */
  --ink-mute: #666;      /* captions, notes, table headers */
  --ink-faint: #999;     /* censored / placeholder / reference lines */
  --paper: #fff;
  --line: #ddd;          /* hairline border */
  --line-strong: #bbb;   /* control borders */
  --rule: #111;          /* heavy statistical rule (table top/bottom) */
  --accent: #08519c;     /* the one interaction/emphasis blue */
  --accent-soft: #9ecae1;/* filled/interpolated series */
  --accent-pale: #eef3f9;/* faint tint for hover/selected rows */
}

* { box-sizing: border-box; }

/* -- base ----------------------------------------------------------------*/
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  margin: 32px auto 64px;
  padding: 0 16px;
  max-width: 1040px;
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  margin: 40px 0 14px;
  padding-bottom: 5px;
}
a { color: var(--accent); }
a:not(:hover) { text-decoration-color: var(--line-strong); }

/* -- masthead ------------------------------------------------------------*/
.site-head {
  border-bottom: 1px solid var(--rule); padding-bottom: 7px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.site-nav { font-size: 12px; }
.site-nav a {
  color: var(--ink-mute); text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.site-nav a:hover { color: var(--ink); }
.site-name {
  margin: 0; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute);
}
.site-name a { color: inherit; text-decoration: none; }
.site-name a:hover { color: var(--ink); }

/* -- headline / region intro ---------------------------------------------*/
.headline { font-size: 16px; margin: 10px 0 12px; color: var(--ink-soft); }
.headline .price { font-size: 22px; font-weight: 700; color: var(--ink); }
.whereis { color: var(--ink-mute); font-size: 13px; margin: 4px 0 14px; }

.note, .legend { font-size: 12.5px; color: var(--ink-mute); margin: 8px 0; line-height: 1.55; }

/* -- honesty styling: censored / no-data ----------------------------------
   Priority per STYLE.md — anything that isn't a real observed value must
   visibly say so, not just imply it via layout. */
.censored { color: var(--ink-faint); font-style: italic; }
p.censored, td.censored { font-style: italic; }

/* -- region stat strip -----------------------------------------------------*/
.stats {
  list-style: none; padding: 0; margin: 14px 0 18px;
  display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats li {
  padding: 10px 24px 10px 0; margin-right: 24px;
  border-right: 1px solid var(--line);
}
.stats li:last-child { border-right: none; margin-right: 0; }
.stats li b { display: block; font-size: 19px; font-weight: 700; }
.stats li span { display: block; font-size: 11.5px; color: var(--ink-mute); margin-top: 2px; }
.stats.nodata { border-color: var(--line); }
.stats.nodata li b { color: var(--ink-faint); font-weight: 600; }
.stats.nodata li span { color: var(--ink-faint); }

/* -- filter bar --------------------------------------------------------- */
.filters {
  border: 1px solid var(--line); padding: 12px 14px; margin: 18px 0;
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: start;
  background: var(--paper);
}
.filters fieldset { border: none; margin: 0; padding: 0; }
.filters legend {
  font-size: 11px; font-weight: 600; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.04em; padding: 0 0 5px;
}
.filters label { display: inline-block; margin-right: 12px; font-size: 13px; }
.filters label.censored { color: var(--ink-faint); }
.filters label:has(input:checked) { color: var(--ink); font-weight: 600; }
.filters input[type="radio"], .filters input[type="checkbox"] {
  accent-color: var(--accent); margin-right: 3px; vertical-align: -2px;
}
.filter-readout { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; }
.filter-readout b { font-weight: 700; }
.filters .note { flex-basis: 100%; margin: 2px 0 0; }

/* -- controls ------------------------------------------------------------*/
button {
  font: inherit; font-size: 12px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-strong); padding: 3px 11px; cursor: pointer;
  border-radius: 0;
}
button:hover { border-color: var(--ink); }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* -- map ------------------------------------------------------------------*/
#map { border: 1px solid var(--line); display: block; background: var(--paper); }
#map .inset { fill: none; stroke: var(--line); stroke-dasharray: 4 3; }
#map .inset-label { font-size: 11px; fill: var(--ink-faint); font-family: inherit; }
#map a.dot circle { transition: none; }
#map a.dot circle:hover { stroke: var(--ink); stroke-width: 2; }

/* -- charts ----------------------------------------------------------------
   Fixed-viewBox SVGs; scale down via max-width, never up. */
.chart-block { margin: 0 0 32px; }
.chart {
  border: 1px solid var(--line); display: block;
  max-width: 100%; height: auto; background: var(--paper);
}
.chart text { font-family: inherit; font-variant-numeric: tabular-nums; }
.chart polyline { fill: none; }
.chart .grid { stroke: #eee; stroke-width: 1; }
.chart .ref { stroke: var(--ink-faint); stroke-dasharray: 4 3; }
.chart .ref.today { stroke: var(--ink-soft); stroke-dasharray: 2 3; }
.chart .tick.today { fill: var(--ink-soft); }
.chart .tick { font-size: 11px; fill: var(--ink-mute); }
.chart .confound { fill: #f6f6f6; }

/* observed series: full ink; filled/interpolated: visibly lighter, never
   mistakeable for an observation */
.chart .line.main { stroke: var(--accent); stroke-width: 1.6; }
.chart .line.main.filled { stroke: var(--ink-faint); stroke-width: 1.2;
                           stroke-dasharray: 4 3; }
.chart .line.nat { stroke: #999; stroke-width: 1.1; }
.chart .line.nat.filled { stroke: #d8d8d8; stroke-width: 1.1; }
.chart .knot { fill: var(--accent); stroke: var(--paper); stroke-width: 1; }

/* model uncertainty band (±1.96 sd) and observed daily medians -- drawn
   first, under the lines, one muted accent, no gradients per STYLE.md */
.chart .band { fill: var(--accent); opacity: .13; stroke: none; }
.chart .band.filled { opacity: .07; }
.chart .obs { fill: var(--ink); opacity: .55; stroke: none; }

.key { font-weight: 700; }
.key.main { color: var(--accent); }
.key.nat { color: var(--ink-faint); }

/* -- tables ----------------------------------------------------------------
   Two-rule statistical table: heavy top/bottom, hairline row separators,
   no vertical rules. */
table.data {
  border-collapse: collapse; font-size: 13.5px; margin: 4px 0 10px;
  border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule);
  width: 100%;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--line); text-align: left;
  padding: 6px 20px 6px 0;
}
table.data th {
  font-weight: 600; color: var(--ink-mute); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--ink);
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data th:not(:first-child), table.data td:not(:first-child) {
  text-align: right; padding-right: 0; padding-left: 20px;
}

table.data td.txt { text-align: left; padding-right: 20px; padding-left: 0; }

/* -- fold-out: map column + region detail panel ---------------------------
   Default: single column, full-width map. body.split (set by site.js when a
   dot is opened): map shrinks into the left column, the fetched region page
   fills the right panel. No animation -- content just appears. */
#map { width: 100%; max-width: 1000px; height: auto; }
body.split #layout {
  display: grid; grid-template-columns: minmax(320px, 5fr) 7fr;
  gap: 0 28px; align-items: start;
}
body.split #map-col { position: sticky; top: 12px; }
#detail { border-left: 1px solid var(--line); padding-left: 28px; }
.detail-bar { margin: 0 0 10px; }
#detail h1 { font-size: 20px; }
#detail .stats li b { font-size: 16px; }
#detail .chart-block { margin-bottom: 24px; }
#map circle.active { stroke: var(--ink); stroke-width: 2.5; }

/* -- footer ------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--rule); margin-top: 36px; padding-top: 10px;
  font-size: 12px; color: var(--ink-mute);
}
.site-foot p { margin: 4px 0; }
.site-foot b { color: var(--ink-soft); font-weight: 600; }
