/* Mode auto : sombre par défaut, clair si le système est réglé en clair */
:root {
  color-scheme: dark light;
  --bg: #111214;
  --panel: #1b1d21;
  --line: #2c2f35;
  --grille: #2a2d33;
  --text: #e9e7e3;
  --texte2: #c9c6bf;
  --muted: #9a9890;
  --lien: #b8b5ad;
  --titre-src: #8f8c85;
  --sep: #5d5f64;
  --fort: #fff;
  --rouge: #d64545;
  --survol: rgba(255,255,255,.08);
  --eclair: rgba(214,69,69,.28);
  --fond-deces: #0b0b0c;
  --bulle-sec: #4a4a4a;
  /* Couleurs des catégories : validées (contraste, daltonisme) sur le fond sombre */
  --oeil: #c38616;
  --amputation: #c8393a;
  --deces: #7a76bf;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5f1;
    --panel: #eeebe5;
    --line: #dcd8d0;
    --grille: #e3dfd8;
    --text: #1b1c1f;
    --texte2: #3d3c38;
    --muted: #5f5c55;
    --lien: #4e4b45;
    --titre-src: #6b6861;
    --sep: #a19d95;
    --fort: #000;
    --rouge: #c03434;
    --survol: rgba(0,0,0,.06);
    --eclair: rgba(192,52,52,.18);
    --fond-deces: #ebe8e2;
    --bulle-sec: #b5b2aa;
    /* Validées sur le fond clair (contraste ≥ 3, écarts daltonisme ≥ 15) */
    --oeil: #b57d00;
    --amputation: #a8262b;
    --deces: #5e58b0;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--text); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); padding: 48px 0 32px; }
h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
h1::after { content: ""; display: block; width: 64px; height: 4px; background: var(--rouge); margin-top: 14px; }
.lead { max-width: 62ch; color: var(--muted); margin: 0 0 28px; }

.stats { position: relative; display: grid; gap: 18px; max-width: 980px; }
.decompte-titre { margin: 0 0 6px; font-size: .95rem; color: var(--muted); }
.decompte-titre b { font-size: 1.6rem; color: var(--c); font-variant-numeric: tabular-nums; margin-right: 2px; }
.decompte-icones { display: flex; flex-wrap: wrap; gap: 2px; }
.ic {
  display: inline-flex; padding: 2px; border: 0; border-radius: 4px;
  background: none; color: var(--c); cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.ic:hover, .ic:focus-visible { transform: scale(1.25); background: var(--survol); }
.ic:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.decompte.deces .ic { color: var(--deces); }
.ic-bulle {
  position: absolute; z-index: 30; transform: translate(-50%, calc(-100% - 8px));
  padding: 6px 10px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.35;
  pointer-events: none; white-space: nowrap;
}
.ic-bulle[hidden] { display: none; }
/* Ligne ciblée depuis une icône */
.ligne.eclair { animation: eclair 1.8s ease; }
@keyframes eclair { 0%, 30% { background: var(--eclair); } 100% { background: transparent; } }
@media (max-width: 600px) {
  .ic svg { width: 19px; height: 19px; }
  .ic-bulle { white-space: normal; width: max-content; max-width: 240px; }
}
.oeil { --c: var(--oeil); }
.amputation { --c: var(--amputation); }
.deces { --c: var(--deces); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; }
.filters button {
  font: inherit; font-size: .9rem;
  color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; cursor: pointer;
}
.filters button:hover { border-color: var(--muted); }
.filters button.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---- Liste : une ligne par personne ---- */
.jour { margin-top: 30px; }
.jour h2 {
  font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--muted);
}
.jour ul { list-style: none; margin: 0; padding: 0; }
.ligne {
  display: grid;
  /* Large : 4 colonnes — type | phrase | arme | mouvement, sources dessous */
  grid-template-columns: 96px minmax(0, 1fr) minmax(120px, 150px) minmax(150px, 210px);
  grid-template-areas: "badge phrase arme ctx" ". src src src";
  gap: 4px 18px;
  align-items: baseline;
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--c);
}
.ligne:hover { background: var(--panel); }
.ligne.deces { background: var(--fond-deces); }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.phrase b { font-weight: 600; }
.contexte { display: block; min-width: 0; }
.mouvement { display: block; font-size: .85rem; font-style: italic; color: var(--texte2); }
.arme { font-size: .9rem; }
.source { display: block; margin-top: 2px; font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.source a { color: var(--muted); text-underline-offset: 2px; }
.source a:hover { color: var(--text); }

.ligne .badge { grid-area: badge; }
.ligne .phrase { grid-area: phrase; }
.ligne .arme { grid-area: arme; }
.ligne .contexte { grid-area: ctx; }
.ligne .sources { grid-area: src; }

/* Moyen : 2 colonnes — type et phrase à gauche, arme et mouvement à droite */
@media (max-width: 1000px) {
  .ligne {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 32%);
    grid-template-areas: "badge badge" "phrase arme" "phrase ctx" "src src";
    gap: 2px 18px; align-items: start;
  }
  .ligne .mouvement, .ligne .arme { font-size: .82rem; }
  .ligne .sources { margin-top: 4px; }
}
/* Petit : 1 colonne */
@media (max-width: 640px) {
  .ligne {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "badge" "phrase" "arme" "ctx" "src";
  }
  .ligne .mouvement, .ligne .arme { color: var(--muted); }
  .ligne .source { font-size: .72rem; }
}

