/* ---------------------------------------------------------------------------
   After The Forecast / Weernabeschouwing - monthly forecast verification.
   Design concept: verisky app repo docs/design/report-site-concept.md

   Light is the identity ("paper"); dark is a night edition, not the app theme.
   Every color is a token so both themes resolve as a set. Fonts are self-hosted
   (OFL) so the page makes zero third-party requests, which is what lets the
   colophon claim no trackers literally.
--------------------------------------------------------------------------- */

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-italic.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Sans';
  src: url('fonts/plex-sans.woff2') format('woff2-variations');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbfaf8;
  --ink: #1a1c20;
  --ink-2: #5b5f66;
  --muted: #6b6f77;
  --hairline: #e6e4dd;
  --rule: #1a1c20;
  --accent: #24487f;
  --brand: #4c8dff;
  --brand-ink: #0b1b36;
  --card: #f4f2ed;
  --grid: #ecebe5;
  --mixed: #cfcdc6;
  --tooltip-bg: #1a1c20;
  --tooltip-ink: #fbfaf8;
  --good: #0ca30c;
  --critical: #d03b3b;
  --warning: #b57d0a;

  /* Model hues start with the app palette, then move only as far as needed
     for readable labels and graphical contrast on paper. The night edition
     has its own values below. */
  --m-ecmwf: #1d4ed8;
  --m-aifs: #036b8f;
  --m-knmi: #9a5200;
  --m-dmi: #8a5a00;
  --m-icon: #047857;
  --m-meteofrance: #6d28d9;
  --m-ukmo: #be185d;
  --m-gfs: #b91c1c;
  --m-ncep: #a84300;
  --m-jma: #0f766e;
  --m-cma: #4d6b00;
  --m-metno: #4d7c0f;
  --m-gem: #be123c;
  --m-meteoswiss: #0f766e;
  --m-blend: #1f64c8;

  --serif: 'Newsreader', Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #15171b;
    --ink: #eceef0;
    --ink-2: #a3a7ae;
    --muted: #858a92;
    --hairline: #2b2e34;
    --rule: #eceef0;
    --accent: #82a8e6;
    --card: #1c1f24;
    --grid: #23262b;
    --mixed: #3a3d43;
    --tooltip-bg: #eceef0;
    --tooltip-ink: #15171b;
    --good: #0ca30c;
    --critical: #d03b3b;
    --warning: #fab219;
    --m-ecmwf: #8db4ff;
    --m-aifs: #5cc8f5;
    --m-knmi: #f5ad42;
    --m-dmi: #ffd166;
    --m-icon: #4adea4;
    --m-meteofrance: #c4b5fd;
    --m-ukmo: #f78ac1;
    --m-gfs: #ff8796;
    --m-ncep: #ffad70;
    --m-jma: #5eead4;
    --m-cma: #c4e86b;
    --m-metno: #a3e635;
    --m-gem: #fb7185;
    --m-meteoswiss: #5eead4;
    --m-blend: #75a7ff;
  }
}
:root[data-theme='dark'] {
  --paper: #15171b;
  --ink: #eceef0;
  --ink-2: #a3a7ae;
  --muted: #858a92;
  --hairline: #2b2e34;
  --rule: #eceef0;
  --accent: #82a8e6;
  --card: #1c1f24;
  --grid: #23262b;
  --mixed: #3a3d43;
  --tooltip-bg: #eceef0;
  --tooltip-ink: #15171b;
  --good: #0ca30c;
  --critical: #d03b3b;
  --warning: #fab219;
  --m-ecmwf: #8db4ff;
  --m-aifs: #5cc8f5;
  --m-knmi: #f5ad42;
  --m-dmi: #ffd166;
  --m-icon: #4adea4;
  --m-meteofrance: #c4b5fd;
  --m-ukmo: #f78ac1;
  --m-gfs: #ff8796;
  --m-ncep: #ffad70;
  --m-jma: #5eead4;
  --m-cma: #c4e86b;
  --m-metno: #a3e635;
  --m-gem: #fb7185;
  --m-meteoswiss: #5eead4;
  --m-blend: #75a7ff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sans { font-family: var(--sans); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

img, svg { max-width: 100%; }

/* --- shell ---------------------------------------------------------------- */
.sheet { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem 4rem; }
.col { max-width: 42rem; margin-left: auto; margin-right: auto; }
.wide { max-width: 56rem; margin-left: auto; margin-right: auto; }

.skip {
  position: absolute; left: -9999px;
  font-family: var(--sans); font-size: 0.85rem;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 10;
  background: var(--card); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 6px; border: 1px solid var(--hairline);
}

/* --- masthead ------------------------------------------------------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--hairline);
  padding: 0.9rem 0 0.6rem; margin-top: 0.5rem;
}
.topbar a { color: var(--ink-2); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar-actions { display: inline-flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.language-switch {
  display: inline-flex; align-items: baseline; gap: 0.3rem;
  border-left: 1px solid var(--hairline); padding-left: 0.55rem;
  letter-spacing: 0.08em;
}
.language-switch a[aria-current='page'] { color: var(--ink); font-weight: 700; }
.language-switch a:not([aria-current='page']) { text-decoration: underline; text-underline-offset: 2px; }

.masthead { text-align: center; padding: 2.2rem 0 1.4rem; }
.masthead h1 {
  font-size: clamp(1.75rem, 6vw, 3.75rem);
  font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  margin: 0; color: var(--ink); line-height: 1.05;
  text-wrap: balance;
}
.masthead h1 a { color: inherit; text-decoration: none; }
:lang(nl) .masthead h1 {
  font-size: clamp(1.4rem, 5.4vw, 3.6rem);
  letter-spacing: 0.04em;
}
.masthead .tagline {
  margin: 0.5rem 0 0; font-style: italic; color: var(--ink-2); font-size: 1.02rem;
}
.masthead .publisher {
  font-family: var(--sans);
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0.7rem 0 0;
}
.masthead .publisher a { color: var(--muted); }

.doublerule { border: 0; border-top: 3px solid var(--rule); margin: 0 0 3px; }
.doublerule + .thinrule { border: 0; border-top: 1px solid var(--rule); margin: 0 0 2.6rem; }

/* --- article -------------------------------------------------------------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.lead h2 {
  font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.18;
  margin: 0.55rem 0 1rem; font-weight: 700; text-wrap: balance;
}
.standfirst { font-size: 1.16rem; line-height: 1.65; color: var(--ink-2); margin: 0 0 1.1rem; }
.dateline {
  font-family: var(--sans); font-size: 0.78rem; color: var(--muted);
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  padding: 0.55rem 0; margin-bottom: 2.4rem;
}

p { margin: 0 0 1.15rem; }
.body-copy .lede::first-letter {
  font-size: 3.3em; float: left; line-height: 0.82;
  padding: 0.06em 0.09em 0 0; font-weight: 700; color: var(--accent);
}

.section { font-size: 1.45rem; margin: 2.6rem 0 0.9rem; font-weight: 700; text-wrap: balance; }

/* --- stat tiles ----------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--hairline); border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline); margin: 0 0 2.6rem;
}
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--paper); padding: 1.1rem 1.2rem 1.2rem; }
.stat .n {
  font-family: var(--sans); font-size: 1.9rem; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.stat .l {
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; line-height: 1.5;
}

/* --- figures -------------------------------------------------------------- */
figure { margin: 2.2rem 0 2.6rem; }
.fig-head {
  font-family: var(--sans);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  border-top: 2px solid var(--rule); padding-top: 0.6rem; margin-bottom: 1rem;
}
.fig-head b { font-size: 0.95rem; font-weight: 600; }
.fig-head span {
  font-size: 0.74rem; color: var(--muted); letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap;
}
@media (max-width: 520px) {
  .fig-head { align-items: flex-start; flex-wrap: wrap; gap: 0.25rem 1rem; }
  .fig-head span { white-space: normal; }
}
figcaption {
  font-family: var(--sans); font-size: 0.82rem; color: var(--ink-2); line-height: 1.6;
  border-top: 1px solid var(--hairline); padding-top: 0.55rem; margin-top: 1rem;
}

/* standings table */
.tablewrap { overflow-x: auto; }
.tablewrap:focus-visible,
.chartscroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.standings {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 0.88rem;
}
.standings th {
  text-align: left; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.standings th.num, .standings td.num { text-align: right; font-variant-numeric: tabular-nums; }
.standings td,
.standings tbody th[scope='row'] {
  padding: 0.52rem 0.6rem; border-bottom: 1px solid var(--hairline); vertical-align: middle;
}
.standings tbody th[scope='row'] { text-align: left; font-size: inherit; letter-spacing: normal; text-transform: none; color: var(--ink); }
.standings tbody tr:last-child td,
.standings tbody tr:last-child th[scope='row'] { border-bottom: 0; }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; white-space: nowrap; }
.chip i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chip small { font-weight: 400; color: var(--muted); }
.barcell { width: 34%; min-width: 140px; }
.bar { display: flex; align-items: center; gap: 0.55rem; }
.bar .track { flex: 1; height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 4px; }
.bar b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.8em; text-align: right; }
tr.blend td { border-top: 2px solid var(--rule); }

