/* MétéoKouran — public site. Hand-written, no build step. Mobile first; light/dark follow the system.
   Signal colours meet WCAG AA in both themes (text on fill ≥ 4.5:1, fill on page ≥ 3:1), and every
   signal also has its own pictogram and label. */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #111827;
    --muted: #4b5563;
    --border: #d9dde3;
    --brand: #0f766e;
    --focus: #0f766e;
    --stale-bg: #fef3c7;
    --stale-text: #78350f;
    --sig-vert: #15803d;
    --sig-vert-ink: #ffffff;
    --sig-orange: #c2410c;
    --sig-orange-ink: #ffffff;
    --sig-rouge: #b91c1c;
    --sig-rouge-ink: #ffffff;
    --sig-bleu: #1d4ed8;
    --sig-bleu-ink: #ffffff;
    --sig-none: #e5e7eb;
    --sig-none-ink: #374151;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 2px 8px rgb(0 0 0 / 0.05);
    --scroll-shadow: rgb(0 0 0 / 0.28);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --surface: #141d2f;
        --text: #e5e7eb;
        --muted: #9ca3af;
        --border: #2b3850;
        --brand: #2dd4bf;
        --focus: #5eead4;
        --stale-bg: #422006;
        --stale-text: #fde68a;
        --sig-vert: #4ade80;
        --sig-vert-ink: #052e16;
        --sig-orange: #fb923c;
        --sig-orange-ink: #431407;
        --sig-rouge: #f87171;
        --sig-rouge-ink: #450a0a;
        --sig-bleu: #60a5fa;
        --sig-bleu-ink: #172554;
        --sig-none: #263247;
        --sig-none-ink: #d1d5db;
        --shadow: none;
        --scroll-shadow: rgb(148 163 184 / 0.5);
    }
}

.sig-vert { --s: var(--sig-vert); --s-ink: var(--sig-vert-ink); }
.sig-orange { --s: var(--sig-orange); --s-ink: var(--sig-orange-ink); }
.sig-rouge { --s: var(--sig-rouge); --s-ink: var(--sig-rouge-ink); }
.sig-bleu { --s: var(--sig-bleu); --s-ink: var(--sig-bleu-ink); }
.sig-none { --s: var(--sig-none); --s-ink: var(--sig-none-ink); }

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

