/* Carnet de Vol — feuille de style
   Direction : écrans de cockpit. Le code couleur suit la philosophie ECAM :
   cyan = interactif, vert = confirmé, ambre = prudence, magenta = route / trajectoire.
   Typographie : B612 (police d'écran de cockpit, Airbus/ENAC, licence libre) pour l'interface
   et les données ; Source Serif 4 pour les récits. */

:root {
  --bg: #0e1a24;
  --panel: #132331;
  --panel-2: #172a3a;
  --line: #233749;
  --line-strong: #36526b;
  --ink: #e6edf2;
  --dim: #95aab9;
  --cyan: #46d3e3;
  --green: #55d68a;
  --amber: #f3ae45;
  --magenta: #da76de;
  --ui: 'B612', 'Segoe UI', system-ui, sans-serif;
  --text: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --wrap: 1120px;
  --r: 4px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #edf1f3;
  --panel: #ffffff;
  --panel-2: #f5f8f9;
  --line: #cbd6dd;
  --line-strong: #9db0bd;
  --ink: #10202b;
  --dim: #4b6170;
  --cyan: #07707c;
  --green: #1c7a43;
  --amber: #955800;
  --magenta: #8d2c93;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--ui);
}
img { max-width: 100%; height: auto; }
a { color: var(--cyan); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.wrap, .container { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; margin-right: auto; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark .sky { fill: var(--panel-2); }
.brand-mark .ground { fill: var(--line-strong); }
.brand-mark .ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.brand-mark .wings { fill: none; stroke: var(--amber); stroke-width: 2.2; stroke-linecap: round; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: var(--r); font-size: 15px; }
.nav a:hover { color: var(--cyan); }
.nav a[aria-current="page"] { color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); border-radius: 0; }
.theme-toggle, .nav-toggle, .btn, .seg {
  font: inherit; font-size: 14px; color: var(--cyan); background: transparent;
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 7px 12px; cursor: pointer;
}
.theme-toggle { margin-left: 8px; }
.theme-toggle:hover, .nav-toggle:hover, .btn:hover, .seg:hover { border-color: var(--cyan); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; align-items: stretch;
         background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .theme-toggle { margin: 12px 0 0; align-self: flex-start; }
}

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; color: var(--dim); font-size: 14px; }
.site-footer .wrap, .site-footer .container { padding: 24px 0 40px; }
.site-footer p { margin: 0 0 6px; max-width: 70ch; }

/* ---------- Éléments communs ---------- */
main { display: block; }
.link { color: var(--cyan); text-decoration: none; border-bottom: 1px solid transparent; }
.link:hover { border-bottom-color: var(--cyan); }
.empty { color: var(--dim); margin: 0; padding: 18px 0; max-width: 60ch; }
.notice { border-left: 3px solid var(--amber); padding: 10px 14px; color: var(--dim); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.count { color: var(--dim); font-size: 14px; margin: 8px 0 12px; }

/* ---------- Accueil : en-tête et enregistreur ---------- */
.hero { padding: 56px 0 8px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-bottom: 40px; }
.hero-title { font-size: clamp(32px, 5vw, 60px); line-height: 1.06; font-weight: 700; letter-spacing: -0.015em; margin: 0; max-width: 15ch; text-wrap: balance; }
.hero-lede { font-family: var(--text); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--dim); max-width: 46ch; margin: 0; }
@media (max-width: 860px) { .hero-top { grid-template-columns: 1fr; } }
.recorder { margin: 0; padding: 8px 0 0; }
.recorder-plot { position: relative; padding-top: 34px; }
.rec-notes a { background: linear-gradient(var(--bg), var(--bg)) no-repeat 0 0 / 100% 2.7em; }
.rec-notes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.rec-notes li { position: absolute; top: 0; white-space: nowrap; }
.rec-notes a { pointer-events: auto; display: block; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.3; height: 100%;
               border-left: 1px solid var(--amber); padding: 0 0 0 7px; margin-left: -0.5px; }
