/* The Données page and its model pages: the table of the models and datasets, their coverages. */
:root {
  --navy: #0b1f3a;
  --abyss: #06132a;
  --blue: #0066ff;
  --text: #1c2733;
  --muted: #5b6b7c;
  --line: #e2e8f0;
  --soft: #f5f8fc;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.06), 0 8px 24px rgba(11, 31, 58, 0.08);
  color-scheme: light dark;
  --heading: var(--navy);
  --page: #fff;
  --surface: #fff;
  --rule: #ccc;
}
/* The same page, as the sea at night, when the browser prefers a dark scheme. */
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #3d8bff;
    --text: #d5dde7;
    --muted: #93a3b5;
    --line: #26374d;
    --soft: #0b1626;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --heading: #eef3fa;
    --page: #081120;
    --surface: #12213a;
    --rule: #34475f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  color: var(--text);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

section { padding: 72px 0 96px; }
.eyebrow {
  margin: 0 0 12px; color: var(--blue); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.lead { margin: 0 0 56px; max-width: 58ch; color: var(--muted); font-size: 1.15rem; }

.meteo-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.meteo-head h1 { margin: 0; }
.meteo-head .toolbar-stamp { color: var(--muted); font-size: 0.9rem; }
.meteo-sub { margin: 40px 0 6px; font-size: 1.05rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
th.numeric, td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
td.muted { color: var(--muted); }
/* A model's flag, before its name. */
.model-name { display: inline-flex; align-items: center; gap: 8px; }
.flag { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(11, 31, 58, 0.12); }
/* A dot plus its label: the state never rests on colour alone. */
.state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.state::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.state-current { --dot: #0ca30c; }
.state-stale { --dot: #fab219; }
.state-running { --dot: #f0790c; }
.state-missing { --dot: #b4b3ad; }
.state-absent { --dot: #d6312b; }

/* Timeline: one row per model, cells laid out on a shared absolute UTC axis. */
#coverage {
  --surface: #fcfcfb; --series: #2a78d6; --series-past: #bfd7f3; --ink: #0b0b0b; --ink-muted: #52514e;
  /* Stale rows wear the table's "mise à jour disponible" hue, dimmed the same way past steps are. */
  --series-stale: #fab219; --series-stale-past: #fde8ba; --ink-stale: #8a5a00;
  /* Running rows wear the table's "mise à jour…" hue, dimmed the same way past steps are. */
  --series-running: #f0790c; --series-running-past: #fbd4ac; --ink-running: #8a4400;
  /* Shrink-to-fit so the rows span the whole timeline, which is what the sticky labels stick within. */
  display: inline-block; min-width: 100%; position: relative;
  --gridline: #e0e0e0;
}
@media (prefers-color-scheme: dark) {
  #coverage {
    --surface: #0f1d33; --series: #4d94ff; --series-past: #284669; --ink: #eef3fa; --ink-muted: #93a3b5;
    --series-stale-past: #5a4718; --ink-stale: #fab219;
    --series-running-past: #5a3416; --ink-running: #f7a35c;
    --gridline: #22324a;
  }
}
.coverage-hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
/* padding-bottom keeps the horizontal scrollbar off the last row's label. */
.coverage-scroll { overflow-x: auto; padding-bottom: 8px; border: 1px solid var(--rule); background: var(--surface); }
.coverage-row { display: flex; align-items: stretch; }
.coverage-label {
  position: sticky; left: 0; z-index: 2; box-sizing: border-box;
  flex: 0 0 var(--label-width); width: var(--label-width);
  padding: 4px 8px; background: var(--surface); border-right: 1px solid var(--rule); font-size: 13px;
  white-space: nowrap;
}
.coverage-track {
  position: relative; flex: none; height: 24px;
  /* One gridline per UTC day, aligned on the first midnight of the axis. */
  background-image: repeating-linear-gradient(to right, var(--gridline) 0 1px, transparent 1px var(--day-width));
  background-position-x: var(--day-offset);
}
.coverage-days .coverage-track, .coverage-hours .coverage-track { height: 20px; background-image: none; }
.coverage-day, .coverage-tick {
  position: absolute; top: 0; color: var(--ink-muted); font-size: 11px; line-height: 20px; white-space: nowrap;
}
.coverage-day { border-left: 1px solid var(--rule); padding-left: 4px; overflow: hidden; }
.coverage-tick { padding-left: 3px; border-left: 1px solid var(--gridline); }
.coverage-cell {
  position: absolute; top: 3px; height: 18px; box-sizing: border-box;
  background: var(--series); border-radius: 2px;
}
/* Steps whose validity has passed: still readable, but they recede behind what is still usable. */
.coverage-cell.is-past { background: var(--series-past); }
/* A run a newer cycle has superseded, flagged as such in the table above. */
.coverage-model.is-stale .coverage-cell { background: var(--series-stale); }
.coverage-model.is-stale .coverage-cell.is-past { background: var(--series-stale-past); }
/* Darker than the cells' hue, which is too light to read as text. */
.coverage-model.is-stale .coverage-label { color: var(--ink-stale); }
/* A model update in progress, mirroring the table's "Mise à jour…" hue. */
.coverage-model.is-running .coverage-cell { background: var(--series-running); }
.coverage-model.is-running .coverage-cell.is-past { background: var(--series-running-past); }
.coverage-model.is-running .coverage-label { color: var(--ink-running); }
.coverage-empty { color: var(--ink-muted); font-size: 13px; }
/* "Now" is an annotation over the data, so it wears ink rather than a series or status hue. */
.coverage-now {
  position: absolute; top: 0; bottom: 0; width: 2px; z-index: 1;
  background: var(--ink); pointer-events: none;
}
.coverage-now-label {
  position: absolute; top: 0; left: 2px; padding: 0 4px;
  background: var(--ink); color: var(--surface); font-size: 11px; line-height: 20px; white-space: nowrap;
}

#spatial-map { height: 320px; border: 1px solid var(--rule); }
.spatial-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 0; font-size: 13px; }
.spatial-legend-item { display: flex; align-items: center; gap: 6px; }
.spatial-legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }

/* The weather page, set in cards on a soft background, under the site's bar. */
#donnees { background: var(--soft); border-top: 1px solid var(--line); }
#donnees .meteo-head { margin-bottom: 8px; }
#donnees .meteo-head h1 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; color: var(--heading); }
#donnees .lead { margin-bottom: 32px; max-width: none; }
.panel { padding: 8px 24px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel .meteo-sub { margin-top: 20px; }
.panel th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.panel tbody tr:last-child td { border-bottom: 0; }
#spatial-map { border-radius: 10px; overflow: hidden; }

/* A model's name, on the Données page (its table, its timeline, its map's legend), leads to its model page. */
.model-link { color: inherit; text-decoration: none; }
.model-link .model-label { text-decoration: underline dotted var(--muted); text-underline-offset: 4px; }
.model-link:hover .model-label, .model-link:focus-visible .model-label { color: var(--blue); text-decoration: underline solid currentColor; }

/* A model page: its live panel, its fact sheet beside its article on a wide screen, above it on a phone. */
#donnees.model-page { padding-top: 40px; }
.breadcrumb { margin: 0 0 12px; font-size: 0.9rem; }
.breadcrumb a { color: var(--blue); text-decoration: none; font-weight: 600; }
.breadcrumb a::before { content: '← '; }
.model-page h2.meteo-sub { font-size: 1.05rem; color: var(--heading); }
.model-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.model-layout .panel + .panel { margin-top: 0; }
@media (min-width: 960px) {
  .model-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .model-facts { grid-column: 2; grid-row: 1; position: sticky; top: 20px; }
  .model-article { grid-column: 1; grid-row: 1; }
}
.facts { margin: 12px 0 0; font-size: 0.9rem; }
.facts div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.facts dd { margin: 2px 0 0; color: var(--text); }
.model-article { padding: 8px 32px 32px; }
.model-article section { padding: 0; }
.model-article h2 { margin: 32px 0 12px; font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--heading); }
.model-article h3 { margin: 24px 0 8px; font-size: 1.1rem; color: var(--heading); scroll-margin-top: 16px; }
.model-article p { margin: 0 0 1em; max-width: 72ch; font-size: 1.02rem; line-height: 1.7; }
.model-article a { color: var(--blue); }
.model-domain:target h3 { color: var(--blue); }
.model-article .sources ol { margin: 0; padding-left: 1.4em; color: var(--muted); font-size: 0.9rem; }
.model-article .sources li { margin: 0 0 6px; }
.model-back { margin: 24px 0 0; }
.model-back a { color: var(--blue); font-weight: 600; text-decoration: none; }

@media (max-width: 600px) {
  section { padding: 48px 0 72px; }
  .panel { padding: 4px 16px 16px; }
  .model-article { padding: 4px 16px 20px; }
}