a { color: var(--brand); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 0.6em; }
h1 { font-size: 1.75rem; margin-top: 1.2em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0.6em 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; overflow-wrap: anywhere; }
abbr[title] { text-decoration: none; }
[x-cloak] { display: none !important; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.lead { font-size: 1.05rem; }
.nowrap { white-space: nowrap; }
.hint { color: var(--muted); font-size: 0.92rem; }
.more { font-weight: 600; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 10px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand strong { color: var(--brand); }
.top nav ul { display: flex; flex-wrap: wrap; gap: 2px 4px; list-style: none; margin: 0; padding: 0; }
.top nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.top nav a:hover { background: var(--bg); }
.top nav a[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); border-radius: 8px 8px 0 0; }

.stale { background: var(--stale-bg); color: var(--stale-text); padding: 10px 0; border-bottom: 1px solid var(--border); }

main { padding-bottom: 40px; }

/* Signal pieces */
.sig-icon { flex: none; vertical-align: middle; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; background: var(--s); color: var(--s-ink); font-weight: 600; font-size: 0.92rem; line-height: 1.3; white-space: nowrap; }
.badge.sig-none { border: 1px dashed var(--muted); }

/* Now */
.now { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 20px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 10px solid var(--s); box-shadow: var(--shadow); }
.now-icon { display: grid; place-items: center; width: 128px; height: 128px; border-radius: 50%; background: var(--s); color: var(--s-ink); }
.now.sig-none .now-icon { border: 2px dashed var(--muted); }
.eyebrow { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--muted); text-transform: none; }
.now-label { margin: 4px 0 0; font-size: clamp(2rem, 9vw, 3rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.05; }
.now-sub { margin: 4px 0 12px; color: var(--muted); }
.now-facts { display: grid; gap: 10px; margin: 0; }
.now-facts div { display: grid; gap: 2px; }
.now-facts dt { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.now-facts dd { margin: 0; }

/* Days J to J+4 */
.days { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.day-card { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.day-card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.day-card h3 a { color: var(--text); }
.frieze { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; height: 18px; margin-top: 12px; border-radius: 6px; overflow: hidden; }
.frieze span { background: var(--s); }
.frieze-scale { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.ranges { margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.ranges li { display: flex; align-items: center; gap: 6px; }

/* Calendar */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.9rem; }
.legend li, .counts li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--s); color: var(--s-ink); }
.forecast-swatch { background: transparent; border: 2px dashed var(--muted); }
.calendar { width: 100%; max-width: 560px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.calendar caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.calendar th { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 2px 0; }
.calendar td { padding: 0; height: 52px; border-radius: 8px; }
.calendar td.day { background: var(--s); color: var(--s-ink); }
.calendar td.day.sig-none { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.calendar td.forecast { outline: 2px dashed var(--text); outline-offset: -4px; }
.calendar td.today { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.calendar a, .calendar .empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; color: inherit; text-decoration: none; border-radius: 8px; }
.calendar a:hover { filter: brightness(1.08); }
.calendar .num { font-weight: 650; font-size: 0.95rem; line-height: 1; }
.calendar.compact { border-spacing: 2px; }
.calendar.compact td { height: 26px; border-radius: 4px; }
.calendar.compact .num { font-size: 0.7rem; }
.calendar.compact th { font-size: 0.68rem; }
.calendar.compact td.today { box-shadow: 0 0 0 2px var(--text); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 4px; font-weight: 600; }
.pager a { display: inline-flex; align-items: center; gap: 0.3em; min-height: 44px; padding: 0 2px; }
.pager a[rel="next"] { margin-left: auto; text-align: right; }
.crumbs { margin-top: 16px; }
.counts { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 14px 0; }
.year-grid { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.year-month h2 { font-size: 1rem; margin: 1em 0 0.3em; }

/* Tables */
/* A table wider than the screen scrolls inside its box; a shadow on the edge that has more to show
   says so. The covers (surface colour) scroll with the content and hide the shadows at either end. */
.table-scroll {
    overflow-x: auto; margin: 8px 0 16px; border-radius: 10px;
    background:
        linear-gradient(to right, var(--surface) 30%, transparent) left center / 40px 100% no-repeat local,
        linear-gradient(to left, var(--surface) 30%, transparent) right center / 40px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left center / 14px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right center / 14px 100% no-repeat scroll,
        var(--surface);
}
.data { border-collapse: collapse; min-width: 100%; font-size: 0.93rem; background: var(--surface); border-radius: 10px; }
.table-scroll > .data { background: transparent; }
.data.changes .change { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.data.changes .badge { font-size: 0.85rem; }
.data.changes th, .data.changes td { padding: 7px 6px; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.data caption { caption-side: top; text-align: left; white-space: normal; font-weight: 600; padding: 6px 0; color: var(--muted); }
.data th, .data td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data thead th { font-size: 0.82rem; color: var(--muted); }
.data td { font-variant-numeric: tabular-nums; }
.data.hours .badge { font-size: 0.85rem; }
.data tr.group-start > * { border-top: 2px solid var(--border); }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }

/* Statistics */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; list-style: none; padding: 0; margin: 0; }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.tile-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--s); color: var(--s-ink); }
.tile-value { font-size: 1.5rem; font-weight: 750; line-height: 1.1; }
.tile-label { font-size: 0.85rem; color: var(--muted); }
.chart { width: 100%; height: 300px; margin: 8px 0; }
.chart.small { height: 220px; }
.chart:empty { display: none; }
.chart-status { padding: 10px 12px; border-radius: 10px; background: var(--stale-bg); color: var(--stale-text); }
.transformed { display: inline-block; font-weight: 600; }

/* Alerts */
.panel { margin: 20px 0; padding: 4px 18px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.panel h2 { margin-top: 0.9em; }
.ntfy { display: grid; gap: 16px; }
.qr { margin: 0; max-width: 220px; }
.qr svg { display: block; width: 100%; height: auto; background: #ffffff; padding: 10px; border-radius: 10px; }
.qr .qr-data-dark { fill: #000000; }
.qr figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.steps { padding-left: 1.3em; }
.steps li { margin: 6px 0; }
.button { display: inline-block; padding: 10px 16px; border-radius: 10px; background: var(--brand); color: var(--bg); font-weight: 650; text-decoration: none; }
.button.secondary { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.button code { font-size: 0.9em; }
.blueprints { list-style: none; padding: 0; display: grid; gap: 12px; }
.blueprints li { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.blueprints li p { margin: 8px 0; }
.blueprints code.break { overflow-wrap: anywhere; }
h4 { font-size: 1rem; margin: 1.2em 0 0.4em; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; list-style: none; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; }
.variants { display: grid; gap: 0 24px; }
.with-shot { display: grid; gap: 8px 24px; align-items: start; }
.shots { display: flex; flex-wrap: wrap; gap: 16px; }
.shot { margin: 8px 0; }
.shot img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.shot figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.eco { display: grid; gap: 0 24px; }
.eco-situation h3 { display: flex; align-items: center; gap: 8px; }
.gestures { padding: 0; list-style: none; }
.gestures li { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.gestures .mdi { flex: none; color: var(--brand); margin-top: 1px; }
.warning { padding: 8px 12px; border-left: 4px solid var(--brand); background: var(--bg); border-radius: 6px; }
.code { overflow-x: auto; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }

/* About */
.signals th { white-space: nowrap; }
blockquote { margin: 8px 0 14px; padding: 8px 14px; border-left: 4px solid var(--border); color: var(--muted); }
.legal dt { font-weight: 650; margin-top: 10px; }
.legal dd { margin: 2px 0 0; }
.missing { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--stale-bg); color: var(--stale-text); font-style: italic; }

/* Footer */
.bottom { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0 26px; font-size: 0.88rem; color: var(--muted); }
.bottom p { margin: 6px 0; }
.bottom .source { color: var(--text); }
.bottom .attribution { font-size: 0.82rem; }

@media (min-width: 640px) {
    h1 { font-size: 2rem; }
    .now { flex-direction: row; align-items: center; gap: 28px; padding: 28px; }
    .now-icon { width: 150px; height: 150px; }
    .now-facts { grid-template-columns: auto 1fr; column-gap: 28px; }
    .days { grid-template-columns: repeat(2, 1fr); }
    .tiles { grid-template-columns: repeat(4, 1fr); }
    .ntfy { grid-template-columns: 220px 1fr; align-items: start; }
    .variants { grid-template-columns: 1fr 1fr; }
    .with-shot { grid-template-columns: 1fr auto; }
    .calendar td { height: 64px; }
    .calendar.compact td { height: 26px; }
}

@media (min-width: 960px) {
    .days { grid-template-columns: repeat(5, 1fr); }
    .eco { grid-template-columns: repeat(3, 1fr); }
    .day-card { padding: 14px; }
    .chart { height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}

/* "Cyclone en cours" (EDF flag): banner on every page, calendar mark. Words and pictogram, never colour alone. */
:root { --cyclone-bg: #ede9fe; --cyclone-text: #3b0764; --cyclone-border: #6d28d9; }
@media (prefers-color-scheme: dark) {
    :root { --cyclone-bg: #2e1065; --cyclone-text: #ede9fe; --cyclone-border: #a78bfa; }
}
.cyclone { background: var(--cyclone-bg); color: var(--cyclone-text); padding: 10px 0; border-bottom: 3px solid var(--cyclone-border); }
.cyclone-inner { display: flex; align-items: flex-start; gap: 10px; }
.cyclone-inner p { margin: 0; }
.cyclone-inner .cyclone-icon { margin-top: 1px; }
.cyclone-source { display: block; font-size: 0.9rem; }
.calendar .icons { display: inline-flex; gap: 3px; align-items: center; }
.cyclone-swatch { background: var(--cyclone-bg); color: var(--cyclone-text); }
.frieze span.is-cyclone { background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--cyclone-border) 3px 5px); }
.cyclone-hours { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 0.9rem; color: var(--cyclone-text); background: var(--cyclone-bg); border-radius: 6px; padding: 2px 8px; width: fit-content; }
.cyclone-hours .cyclone-icon { flex: none; }