.rec-notes li.is-right { transform: translateX(-100%); }
.rec-notes li.is-right a { border-left: 0; border-right: 1px solid var(--amber); padding: 0 7px 0 0; margin: 0 -0.5px 0 0; text-align: right; }
.rec-note-k { display: block; font-weight: 400; font-size: 12px; color: var(--amber); }
.rec-notes a:hover { color: var(--cyan); }
@media (max-width: 640px) { .rec-notes { display: none; } }
.recorder-svg { display: block; width: 100%; height: clamp(120px, 16vw, 170px); overflow: visible; }
.rec-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rec-base { stroke: var(--line-strong); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rec-year { fill: var(--dim); font: 400 11px var(--ui); }
.rec-hit { fill: transparent; }
.rec-line { stroke: var(--ink); stroke-opacity: .62; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: square;
            transform-box: fill-box; transform-origin: 50% 100%; }
.rec-bar:hover .rec-line, .rec-bar:focus .rec-line, .rec-bar.is-active .rec-line { stroke: var(--cyan); stroke-opacity: 1; stroke-width: 3; }
.rec-bar:focus { outline: none; }
.rec-bar:focus-visible .rec-hit { stroke: var(--cyan); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rec-readout { margin: 6px 0 0; min-height: 3em; font-size: 15px; color: var(--dim); }
.rec-readout strong { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .rec-line { animation: rec-trace .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 18ms); }
  @keyframes rec-trace { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}

/* ---------- Accueil : actualités ---------- */
.home-news { margin-top: 48px; }
.history { margin-top: 64px; }
.history-lede { font-family: var(--text); font-size: 17px; color: var(--dim); margin: 0 0 8px; max-width: 60ch; }
.teasers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 0; border-left: 1px solid var(--line); }
.teaser { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 4px 20px 8px; border-right: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.teaser:hover .teaser-title { color: var(--cyan); }
.teaser-title { font-family: var(--text); font-size: 19px; line-height: 1.35; font-weight: 600; }
.teaser-meta { color: var(--dim); font-size: 13px; margin-top: auto; }
.status { align-self: flex-start; font-size: 12px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 2px; }
.status-official { color: var(--green); }
.status-corroborated { color: var(--cyan); }
.status-single { color: var(--amber); }
@media (max-width: 860px) { .teasers { grid-template-columns: 1fr; border-left: 0; } .teaser { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 0; } }

/* ---------- Accueil : base historique ---------- */
.base { margin-top: 56px; }
.view-switch { display: inline-flex; }
.seg { border-radius: 0; color: var(--dim); }
.seg:first-child { border-radius: var(--r) 0 0 var(--r); }
.seg:last-child { border-radius: 0 var(--r) var(--r) 0; border-left: 0; }
.seg.is-on { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }
.toolbar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(140px, 1fr)); gap: 8px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 9px 10px; min-height: 40px;
}
.field input::placeholder { color: var(--dim); }
@media (max-width: 960px) { .toolbar { grid-template-columns: 1fr 1fr; } .field-search { grid-column: 1 / -1; } }