.na { color: var(--muted); font-style: italic; }

/* Wet-hour stack: caught / missed / false alarm. These are the fixed status
   roles, never a series colour, and each is labelled in the legend and repeated
   as a number in its own column, so the meaning never rests on hue alone. */
.stack {
  display: flex; align-items: center; gap: 2px;
  flex: 1; height: 10px;
}
.seg { display: block; height: 100%; border-radius: 2px; min-width: 2px; }
.seg.caught { background: var(--good); }
.seg.missed { background: var(--critical); }
.seg.false  { background: var(--warning); }
.chip i.sw { width: 10px; height: 10px; border-radius: 3px; }
i.sw.caught { background: var(--good); }
i.sw.missed { background: var(--critical); }
i.sw.false  { background: var(--warning); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* line chart */
.legend {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
  font-family: var(--sans); font-size: 0.78rem; margin-bottom: 0.8rem; color: var(--ink-2);
}
.legend .chip i { width: 9px; height: 9px; }
.chartwrap { position: relative; }
.chartwrap svg { width: 100%; height: auto; display: block; }
.chartscroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.chartwrap { min-width: 700px; }
.tick { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.serieslabel { font-family: var(--sans); font-size: 11.5px; font-weight: 600; }
.label-leader { stroke-width: 1.5; }
.chartpoint { stroke: var(--paper); stroke-width: 2; }
.chartpoint:focus { outline: none; stroke: var(--ink); stroke-width: 3; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.axisline { stroke: var(--hairline); stroke-width: 1; }
.guide { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.tooltip {
  position: absolute; pointer-events: none;
  background: var(--tooltip-bg); color: var(--tooltip-ink);
  font-family: var(--sans); font-size: 0.75rem;
  border-radius: 6px; padding: 0.5rem 0.65rem; line-height: 1.55; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); z-index: 3;
}
.tooltip-heading,
.tooltip-row { display: block; }
.tooltip-heading { opacity: 0.78; margin-bottom: 0.15rem; }
.tooltip-row { font-variant-numeric: tabular-nums; }
.chart-data {
  font-family: var(--sans); font-size: 0.82rem;
  border-top: 1px solid var(--hairline); margin-top: 0.8rem; padding-top: 0.55rem;
}
.chart-data summary { color: var(--accent); cursor: pointer; width: fit-content; }
.chart-data[open] summary { margin-bottom: 0.7rem; }
.standings.compact { font-size: 0.78rem; }
.standings.compact caption { text-align: left; margin-bottom: 0.35rem; color: var(--ink-2); }
.standings.compact td small { display: block; color: var(--muted); white-space: nowrap; }
.station-table th small { color: var(--muted); font-weight: 400; }

/* winner map */
.mapfig { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center; }
.maplegend {
  font-family: var(--sans); font-size: 0.82rem;
  display: grid; gap: 0.5rem; color: var(--ink-2); align-content: center;
}
@media (max-width: 620px) {
  .mapfig { grid-template-columns: 1fr; }
  .maplegend { grid-auto-flow: row; }
}

/* --- pull quote ----------------------------------------------------------- */
.pull {
  border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule);
  margin: 2rem 0; padding: 1.2rem 0.4rem;
  font-size: 1.35rem; line-height: 1.45; font-style: italic;
  text-align: center; text-wrap: balance;
}
.pull small {
  display: block; font-style: normal; font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-top: 0.6rem;
}

/* --- methodology / small print -------------------------------------------- */
.method {
  border-top: 2px solid var(--rule); margin-top: 3rem; padding-top: 1.2rem;
  font-family: var(--sans); font-size: 0.82rem; color: var(--ink-2); line-height: 1.65;
  columns: 2; column-gap: 2.4rem;
}
@media (max-width: 640px) { .method { columns: 1; } }
.method h4 {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 0.4rem; break-after: avoid;
}
.method p { margin: 0 0 1rem; break-inside: avoid-column; }

/* --- call to action ------------------------------------------------------- */
.cta {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 10px;
  margin: 3rem auto 0; padding: 1.8rem 1.9rem;
}
.cta h4 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.cta p { font-size: 0.98rem; color: var(--ink-2); margin: 0.4rem 0 1.1rem; }
.cta .row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.btn {
  font-family: var(--sans);
  display: inline-block; text-decoration: none; font-size: 0.88rem; font-weight: 600;
  padding: 0.6rem 1.15rem; border-radius: 7px;
  background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand);
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.cta .fine { font-family: var(--sans); font-size: 0.74rem; color: var(--muted); margin: 0.9rem 0 0; }

/* --- index / archive listing ---------------------------------------------- */
.editions { list-style: none; margin: 0; padding: 0; }
.editions li { border-bottom: 1px solid var(--hairline); }
.editions li:first-child { border-top: 1px solid var(--hairline); }
.edition {
  display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1rem; align-items: baseline;
  padding: 1.1rem 0.2rem; text-decoration: none; color: inherit;
}
.edition:hover { background: var(--card); }
.edition .no {
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.edition .t { font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.edition .t span { display: block; font-size: 0.92rem; font-weight: 400; color: var(--ink-2); margin-top: 0.2rem; }
.edition .go { font-family: var(--sans); font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
@media (max-width: 560px) {
  .edition { grid-template-columns: 1fr; gap: 0.35rem; }
  .edition .go { display: none; }
}

.pending {
  border: 1px dashed var(--hairline); border-radius: 8px;
  padding: 1.2rem 1.3rem; margin: 1.4rem 0 0;
  font-family: var(--sans); font-size: 0.88rem; color: var(--ink-2);
}
.pending b { color: var(--ink); font-weight: 600; }

/* --- colophon ------------------------------------------------------------- */
.colophon {
  border-top: 3px solid var(--rule); margin-top: 3.2rem; padding-top: 1.1rem;
  font-family: var(--sans); font-size: 0.74rem; color: var(--muted);
  line-height: 1.8; text-align: center;
}
.colophon a { color: var(--muted); }

@media print {
  .cta, .skip, .topbar a { display: none; }
  body { background: #fff; color: #000; }
  .sheet { max-width: none; padding: 0; }
  .wide { max-width: none; }
  .tablewrap, .chartscroll { overflow: visible; }
  .chartwrap { min-width: 0; }
  .chartwrap svg { break-inside: avoid; }
  .standings { font-size: 0.72rem; }
  .standings th, .standings td, .standings tbody th[scope='row'] { padding: 0.3rem; }
  .barcell { min-width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