/* ---- Variante frise chronologique (body.frise) ---- */
/* Axe de la frise : trait, cercles et points sont tous positionnés de la même façon
   (pseudo-éléments absolus) pour rester alignés quel que soit l'arrondi des pixels */
.frise #liste { position: relative; margin-left: 6px; padding-left: 30px; }
.frise #liste { --axe: 1px; }   /* abscisse du trait, depuis le bord gauche de #liste */
.frise #liste::before { content: ""; position: absolute; left: var(--axe); top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: var(--line); }
.frise .jour { position: relative; }
.frise .jour h2 { border-bottom: 0; padding-bottom: 4px; }
.frise .jour h2::before {
  content: ""; position: absolute; left: calc(var(--axe) - 30px); top: 1px; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--text);
}
.frise .ligne { border-left: 0; padding-left: 0; position: relative; }
.frise .ligne::before {
  content: ""; position: absolute; left: calc(var(--axe) - 30px); top: 17px; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--c);
}

.foot { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 24px; padding-bottom: 48px; color: var(--muted); font-size: .88rem; }
.foot p { max-width: 75ch; }

/* ---- Lien et page des mentions légales ---- */
.lien-legal { margin-top: 18px; font-size: .75rem; }
.lien-legal a { color: var(--muted); }
.legal { max-width: 720px; padding-top: 40px; padding-bottom: 64px; }
.legal h1 { font-size: 2rem; margin-bottom: 8px; }
.legal h1::after { margin-top: 10px; }
.legal h2 { font-size: 1.05rem; margin: 28px 0 6px; }
.legal p { margin: 0 0 10px; color: var(--texte2); }
.legal a { color: var(--text); }
.legal-retour { font-size: .85rem; }
.legal-retour a { color: var(--muted); }

/* Précision quand les circonstances sont incertaines */
.nuance {
  display: block; margin-top: 4px;
  font-size: .78rem; font-style: italic; color: var(--muted);
}
.nuance::before { content: "ⓘ "; font-style: normal; }

