/* =========================================================================
   Documentation CMS Kaina — feuille commune
   Reprend la grammaire visuelle du suivi académique « Oreille Digitale » :
   navigation latérale fixe, sections numérotées, dépliants techniques.
   ========================================================================= */
:root{
  --nuit:#0E1219; --nuit-2:#141A24; --nuit-3:#1B2331;
  --clair:#F6F7F9; --clair-2:#ECEEF2; --clair-3:#DDE1E8;
  --ambre:#D98A3D; --vermillon:#C4472C; --cyan:#3E8E9E; --vert:#3F7D58;
  --ground:var(--clair); --surface:#FFFFFF; --surface-2:var(--clair-2);
  --texte:#171C24; --texte-2:#4A5563; --texte-3:#7C8797;
  --bord:var(--clair-3); --accent:var(--vermillon); --accent-2:var(--ambre);
  --mesure:var(--cyan); --ok:var(--vert);
  --code-bg:#F2F4F7;
  --nav-l:262px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --ground:var(--nuit); --surface:var(--nuit-2); --surface-2:var(--nuit-3);
  --texte:#E8EBF0; --texte-2:#A6B0BF; --texte-3:#717C8C;
  --bord:#2A3341; --accent:#E4654A; --accent-2:#E5A45E; --mesure:#5FB4C4;
  --ok:#6FB98A; --code-bg:#111823;
}}
:root[data-theme="dark"]{
  --ground:var(--nuit); --surface:var(--nuit-2); --surface-2:var(--nuit-3);
  --texte:#E8EBF0; --texte-2:#A6B0BF; --texte-3:#717C8C;
  --bord:#2A3341; --accent:#E4654A; --accent-2:#E5A45E; --mesure:#5FB4C4;
  --ok:#6FB98A; --code-bg:#111823;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}
  *{animation:none!important;transition:none!important}}