/* Bandes de progression de vol (strips) */
.strips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.strip {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) minmax(0, 230px) 118px; align-items: stretch;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 2px;
  color: var(--ink); text-decoration: none; min-height: 64px;
}
.strip > span { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.strip > span + span { border-left: 1px solid var(--line); }
.strip:hover { border-left-color: var(--cyan); background: var(--panel-2); }
.strip:hover .strip-title { color: var(--cyan); }
.strip-code { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.strip-nocode { color: var(--dim); }
.strip-year { font-weight: 400; font-size: 13px; color: var(--dim); }
.strip-title { font-weight: 700; font-size: 16px; }
.strip-sub, .strip-ac { color: var(--dim); font-size: 14px; }
.strip-sub { font-family: var(--text); font-size: 15px; }
.strip-sub, .strip-title, .strip-ac { overflow: hidden; text-overflow: ellipsis; }
.strip-toll { text-align: right; align-items: flex-end; }
.strip-num { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.strip-unit, .strip-surv { font-size: 12px; color: var(--dim); }
.strip-surv { color: var(--green); }
@media (max-width: 760px) {
  .strip { grid-template-columns: 76px minmax(0, 1fr) 84px; }
  .strip-ac { display: none !important; }
  .strip > span { padding: 10px; }
  .strip-code { font-size: 14px; }
}

.map { height: 340px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.map-large { height: min(560px, 70vh); }
.leaflet-container { font-family: var(--ui); }

/* ---------- Fiche accident ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 14px; padding: 24px 0 8px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 8px 48px; grid-template-areas: "head head" "body side"; }
.detail-head { grid-area: head; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.detail-code { margin: 8px 0 0; font-weight: 700; font-size: 15px; color: var(--amber); }
.detail-head h1 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.15; margin: 6px 0 24px; max-width: 26ch; }
.datablock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0; }
.db-cell { background: var(--panel); padding: 10px 14px; }
.db-cell dt { font-size: 12px; color: var(--dim); }
.db-cell dd { margin: 2px 0 0; font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .datablock { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.detail-body { grid-area: body; min-width: 0; }
.detail-side { grid-area: side; }
.story, .prose { font-family: var(--text); font-size: 18px; line-height: 1.68; max-width: 68ch; }
.story h3 { font-family: var(--ui); font-size: 16px; margin: 32px 0 6px; color: var(--ink); }
.story h3:first-child { margin-top: 0; }
.story p { margin: 0 0 16px; }
.detail-map { margin: 32px 0 0; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--dim); padding-top: 8px; }
.lg::before { content: ""; display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; }
.lg-route::before { border-top: 2px dashed var(--magenta); }
.lg-site::before { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.detail-fig { margin: 32px 0 0; }
.detail-fig img { display: block; border: 1px solid var(--line); }
.detail-fig figcaption { font-size: 13px; color: var(--dim); padding-top: 6px; }
.side-block { border-top: 2px solid var(--line-strong); padding-top: 12px; margin-bottom: 32px; }
.side-block h2 { font-size: 15px; margin: 0 0 10px; }
.sources { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.sources li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.sources a { text-decoration: none; }
.sources a:hover { text-decoration: underline; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; grid-template-areas: "head" "body" "side"; } .detail-side { margin-top: 32px; } }

.prose { padding-top: 40px; }
.prose h1 { font-family: var(--ui); font-size: 34px; line-height: 1.15; }

/* ---------- Pages statiques des accidents (/accidents/…/) ---------- */
.article { width: min(760px, 100% - 32px); margin: 0 auto; padding-top: 24px; }
.article .back { display: inline-block; margin-bottom: 16px; text-decoration: none; font-size: 14px; }
.article h1 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; margin: 0 0 8px; }
.article .meta { color: var(--dim); font-size: 14px; margin: 0 0 20px; }
.article .hero { display: block; padding: 0; margin: 0 0 24px; border: 1px solid var(--line); }
.article .sources { margin-top: 32px; border-top: 2px solid var(--line-strong); padding-top: 12px; }
.article .sources h2 { font-family: var(--ui); font-size: 15px; margin: 0 0 8px; }
.article .sources ul { list-style: none; padding: 0; margin: 0; }
.article > p .btn { display: inline-block; margin-top: 24px; text-decoration: none; }
.list { width: min(760px, 100% - 32px); margin: 0 auto; padding-top: 24px; }
.list ul { padding-left: 18px; line-height: 1.9; }

/* ---------- Actualités ---------- */
.news-page { width: min(800px, 100% - 32px); }
.news-page .hero { padding: 48px 0 12px; }
.news-page .hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0 0 12px; }
.news-page .hero p { font-family: var(--text); font-size: 18px; color: var(--dim); margin: 0; max-width: 56ch; }
.news-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 20px 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.chip { padding: 5px 10px; font-size: 13px; color: var(--dim); }
.btn.chip.active { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }
.news-card { padding: 24px 0; border-top: 1px solid var(--line); }
.news-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; }
.news-cat { color: var(--dim); }
.news-status { padding: 2px 8px; border: 1px solid currentColor; border-radius: 2px; font-size: 12px; color: var(--dim); }
.news-status.st-official { color: var(--green); }
.news-status.st-corroborated { color: var(--cyan); }
.news-status.st-draft { color: var(--amber); }
.news-status.st-single { color: var(--amber); }
.news-title { font-size: 24px; line-height: 1.25; margin: 10px 0 6px; }
.news-card p.meta { font-family: var(--ui); color: var(--dim); font-size: 13px; line-height: 1.4; margin: 0 0 12px; }
.news-card p { font-family: var(--text); font-size: 18px; line-height: 1.6; margin: 0 0 12px; max-width: 68ch; }
.news-card .news-chapo { font-weight: 600; }
.news-warning { border-left: 3px solid var(--amber); padding-left: 12px; color: var(--dim); }
.news-sources summary { cursor: pointer; color: var(--cyan); font-size: 14px; }
.news-sources ul { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.news-sources li { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.news-sources li .meta { display: inline; margin: 0; }
.news-method { margin-top: 48px; border-top: 2px solid var(--line-strong); padding-top: 14px; color: var(--dim); font-size: 15px; }
.news-method h2 { font-size: 16px; color: var(--ink); margin: 0 0 8px; }
.news-method p { font-family: var(--text); font-size: 16px; line-height: 1.6; max-width: 68ch; }

/* ---------- Formulaire de contact (pied de page de l'accueil) ---------- */
.contact { margin-top: 28px; max-width: 520px; }
.contact-title { font-size: 16px; color: var(--ink); margin: 0 0 10px; }
.contact-form { display: grid; gap: 6px; }
.contact-form label { font-size: 13px; color: var(--dim); margin-top: 6px; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 9px 10px;
}
.contact-form .btn { justify-self: start; margin-top: 8px; }
.contact-form .hint { font-size: 13px; margin: 6px 0 0; }
.news-note { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.prose h2 { font-family: var(--ui); font-size: 20px; margin: 36px 0 8px; }
.detail-fig .credit, .article .credit { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.detail-fig .credit a, .article .credit a { color: var(--dim); }
.hero-fig { margin: 0 0 24px; }
.hero-fig figcaption { font-size: 13px; color: var(--dim); padding-top: 6px; }
.article .hero-fig .hero { margin: 0; }
.news-title a { color: inherit; text-decoration: none; }
.news-title a:hover { color: var(--cyan); }
.news-single { border-top: 0; padding-top: 8px; }
.news-single .news-title { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; }
.news-sources-static { margin-top: 28px; border-top: 2px solid var(--line-strong); padding-top: 12px; }
.news-sources-static h2 { font-size: 15px; margin: 0 0 8px; }
.news-sources-static ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.news-sources-static li { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.db-note { display: block; font-size: 12px; color: var(--dim); }