/* ---- Section « En chiffres » ---- */
:root { --gr-oeil: var(--oeil); --gr-amputation: var(--amputation); --gr-deces: var(--deces); }
.chiffres { position: relative; padding-top: 36px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.gr-titre-section { margin: 0 0 10px; font-size: 1.3rem; }
.gr-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 16px; padding: 0; font-size: .85rem; color: var(--texte2); }
.gr-legende li { display: flex; align-items: center; gap: 7px; }
.gr-pastille { width: 12px; height: 12px; border-radius: 3px; }
.gr-oeil { background: var(--gr-oeil); }
.gr-amputation { background: var(--gr-amputation); }
.gr-deces { background: var(--gr-deces); }
.gr-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gr-carte { margin: 0; padding: 16px 18px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.gr-large { grid-column: 1 / -1; }
.gr-carte figcaption { margin: 0 0 14px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Par année */
.gr-annees { padding-left: 26px; }
.gr-zone { position: relative; height: 210px; margin-bottom: 24px; }
.gr-grad { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grille); }
.gr-grad span { position: absolute; left: -26px; top: -8px; width: 20px; text-align: right; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gr-cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 4%; padding: 0 2%; }
.gr-col { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: flex-end; cursor: default; outline: none; }
.gr-col:hover .gr-pile, .gr-col:focus-visible .gr-pile { filter: brightness(1.18); }
.gr-col:focus-visible { box-shadow: 0 0 0 2px var(--text); border-radius: 4px; }
.gr-pile { position: relative; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; justify-content: flex-start; max-width: 46px; width: 100%; margin: 0 auto; }
.gr-pile .gr-seg { display: block; width: 100%; flex: none; }
.gr-pile .gr-seg:last-of-type { border-radius: 4px 4px 0 0; }
.gr-total { position: absolute; left: 0; right: 0; text-align: center; font-size: .75rem; color: var(--text); font-variant-numeric: tabular-nums; pointer-events: none; }
.gr-annee { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Barres horizontales */
.gr-barres { display: grid; gap: 10px; }
.gr-ligne { display: grid; gap: 4px; cursor: default; outline: none; border-radius: 4px; }
.gr-ligne:hover .gr-piste, .gr-ligne:focus-visible .gr-piste { filter: brightness(1.18); }
.gr-ligne:focus-visible { box-shadow: 0 0 0 2px var(--text); }
.gr-nom { font-size: .8rem; color: var(--texte2); }
.gr-piste { display: flex; align-items: center; gap: 2px; height: 14px; }
.gr-piste .gr-seg { display: block; height: 100%; flex: none; }
.gr-piste .gr-seg:last-of-type { border-radius: 0 4px 4px 0; }
.gr-val { margin-left: 6px; font-size: .75rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* Tableau et bulle */
.gr-donnees { margin: 14px 0 6px; font-size: .82rem; color: var(--muted); }
.gr-donnees summary { cursor: pointer; }
.gr-table { margin: 12px 0; border-collapse: collapse; font-size: .8rem; color: var(--texte2); }
.gr-table caption { text-align: left; font-weight: 700; color: var(--text); padding: 4px 0; }
.gr-table th, .gr-table td { padding: 3px 12px 3px 0; text-align: left; border-bottom: 1px solid var(--line); font-weight: 400; }
.gr-table td { text-align: right; font-variant-numeric: tabular-nums; }
.gr-bulle {
  position: absolute; z-index: 40; transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 10px; border-radius: 6px; background: var(--text); color: var(--bg);
  font-size: .78rem; line-height: 1.4; pointer-events: none; white-space: nowrap;
}
.gr-bulle[hidden] { display: none; }

@media (max-width: 760px) {
  .gr-grille { grid-template-columns: minmax(0, 1fr); }
  .gr-zone { height: 170px; }
  .gr-total { font-size: .65rem; }
  .gr-annee { font-size: .62rem; }
  .gr-table { display: block; overflow-x: auto; }
}

/* Lien vers la page « En chiffres » et page elle-même */
.lien-chiffres { margin: 18px 0 0; font-size: .9rem; }
.lien-chiffres a { color: var(--text); text-underline-offset: 3px; }
.lien-chiffres a:hover { color: var(--fort); }
.page-chiffres { padding-top: 32px; }
.page-chiffres .chiffres { padding-top: 12px; border-bottom: 0; }
.page-chiffres .gr-titre-section { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; }

/* Articles de presse sous la source */
.presse { display: block; margin-top: 3px; font-size: .72rem; line-height: 1.45; color: var(--muted); }
.presse a { color: var(--lien); text-underline-offset: 2px; }
.presse a:hover { color: var(--text); }
.presse .sep { color: var(--sep); }

/* Ligne « Sources : » sous la phrase, l'arme et le mouvement */
.sources {
  margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--grille);
  font-size: .72rem; line-height: 1.5; color: var(--muted);
}
.sources-titre { color: var(--titre-src); font-weight: 600; }
.sources a { color: var(--lien); text-underline-offset: 2px; }
.sources a:hover { color: var(--text); }
.sources .sep { color: var(--sep); }

/* Mouvements sociaux sous chaque année */
.gr-zone { margin-bottom: 74px; }
.gr-mvts {
  position: absolute; top: calc(100% + 24px); left: -6px; right: -6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .64rem; line-height: 1.2; color: var(--texte2); text-align: center;
}
.gr-mvts span { display: block; }
.gr-bulle-mvts { color: var(--bulle-sec); font-style: italic; }
@media (max-width: 760px) {
  .gr-zone { margin-bottom: 24px; }
  .gr-mvts { display: none; }
}

.gr-mvts-liste { display: none; margin: 0; padding: 0; list-style: none; font-size: .74rem; color: var(--texte2); line-height: 1.5; }
.gr-mvts-liste b { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .gr-mvts-liste { display: block; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--grille); } }

/* ---- Bloc « Hors mouvements sociaux » en bas de page ---- */
.hors { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.hors h2 { margin: 0 0 8px; font-size: 1.3rem; }
.hors-intro { max-width: 75ch; margin: 0 0 18px; font-size: .88rem; color: var(--muted); }
.hors-liste ul { list-style: none; margin: 0; padding: 0; }
.hors-date {
  margin: 18px 0 4px; font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.hors .ligne { opacity: .92; }

.hors-stats { margin: 0 0 8px; }

/* Liste « hors mouvements sociaux » repliée par défaut */
.hors-details { margin-top: 14px; }
.hors-details summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .88rem; color: var(--text); background: var(--panel);
}
.hors-details summary::-webkit-details-marker { display: none; }
.hors-details summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.hors-details[open] summary::before { transform: rotate(90deg); }
.hors-details summary:hover { border-color: var(--muted); }
.hors-details summary:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.hors-details[open] summary { margin-bottom: 6px; }

/* Pas de points de frise dans la liste « hors mouvements sociaux » */
.hors .ligne::before { content: none; display: none; }

/* Date de mise à jour (à modifier dans index.html à chaque ajout) */
.maj { margin: -14px 0 24px; font-size: .78rem; color: var(--muted); }

/* Haut de page : léger décalage vers la droite (ordinateur) */
@media (min-width: 901px) {
  .top .wrap { padding-left: clamp(16px, 22vw, 300px); padding-right: clamp(16px, 22vw, 300px); }
}