body{margin:0;background:var(--ground);color:var(--texte);
  font-weight:400;font-size:16px;line-height:1.62;
  font-family:"Source Serif 4",Georgia,serif;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{margin:0;text-wrap:balance}
a{color:var(--accent)}
a:focus-visible,button:focus-visible,summary:focus-visible{
  outline:2px solid var(--accent);outline-offset:3px}

/* ---- navigation laterale ---- */
.nav{position:fixed;top:0;left:0;bottom:0;width:var(--nav-l);background:var(--surface);
  border-right:1px solid var(--bord);overflow-y:auto;padding:26px 0 30px;z-index:40}
.nav-marque{padding:0 22px 20px;border-bottom:1px solid var(--bord);margin-bottom:18px}
.nav-marque .t{font-weight:600;font-size:13px;line-height:1.3;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.04em;color:var(--texte)}
.nav-marque .s{font-weight:400;font-size:10px;line-height:1.5;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.1em;
  text-transform:uppercase;color:var(--texte-3);margin-top:5px}
.nav-grp{padding:0 14px;margin-bottom:20px}
.nav-grp > .lbl{font-weight:600;font-size:9.5px;line-height:1;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.15em;
  text-transform:uppercase;color:var(--texte-3);padding:0 8px 9px}
.nav a{display:flex;gap:9px;padding:7px 8px;border-radius:3px;text-decoration:none;
  color:var(--texte-2);font-weight:400;font-size:13.5px;line-height:1.4;
  font-family:"Source Serif 4",Georgia,serif;border-left:2px solid transparent}
.nav a:hover{background:var(--surface-2);color:var(--texte)}
.nav a.actif{color:var(--texte);border-left-color:var(--accent);
  background:var(--surface-2);font-weight:600}
.nav a .n{font-weight:500;font-size:10px;line-height:1.6;
  font-family:"IBM Plex Mono",monospace;color:var(--texte-3);min-width:17px}
.nav a.actif .n{color:var(--accent)}
.nav-pied{padding:16px 22px 0;margin-top:6px;border-top:1px solid var(--bord)}
.nav-pied a{padding:5px 0;font-size:12px;border:none}

.bascule{position:fixed;top:14px;left:14px;z-index:60;display:none;
  background:var(--surface);border:1px solid var(--bord);border-radius:4px;
  width:38px;height:38px;cursor:pointer;color:var(--texte);font-size:17px;line-height:1}
.voile{position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:35;display:none}
@media(max-width:980px){
  .nav{transform:translateX(-100%);transition:transform .22s}
  .nav.ouvert{transform:none}
  .bascule{display:block}
  .voile.on{display:block}
  main{margin-left:0!important}
}

/* ---- corps ---- */
main{margin-left:var(--nav-l)}
.large{max-width:1020px;margin:0 auto;padding:0 40px}
@media(max-width:980px){.large{padding:0 22px}}

/* ---- ouverture ---- */
.ouverture{padding:64px 0 0}
@media(max-width:980px){.ouverture{padding-top:66px}}
.eyebrow{font-weight:500;font-size:10.5px;line-height:1;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.2em;
  text-transform:uppercase;color:var(--accent);margin-bottom:20px}
.ouverture h1{font-weight:300;font-size:clamp(2.2rem,5.4vw,3.7rem);
  line-height:1.04;letter-spacing:-.02em}
.ouverture h1 em{font-style:italic;color:var(--accent)}
.resume{margin-top:22px;max-width:64ch;font-size:1.13rem;line-height:1.6;color:var(--texte-2)}
.resume strong{color:var(--texte);font-weight:600}

/* ---- bandeau chiffres ---- */
.mesures{display:grid;gap:1px;background:var(--bord);border:1px solid var(--bord);
  border-radius:4px;overflow:hidden;margin-top:26px}
@media(min-width:700px){.mesures{grid-template-columns:repeat(4,1fr)}}
.mesure{background:var(--surface);padding:17px 19px}
.mesure .k{font-weight:500;font-size:9.5px;line-height:1;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.13em;
  text-transform:uppercase;color:var(--texte-3);margin-bottom:9px}
.mesure .v{font-weight:300;font-size:1.75rem;line-height:1;
  font-family:"Source Serif 4",serif;font-variant-numeric:tabular-nums;
  letter-spacing:-.02em}
.mesure .v.ok{color:var(--accent-2)}
.mesure .v small{font-size:1rem;color:var(--texte-3)}
.mesure .d{font-size:.82rem;color:var(--texte-3);margin-top:6px;line-height:1.4}

/* ---- sections ---- */
section{padding:58px 0;border-bottom:1px solid var(--bord);scroll-margin-top:20px}
.s-tete{display:flex;gap:18px;align-items:baseline}
.s-num{font-weight:600;font-size:11px;line-height:1.9;
  font-family:"IBM Plex Mono",monospace;color:var(--accent);
  letter-spacing:.1em;white-space:nowrap}
h2{font-weight:400;font-size:clamp(1.5rem,3vw,2.15rem);line-height:1.14;letter-spacing:-.015em}
.s-sous{margin:14px 0 0;max-width:66ch;font-size:1.04rem;line-height:1.6;color:var(--texte-2)}
.s-sous + .s-sous{margin-top:11px}
.s-sous strong{color:var(--texte);font-weight:600}
h3{font-weight:600;font-size:1.06rem;line-height:1.3;margin:30px 0 10px;letter-spacing:-.01em}

/* ---- depliant ---- */
details{margin-top:20px;border:1px solid var(--bord);border-radius:4px;background:var(--surface)}
summary{cursor:pointer;list-style:none;padding:13px 18px;display:flex;
  justify-content:space-between;align-items:center;gap:14px;
  font-weight:600;font-size:11px;line-height:1.4;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.09em;
  text-transform:uppercase;color:var(--accent-2)}
summary::-webkit-details-marker{display:none}
summary::after{content:"+";font-size:16px;color:var(--texte-3);font-weight:400;flex:none}
details[open] summary::after{content:"–"}
details[open] summary{border-bottom:1px solid var(--bord)}
.dcorps{padding:20px 22px 22px}
.dcorps > *{max-width:72ch}
.dcorps > .tbl,.dcorps > .fig,.dcorps > pre{max-width:none}
.dcorps p{margin:0 0 15px;font-size:.99rem;line-height:1.65;color:var(--texte-2)}
.dcorps p:last-child{margin-bottom:0}
.dcorps strong{color:var(--texte);font-weight:600}
.dcorps ul,.dcorps ol{margin:0 0 15px;padding-left:1.25rem;color:var(--texte-2)}
.dcorps li{margin-bottom:7px;font-size:.97rem;line-height:1.6}
.terme{color:var(--accent);font-weight:600}

/* ---- code ---- */
code{font-family:"IBM Plex Mono",monospace;font-size:.85em;
  background:var(--code-bg);padding:.13em .38em;border-radius:3px;
  border:1px solid var(--bord)}
pre{margin:20px 0 0;background:var(--code-bg);border:1px solid var(--bord);
  border-radius:4px;padding:16px 18px;overflow-x:auto}
pre code{background:none;border:none;padding:0;font-size:12.4px;line-height:1.62;
  display:block;white-space:pre;color:var(--texte-2)}
pre.court{margin-top:14px}
.cle{color:var(--accent)}
.val{color:var(--mesure)}
.cmt{color:var(--texte-3);font-style:italic}

/* ---- schemas ---- */
.fig{margin-top:26px;background:var(--surface);border:1px solid var(--bord);
  border-radius:4px;overflow:hidden;line-height:0}
.fig img{width:100%;height:auto;display:block}
.fig figcaption{padding:13px 18px;border-top:1px solid var(--bord);line-height:1.55;
  font-weight:400;font-size:11.5px;font-family:"IBM Plex Mono",monospace;
  color:var(--texte-3);letter-spacing:.02em}

/* ---- tableaux ---- */
.tbl{overflow-x:auto;margin-top:24px;border:1px solid var(--bord);border-radius:4px}
table{border-collapse:collapse;width:100%;background:var(--surface);
  font-size:.9rem;min-width:620px}
th,td{padding:11px 15px;text-align:left;border-bottom:1px solid var(--bord);vertical-align:top}
th{font-weight:600;font-size:10px;line-height:1.35;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.09em;text-transform:uppercase;
  color:var(--texte-3);white-space:nowrap;background:var(--surface-2)}
tr:last-child td{border-bottom:none}
td.mono,.mono{font-family:"IBM Plex Mono",monospace;font-size:.83rem;
  font-variant-numeric:tabular-nums}
.oui{color:var(--ok);font-weight:600}
.non{color:var(--accent);font-weight:600}
.part{color:var(--mesure);font-weight:600}
.nul{color:var(--texte-3)}

/* ---- encart ---- */
.note{margin-top:24px;padding:19px 22px;background:var(--surface);
  border-left:2px solid var(--accent);border-radius:0 4px 4px 0}
.note.ok{border-left-color:var(--ok)}
.note.info{border-left-color:var(--mesure)}
.note p{margin:0;font-size:1.01rem;line-height:1.58}
.note p+p{margin-top:12px}
.note .src{display:block;margin-top:11px;font-weight:400;font-size:10.5px;
  line-height:1.5;font-family:"IBM Plex Mono",monospace;color:var(--texte-3)}

.grille{display:grid;gap:16px;margin-top:24px}
@media(min-width:760px){.g2{grid-template-columns:1fr 1fr}
  .g3{grid-template-columns:repeat(3,1fr)}}
.carte{background:var(--surface);border:1px solid var(--bord);border-radius:4px;padding:19px 21px}
.carte h4{font-weight:600;font-size:10.5px;line-height:1.3;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.1em;
  text-transform:uppercase;color:var(--accent-2);margin-bottom:11px}
.carte p{margin:0;font-size:.94rem;line-height:1.55;color:var(--texte-2)}
.carte p+p{margin-top:9px}

/* ---- etiquettes de statut ---- */
.tag{display:inline-block;font-weight:600;font-size:9px;line-height:1.6;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.1em;text-transform:uppercase;
  padding:.18em .6em;border-radius:3px;border:1px solid currentColor;
  white-space:nowrap;flex:none}
.tag-regle{color:var(--ok)}
.tag-mythe{color:var(--accent)}
.tag-conv{color:var(--mesure)}

footer{padding:46px 0 70px}
footer h3{font-weight:600;font-size:10px;line-height:1;margin:0 0 16px;
  font-family:"IBM Plex Mono",monospace;letter-spacing:.16em;
  text-transform:uppercase;color:var(--texte-3)}
.srcs{list-style:none;padding:0;margin:0;display:grid;gap:8px;max-width:78ch}
.srcs li{font-size:.87rem;line-height:1.5;color:var(--texte-2)}
.srcs a{text-decoration:none;border-bottom:1px solid transparent}
.srcs a:hover{border-bottom-color:var(--accent)}

/* ---- sous-menu : les ancres de la page ouverte ---- */
.nav a.sous{padding-left:20px;font-size:12.6px;color:var(--texte-3)}
.nav a.sous:hover{color:var(--texte-2)}
.nav a.sous.actif{color:var(--texte);font-weight:600;
  border-left-color:var(--accent);background:var(--surface-2)}
.nav a.sous .n{min-width:11px}

/* ---- citation dans un dépliant ---- */
blockquote{margin:0 0 15px;padding:12px 0 12px 16px;
  border-left:2px solid var(--bord);color:var(--texte-2);
  font-style:italic;font-size:.97rem;line-height:1.6}
blockquote strong{font-style:normal}

/* ---- bandeau de mesures resserré (têtes de section) ---- */
.mesures.serre{margin-top:24px}
.mesures.serre .mesure{padding:15px 17px;display:flex;
  flex-direction:column-reverse;gap:7px}
.mesures.serre .v{font-size:1.5rem}
.mesures.serre .k{margin-bottom:0;text-transform:none;letter-spacing:.02em;
  font-size:10.5px;line-height:1.45;white-space:normal}
.mesures.serre .v sup{font-size:.6em;vertical-align:super}

/* ---- graphique à barres (reconstruit, pas de SVG) ---- */
.fig.graphe{line-height:1.5;padding:0}
.fig figcaption.haut{border-top:none;border-bottom:1px solid var(--bord)}
.barres{display:grid;grid-template-columns:auto 1fr auto;
  gap:9px 13px;align-items:center;padding:20px 18px}
.bar-l{font-family:"IBM Plex Mono",monospace;font-size:11.5px;
  color:var(--texte-2);white-space:nowrap}
.bar-t{background:var(--surface-2);border-radius:3px;height:13px;overflow:hidden}
.bar{display:block;height:100%;background:var(--accent);
  border-radius:3px;opacity:.82}
.bar.best{background:var(--ok);opacity:1}
.bar-v{font-family:"IBM Plex Mono",monospace;font-size:11.5px;
  color:var(--texte-3);white-space:nowrap;font-variant-numeric:tabular-nums}
.bar-v.best{color:var(--ok);font-weight:600}

/* ---- listes nues dans les têtes ---- */
.liste-nue{margin:18px 0 0;padding-left:1.15rem;color:var(--texte-2)}
.liste-nue li{margin-bottom:8px;font-size:.97rem;line-height:1.6}

/* ---- couleurs de statut héritées du référentiel ---- */
td.ok{color:var(--ok)}
td.no,td.warn{color:var(--accent)}
td.myth{color:var(--mesure)}

/* ---- les URL de source doivent se couper ----
   Une URL n'a aucune espace : sans point de coupure explicite, elle
   déborde du conteneur sur écran étroit et fait défiler la page
   horizontalement. Mesuré à 390 px : 483 px de large pour un viewport
   de 390. */
.src{overflow-wrap:anywhere}
.dcorps a[href^="http"],.note a[href^="http"]{overflow-wrap:anywhere}

/* ---- arborescence visuelle ----
   Une grille à trois colonnes plutôt qu'un <pre> : le texte se replie sur
   écran étroit, et chaque ligne peut porter une description. */
.arbre{margin-top:26px;border:1px solid var(--bord);border-radius:4px;
  background:var(--surface);overflow:hidden}
.arbre-l{display:grid;grid-template-columns:minmax(210px,1.1fr) minmax(120px,.8fr) 2fr;
  gap:0 18px;padding:11px 18px;border-bottom:1px solid var(--bord);
  align-items:baseline}
.arbre-l:last-child{border-bottom:none}
.arbre-l.dos{background:var(--surface-2)}
/* Un nom de fichier ne doit PAS être tronqué : c'est l'information que le
   lecteur vient chercher. Il se replie sur le tiret plutôt que de disparaître. */
.arbre-n{font-family:"IBM Plex Mono",monospace;font-size:12.5px;
  line-height:1.5;color:var(--texte);overflow-wrap:anywhere}
.arbre-l.dos .arbre-n{font-weight:600;color:var(--accent)}
.arbre-l.fic .arbre-n{color:var(--texte-2);padding-left:18px}
.arbre-m{font-family:"IBM Plex Mono",monospace;font-size:11px;line-height:1.5;
  color:var(--texte-3);font-variant-numeric:tabular-nums}
.arbre-d{font-size:.9rem;line-height:1.5;color:var(--texte-2)}
.arbre-d strong{color:var(--texte)}
.arbre-t{display:grid;grid-template-columns:minmax(210px,1.1fr) minmax(120px,.8fr) 2fr;
  gap:0 18px;padding:9px 18px;background:var(--surface-2);
  border-bottom:1px solid var(--bord);
  font-weight:600;font-size:9.5px;font-family:"IBM Plex Mono",monospace;
  letter-spacing:.13em;text-transform:uppercase;color:var(--texte-3)}
@media(max-width:900px){
  .arbre-l,.arbre-t{grid-template-columns:1fr;gap:5px}
  .arbre-t{display:none}
  .arbre-l.fic .arbre-n{padding-left:14px}
}
