/* Notice d'utilisation (olidarts.fr/help/) — ce qui lui est propre.
   Tout le reste (jetons du thème, en-tête, pied, encadrés, touches) vient de setup.css,
   partagé avec le guide d'installation : ne rien y redéfinir ici sans raison. */

/* ── Accueil : l'essentiel en trois étapes ───── */
.story-sec { border-top: 1px solid var(--line); }
.story-sec .wrap { padding-block: 3.5rem; }
.story-sec h2 { margin-bottom: 2rem; }
.story { list-style: none; margin: 0; padding: 0; counter-reset: story; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.story li { counter-increment: story; position: relative; display: flex; flex-direction: column; padding: 1.5rem 1.5rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.story li::before { content: counter(story); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: 1rem; border: 1px solid var(--gold); border-radius: 50%; font-family: var(--mono); font-weight: 600; color: var(--gold); }
.story h3 { margin: 0 0 .6rem; font-size: 1.3rem; }
.story p { margin: 0 0 1.1rem; color: var(--muted); }
.story-more { margin-top: auto; align-self: flex-start; color: var(--gold); font-weight: 600; text-decoration: none; }
.story-more:hover { text-decoration: underline; }
@media (max-width: 860px) { .story { grid-template-columns: minmax(0, 1fr); } }

/* ── Accueil : le sommaire, une ligne par partie ─ */
.parts-sec { border-top: 1px solid var(--line); }
.parts-sec .wrap { padding-block: 3.5rem 4.5rem; }
.parts-sec h2 { margin-bottom: 1.5rem; }
.parts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.part { display: grid; grid-template-columns: 3rem 15rem minmax(0, 1fr); align-items: baseline; gap: .5rem 1.25rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.part-no { margin: 0; font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; color: var(--gold); }
.part h3 { margin: 0; font-size: 1.15rem; }
.part ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.part a { display: inline-block; padding: .3rem .75rem; font-size: .92rem; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; transition: border-color .2s, color .2s; }
.part a:hover, .part a:focus-visible { color: var(--head); border-color: var(--gold); }
@media (max-width: 760px) {
  .part { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .part ul { grid-column: 2; }
}

/* ── Pages : sommaire latéral + colonne ──────── */
.doc .wrap { grid-template-columns: 16rem minmax(0, 1fr); gap: 4rem; }
.toc { position: sticky; top: var(--head-h, 4rem); padding-block: 2.5rem; max-height: calc(100vh - var(--head-h, 4rem)); overflow-y: auto; scrollbar-width: thin; }
.toc summary { display: none; }
.toc nav { display: grid; gap: 1.1rem; }
.toc-home { font-size: .9rem; color: var(--muted); text-decoration: none; }
.toc-home:hover, .toc-home[aria-current] { color: var(--head); }
.toc-top { margin: 0; display: grid; gap: .35rem; }   /* l'accueil et les pages à part (FAQ) */
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.toc-part { margin: 0 0 .3rem; display: grid; grid-template-columns: 1.8rem 1fr; font-family: var(--display); font-weight: 700; font-size: .95rem; color: var(--head); line-height: 1.3; }
.toc-part .n { font-family: var(--mono); font-size: .72rem; font-weight: 400; color: var(--gold); padding-top: .15rem; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 1.8rem; display: grid; gap: .1rem; }
.toc ul a { display: block; padding: .2rem .5rem; margin-left: -.5rem; font-size: .9rem; line-height: 1.35; border-radius: 4px; }
.toc ul a { color: var(--muted); text-decoration: none; }
.toc ul a:hover { color: var(--head); }
.toc ul a[aria-current="page"] { color: var(--head); background: var(--raise); box-shadow: inset 2px 0 0 var(--gold); }

.page { padding-block: 3.2rem 4rem; max-width: 46rem; min-width: 0; }
.page-head { margin-bottom: 2.2rem; }
.page-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.04; margin: 0; font-variation-settings: "wdth" 112; font-weight: 750; }
/* Sans surtitre ni chapô : le numéro et le titre sur une ligne, à la même taille */
.page-head.bare { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: .6rem; }
.page-head.bare .step-no { min-width: 0; font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.04; }
.page-head.plain { grid-template-columns: minmax(0, 1fr); }   /* espace Règles : pas de numéro */
.toc-part.solo { grid-template-columns: minmax(0, 1fr); }      /* espace Règles : partie sans numéro */
.toc ul.games { padding-left: 0; }
.toc-out { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }   /* vers la notice */
.kicker { margin: 0 0 .5rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.page h2 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 700; font-size: 1.35rem; line-height: 1.2; margin: 2.6rem 0 .8rem; color: var(--head); }
.page > p { margin: 0 0 .9rem; text-wrap: pretty; }
.primary { color: var(--gold); }   /* mot mis en avant, couleur principale du thème */

/* ── Capture annotée ─────────────────────────── */
.annot { margin: 0 0 .5rem; }
.annot .frame { position: relative; border: 1px solid var(--line); background: var(--surface); line-height: 0; }
.annot img { display: block; width: 100%; height: auto; }
.pin {
  position: absolute; translate: -50% -50%;
  width: 1.65rem; height: 1.65rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--on-gold); text-decoration: none; line-height: 1;
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  box-shadow: 0 0 0 2px var(--ground), 0 2px 8px rgba(0,0,0,.6);
  transition: scale .2s cubic-bezier(.16,1,.3,1), box-shadow .2s;
}
.pin:hover, .pin.on { scale: 1.2; box-shadow: 0 0 0 2px var(--ground), 0 0 0 5px color-mix(in srgb, var(--gold) 45%, transparent); }
/* Zone-lien sur une capture : cadre or, qui réagit au survol comme une pastille */
.hot {
  position: absolute; border: 2px solid var(--gold); border-radius: .4rem;
  box-shadow: 0 0 0 2px var(--ground);
  transition: scale .2s cubic-bezier(.16,1,.3,1), box-shadow .2s, background-color .2s;
}
/* Zone-loupe : survoler (ou toucher) la zone affiche l'image agrandie, qui naît de la zone */
.zoom { position: absolute; cursor: zoom-in; border-radius: .4rem; }
.zoom:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.annot .zoom-img {
  position: absolute; right: 1.5%; top: 2%; width: auto; height: 96%; z-index: 2;
  opacity: 0; scale: .35; pointer-events: none;   /* transform-origin : posé par build.py */
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.7));
  transition: opacity .2s, scale .3s cubic-bezier(.16,1,.3,1);
}
.zoom:hover + .zoom-img, .zoom:focus + .zoom-img { opacity: 1; scale: 1; }
.hot:hover, .hot:focus-visible { scale: 1.06; background: color-mix(in srgb, var(--gold) 15%, transparent); box-shadow: 0 0 0 2px var(--ground), 0 0 0 5px color-mix(in srgb, var(--gold) 45%, transparent); }

/* Légende des pastilles : le numéro plein, comme sur la capture */
ol.zones { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ol.zones li { display: grid; grid-template-columns: 2.4rem 1fr; gap: .3rem; padding: .8rem .6rem .8rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--head-h, 4rem) + 1.5rem); transition: background-color .2s; }
ol.zones li.on, ol.zones li:target { background: var(--raise); }
ol.zones .zn {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; margin: .1rem 0 0 .45rem;
  background: var(--gold); color: var(--on-gold); font-family: var(--mono); font-size: .72rem; font-weight: 600;
}
ol.zones b { color: var(--head); font-weight: 600; }
ol.zones div { font-size: .95rem; text-wrap: pretty; }

/* Étapes : `ol.howto` (setup.css) n'a aucune marge, le texte qui suit s'y collait */
ol.howto { margin-bottom: 1rem; }

/* ── Tableaux ────────────────────────────────── */
.table-wrap { margin: 0 0 1rem; }
table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.grid th, table.grid td { text-align: left; vertical-align: top; padding: .7rem .8rem .7rem 0; border-bottom: 1px solid var(--line); }
table.grid thead th { font-family: var(--mono); font-size: .68rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--gold-dim); }
table.grid tbody th { color: var(--head); font-weight: 600; }
table.grid td { color: var(--text); }
table.keys tbody th { width: 28%; }
table.grid kbd { white-space: normal; }
/* Début d'un groupe de colonnes (intitulé fusionné) : fin trait vertical */
table.grid .sep { border-left: 1px solid var(--line); padding-left: .8rem; }

/* ── Fiche de jeu (bloc `game`) ──────────────── */
.sheet .addon {
  display: inline-block; margin: 0 0 1rem; padding: .25rem .7rem; border: 1px solid var(--gold-dim); border-radius: 999px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.sheet > p, .sheet > section > p { margin: 0 0 .9rem; text-wrap: pretty; }
.game-shot { margin-bottom: 1.4rem; }
/* olidarts.fr/rules/ : une ligne par jeu, le nom puis le début de ses règles */
.rules-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rules-index a { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: .4rem 1.5rem; align-items: baseline; padding: 1.1rem .25rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); transition: background .2s; }
.rules-index a:hover, .rules-index a:focus-visible { background: var(--surface); }
.rules-index h2 { margin: 0; font-size: 1.2rem; color: var(--head); }
.rules-index a:hover h2, .rules-index a:focus-visible h2 { color: var(--gold); }
.rules-index p { margin: 0; font-size: .95rem; text-wrap: pretty; }
.rules-index .addon {
  display: table; margin-top: .45rem; padding: .15rem .55rem; border: 1px solid var(--gold-dim); border-radius: 999px;
  font-family: var(--mono); font-size: .6rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
@media (max-width: 760px) {
  .rules-index a { grid-template-columns: minmax(0, 1fr); }
}
/* En bref : cases côte à côte, la valeur en grand */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1px; margin: 0 0 1rem; background: var(--line); border: 1px solid var(--line); }
.facts > div { padding: .9rem 1rem; background: var(--surface); }
.facts dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.facts dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--head); }
/* Options : libellé et valeur par défaut, le texte de la borne dessous */
.opts { margin: 0; border-top: 1px solid var(--line); }
.opts > div { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.opts dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; color: var(--head); font-weight: 600; }
.opts .def { font-family: var(--mono); font-size: .72rem; font-weight: 400; color: var(--gold); }
.opts dd { margin: .35rem 0 0; font-size: .95rem; }
.opts dd p { margin: 0 0 .35rem; text-wrap: pretty; }
.opts .choices { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.opts .entries { margin: .2rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.opts .entries b { color: var(--head); font-weight: 600; }
.tips { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
.tips li::marker { color: var(--gold); }
/* Prochain tournoi et chiffres : remplis par help.js depuis stats/<page>.json */
.sheet-tour { margin: 2rem 0 1rem; padding: 1rem 1.2rem; border: 1px solid var(--gold-dim); border-left: 3px solid var(--gold); background: var(--surface); }
.sheet-tour .kicker { margin-bottom: .3rem; color: var(--gold); }
.sheet-tour h3 { margin: 0 0 .4rem; font-size: 1.15rem; color: var(--head); }
.sheet-tour p { margin: 0; font-size: .92rem; color: var(--text); }
.sheet-tour p + p { margin-top: .25rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1px; margin: 0 0 1.4rem; background: var(--line); border: 1px solid var(--line); }
.stat-grid > div { padding: .9rem 1rem; background: var(--surface); }
.stat-grid b { display: block; font-family: var(--mono); font-weight: 600; font-size: 1.6rem; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat-grid b small { font-size: .8rem; font-weight: 500; color: var(--text); }  /* l'unité : moitié du nombre */
.stat-grid span { font-size: .85rem; color: var(--muted); }
.sheet-stats h3 { margin: 1.4rem 0 .5rem; font-size: 1rem; color: var(--head); }
.sheet-stats .when { font-size: .8rem; color: var(--muted); }

/* ── Trajet (bloc `path`) : ligne de métro verticale, embranchements façon git ──
   Une ligne par station : à gauche les voies (rails, courbes, point), à droite le libellé.
   Les voies se dessinent ligne par ligne, d'où des rails qui vont du haut au bas de chaque ligne,
   quelle que soit sa hauteur ; le point est toujours à --t du haut. */
.metro {
  --lane: 1.3rem;  /* écart entre deux voies */
  --c: .8rem;      /* axe de la voie principale */
  --t: 1.05rem;    /* hauteur du point dans sa ligne */
  --cv: 1.05rem;   /* hauteur d'une courbe d'embranchement */
  --w: 3px;        /* épaisseur du rail */
  --gw: calc(var(--c) * 2 + (var(--lanes, 1) - 1) * var(--lane));
  list-style: none; margin: .3rem 0 1.2rem; padding: 0;
}
.metro .l0 { --col: var(--gold); }
.metro .l1 { --col: #5FA8E8; --col: oklch(from var(--gold) max(l, .72) max(c, .13) calc(h + 150)); }
.metro .l2 { --col: #E0609A; --col: oklch(from var(--gold) max(l, .72) max(c, .13) calc(h + 260)); }
.metro .st { position: relative; display: grid; grid-template-columns: var(--gw) minmax(0, 17rem); column-gap: .5rem; min-height: 2.45rem; }
/* (track / tracks / way, et pas rail / pill : ces noms-là sont pris par setup.css et setup.js) */
.metro .tracks { position: relative; }
.metro .track { position: absolute; left: calc(var(--c) + var(--x) * var(--lane) - var(--w) / 2); width: var(--w); background: var(--col); }
.metro .track.full { top: 0; bottom: 0; }
.metro .track.down { top: var(--t); bottom: 0; }
.metro .track.up { top: 0; height: var(--t); }
.metro .track.out { top: calc(var(--t) + var(--cv)); bottom: 0; }
.metro .track.in { top: 0; height: calc(var(--t) - var(--cv)); }
.metro .curve {
  position: absolute; left: var(--c); width: calc(var(--x) * var(--lane)); height: var(--cv); overflow: visible;
  fill: none; stroke: var(--col); stroke-width: var(--w);
}
.metro .curve path { vector-effect: non-scaling-stroke; }
.metro .curve.out { top: var(--t); }
.metro .curve.in { top: calc(var(--t) - var(--cv)); }
/* Le point, le cadenas ou la cible, centré sur sa voie */
.metro .node {
  position: absolute; z-index: 1; left: calc(var(--c) + var(--x) * var(--lane)); top: var(--t); translate: -50% -50%;
  display: grid; place-items: center; padding: .3rem; margin: 0; border: 0; background: none; color: inherit; line-height: 0;
}
button.node { cursor: pointer; }
.metro .dot { width: .95rem; height: .95rem; border-radius: 50%; border: 3px solid var(--col); background: var(--ground); transition: background-color .2s, scale .2s cubic-bezier(.16,1,.3,1); }
button.node:hover .dot, button.node:focus-visible .dot, .st.open .dot { background: var(--col); scale: 1.2; }
button.node:focus-visible { outline: 2px solid var(--col); outline-offset: -1px; border-radius: 50%; }
/* Allures de station déclarées par la page (pages.yaml, `station:`) */
.metro .home .dot { display: grid; place-items: center; }
.metro .home .dot::after { content: ""; width: .3rem; height: .3rem; border-radius: 50%; background: var(--col); }
/* Une station est un anneau, un terminus une cible, une bifurcation un disque plein. La couleur dit
   où se trouve l'écran : sur la borne, celle de la voie ; ailleurs, une couleur fixe, quel que soit
   le thème, que prend aussi le tronçon qui y mène (`to-…`, build.py).
   Onglets de la page web de la borne : effects, settings · app = espace joueur, app.olidarts.fr ·
   key = raccourci clavier. */
.metro .at-effects .node, .metro .to-effects { --col: #E00000; }
.metro .at-settings .node, .metro .to-settings { --col: #E00086; }
.metro .at-app .node, .metro .to-app { --col: #00E086; }
.metro .at-key .node, .metro .to-key { --col: #DCE000; }
.metro .fork:not(.home) .dot { background: var(--col); }   /* l'écran principal garde son point, même en bifurcation */
.metro svg.lock {
  width: 1.5rem; height: 1.5rem; padding: .22rem; border-radius: 50%; border: 2px solid var(--col); background: var(--ground);
  fill: none; stroke: var(--col); stroke-width: 2.2; stroke-linecap: round;
}
.metro svg.target { width: 1.9rem; height: 1.9rem; overflow: visible; }
.target .t-ring { fill: var(--ground); stroke: var(--col); stroke-width: 1.7; }
.target .t-bull { fill: var(--col); }
.target .d-shaft { stroke: var(--head); stroke-width: 1.8; stroke-linecap: round; }
.target .d-flight { fill: var(--head); }
.metro .lbl { padding: .47rem 0 .55rem; font-size: .9rem; line-height: 1.3; color: var(--text); text-wrap: pretty; }
.metro .lbl a { color: var(--head); text-decoration: underline; text-decoration-color: var(--gold-dim); text-underline-offset: .2em; }
.metro .lbl a:hover { text-decoration-color: var(--gold); }
.metro .end .lbl { color: var(--head); font-weight: 600; }
/* Nom d'un chemin parallèle, sur sa première station */
.metro .way {
  display: inline-block; margin: 0 .45rem .15rem 0; padding: .05rem .5rem; border: 1px solid var(--col); border-radius: 999px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--col); vertical-align: .08em;
}
/* L'appareil à utiliser : la même pastille partout, quelle que soit la voie ; sa station, elle, reste
   de la couleur de la voie. Le téléphone a la couleur de l'espace joueur, où il mène. */
.metro .device-phone { --col: #00E086; }
.metro .device-badge { --col: var(--gold); }
/* Aperçu de l'écran : au survol de la station (ou au toucher de son point), à côté du trajet */
.metro .peek {
  position: absolute; z-index: 5; top: -.2rem; left: calc(var(--gw) + 18rem); width: min(21rem, 70vw);
  opacity: 0; pointer-events: none; transform: translateY(.3rem);
  transition: opacity .18s, transform .25s cubic-bezier(.16,1,.3,1);
}
.metro .peek .frame { position: relative; line-height: 0; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 36px rgba(0,0,0,.6); }
.metro .peek img { display: block; width: 100%; height: auto; }
.metro .st:hover .peek, .metro .st:focus-within .peek, .metro .st.open .peek { opacity: 1; transform: none; }
/* La ligne se trace à l'arrivée à l'écran, station après station, et la fléchette se plante (help.js) */
@media (prefers-reduced-motion: no-preference) {
  .metro.arm .st { opacity: 0; translate: 0 -.35rem; }
  .metro.arm .dart { opacity: 0; transform: translate(7px, -7px); }
  .metro.in .st { opacity: 1; translate: 0 0; transition: opacity .3s, translate .45s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i) * 90ms); }
  .metro.in .dart { opacity: 1; transform: none; transition: opacity .1s, transform .22s cubic-bezier(.5,1.8,.6,1); transition-delay: calc(var(--i) * 90ms + 280ms); }
  .metro.in .end .target { animation: thunk .35s calc(var(--i) * 90ms + 420ms); }
}
@keyframes thunk { 40% { scale: 1.14; } }

/* ── Questions fréquentes (bloc `faq`) ───────── */
.page:has(.faq) { max-width: 60rem; }
.faq { margin: 0 0 1rem; border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--head-h, 4rem) + 1rem); transition: background-color .6s; }
.qa.hl { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.qa summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: 1rem .2rem 1rem 0;
  cursor: pointer; list-style: none; color: var(--head); font-weight: 600; font-size: 1.05rem; line-height: 1.35;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary > svg { width: 1rem; height: 1rem; stroke: var(--gold); fill: none; stroke-width: 2; transition: transform .3s cubic-bezier(.16,1,.3,1); }
.qa[open] summary > svg { transform: rotate(90deg); }
.qa summary:hover .q { color: var(--gold); }
/* La réponse à gauche ; le trajet à droite, collé en haut pendant qu'on lit */
.qa-body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "media"; padding: 0 0 1.4rem; }
.qa-body.has-side { grid-template-columns: minmax(0, 1fr) 16rem; grid-template-areas: "text side" "media side"; grid-template-rows: auto 1fr; column-gap: 2.2rem; }
.qa-text { grid-area: text; }
.qa-text p { margin: 0 0 .8rem; text-wrap: pretty; }
.qa-media { grid-area: media; }
.qa-side {
  grid-area: side; align-self: start; position: sticky; z-index: 2; top: calc(var(--head-h, 4rem) + 1.2rem);
  padding: .9rem .9rem .2rem; background: var(--surface); border: 1px solid var(--line);
}
.qa-side .metro { margin: 0; }
.qa-side .metro .st { grid-template-columns: var(--gw) minmax(0, 1fr); }
.qa-side .metro .peek { left: auto; right: calc(100% + 1.9rem); width: min(24rem, 52vw); }
/* Le lien de la question, devant elle : l'icône devient une coche quand il est copié */
.qa-copy { display: grid; margin-left: -.3rem; padding: .3rem; border: 0; background: none; cursor: pointer; color: var(--muted); transition: color .2s; }
.qa-copy svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.qa-copy svg:last-child, .qa-copy.ok svg:first-child { display: none; }
.qa-copy.ok svg:last-child { display: block; }
.qa-copy:hover, .qa-copy.ok { color: var(--gold); }
/* Captures : vignettes qui s'agrandissent ; une seule prend toute la largeur */
.qa-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .7rem; margin: .3rem 0 .6rem; }
.qa-shots.one { grid-template-columns: minmax(0, 1fr); }
.thumb { display: block; cursor: zoom-in; }
.thumb .frame, .lb-stage .frame { position: relative; line-height: 0; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s; }
.thumb img, .lb-stage img { display: block; width: 100%; height: auto; }
.thumb:hover .frame, .thumb:focus-visible .frame { border-color: var(--gold-dim); }
/* « C'est ici » : un anneau qui pulse sur la capture */
.here {
  position: absolute; translate: -50% -50%; width: max(1.3rem, 5%); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  border: 3px solid var(--gold); box-shadow: 0 0 0 2px var(--ground), inset 0 0 0 2px var(--ground);
}
.here::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .here::after { animation: here-pulse 1.8s cubic-bezier(.16,1,.3,1) infinite; }
}
@keyframes here-pulse { from { scale: 1; opacity: .9; } to { scale: 2; opacity: 0; } }
/* Visionneuse */
.lightbox { width: min(92vw, 1500px); max-height: 92vh; padding: 0; overflow: visible; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.lightbox::backdrop { background: rgba(0,0,0,.82); }
.lb-stage .frame { border: 0; }
.lb-stage img { max-height: 88vh; object-fit: contain; }
.lightbox button {
  position: absolute; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--ground); color: var(--head);
}
.lightbox button:hover, .lightbox button:focus-visible { border-color: var(--gold); color: var(--gold); }
.lightbox button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.lb-close { top: -1.3rem; right: -1.3rem; }
.lb-prev, .lb-next { top: 50%; translate: 0 -50%; }
.lb-prev { left: -1.3rem; }
.lb-prev svg { rotate: 180deg; }
.lb-next { right: -1.3rem; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
.lb-count { position: absolute; left: 50%; bottom: -2rem; translate: -50% 0; margin: 0; font-family: var(--mono); font-size: .75rem; color: var(--muted); }

/* ── Pages voisines ──────────────────────────── */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: .2rem; padding: .9rem 1.1rem; border: 1px solid var(--line); text-decoration: none; color: var(--head); font-weight: 600; transition: border-color .2s; }
.pager a:hover { border-color: var(--gold-dim); }
.pager small { font-family: var(--mono); font-size: .68rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pager .next { text-align: right; }

/* ── Une question ? ──────────────────────────── */
.ask { border-top: 1px solid var(--line); }
.ask .wrap { display: grid; grid-template-columns: 1fr auto; gap: 2rem 3rem; align-items: center; padding-block: 3rem; }
.ask h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.ask p { margin: 0; color: var(--muted); max-width: 40rem; text-wrap: pretty; }
.ask-btns { display: flex; flex-wrap: wrap; gap: .7rem; }
.ask .btn { margin-top: 0; }

/* ── Adaptations ─────────────────────────────── */
@media (max-width: 960px) {
  .doc .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* Le sommaire se replie au-dessus de la page, et colle sous l'en-tête. */
  .toc {
    position: sticky; top: var(--head-h, 4rem); z-index: var(--z-sticky); max-height: none; overflow: visible;
    padding: 0; margin-inline: -1.5rem; background: color-mix(in srgb, var(--ground) 94%, transparent);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .toc summary {
    display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none;
    padding: .75rem 1.5rem; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--head);
  }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary svg { width: .9rem; height: .9rem; stroke: var(--gold); fill: none; stroke-width: 2; transition: transform .3s cubic-bezier(.16,1,.3,1); }
  .toc[open] summary svg { transform: rotate(90deg); }
  .toc nav { padding: .4rem 1.5rem 1.4rem; max-height: calc(100vh - var(--head-h, 4rem) - 3rem); overflow-y: auto; }
  .page { padding-top: 2.2rem; }
  .ask .wrap { grid-template-columns: minmax(0, 1fr); }
  /* Le sommaire replié colle aussi sous l'en-tête : le trajet colle dessous. */
  .qa-side { top: calc(var(--head-h, 4rem) + 3.6rem); }
}
@media (max-width: 760px) {
  /* Une colonne : le trajet après la réponse, sans coller ; l'aperçu s'ouvre sous la station touchée. */
  .qa-body.has-side { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "side" "media"; grid-template-rows: none; }
  .qa-side { position: static; margin: .2rem 0 1rem; }
  .metro .peek, .qa-side .metro .peek { position: static; grid-column: 2; display: none; width: auto; max-width: 20rem; margin: 0 0 .7rem; opacity: 1; transform: none; }
  .metro .st.open .peek { display: block; }
  .lb-close { top: -3rem; right: 0; }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
}
/* ── Frise chronologique (bloc `frise`) ─────── */
/* Un rail vertical à --fr-x : le moment à gauche, les événements de ce moment à droite, un
   point par moment. Un intertitre (.fr-part) pose un anneau sur le rail ; un passage résumé
   (.fr-skip) met le rail en pointillé. */
.frise { --fr-when: 6.2rem; --fr-gap: 1.8rem; --fr-x: calc(var(--fr-when) + var(--fr-gap) / 2); --fr-rail: color-mix(in srgb, var(--gold) 40%, var(--line)); margin: 1.2rem 0 1.8rem; padding: 1rem 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.frise ol { position: relative; list-style: none; margin: 0; padding: 0; }
.frise ol::before { content: ""; position: absolute; top: .5rem; bottom: .6rem; left: var(--fr-x); width: 2px; translate: -50% 0; background: var(--fr-rail); }
.fr-step, .fr-skip { position: relative; display: grid; grid-template-columns: var(--fr-when) minmax(0, 1fr); column-gap: var(--fr-gap); padding: .45rem 0; }
.fr-step::before { content: ""; position: absolute; left: var(--fr-x); top: 1.08rem; width: .7rem; height: .7rem; translate: -50% -50%; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--surface); }
.fr-when { padding-top: .18rem; text-align: right; font-family: var(--mono); font-size: .72rem; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.fr-what { font-size: .92rem; line-height: 1.35; text-wrap: pretty; }
.fr-ev { display: block; }
.fr-ev + .fr-ev { margin-top: .12rem; }
.fr-what b { color: var(--head); font-weight: 600; }
.fr-what code { font-family: var(--mono); font-size: .66rem; color: var(--muted); }
.fr-what small { display: block; margin-top: .2rem; font-size: .82rem; color: var(--muted); }
.fr-skip { padding: .7rem 0; }
.fr-skip::before { content: ""; position: absolute; left: var(--fr-x); top: 0; bottom: 0; width: 2px; translate: -50% 0; background: repeating-linear-gradient(var(--surface) 0 4px, var(--fr-rail) 4px 8px); }
.fr-skip .fr-what { font-size: .82rem; font-style: italic; color: var(--muted); }
.fr-part { position: relative; margin-top: 1.1rem; padding: .3rem 0 .25rem calc(var(--fr-when) + var(--fr-gap)); font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.fr-part:first-child { margin-top: 0; }
.fr-part::before { content: ""; position: absolute; left: var(--fr-x); top: 50%; width: .9rem; height: .9rem; translate: -50% -50%; box-sizing: border-box; border: 2px solid var(--gold); border-radius: 50%; background: var(--surface); }
.frise figcaption { margin-top: .9rem; font-size: .85rem; color: var(--muted); text-wrap: pretty; }

@media (max-width: 640px) {
  .frise { --fr-when: 5.6rem; --fr-gap: 1.5rem; padding-inline: .6rem; }
  .fr-when { font-size: .66rem; }
  .toc { margin-inline: -1rem; }
  .toc summary { padding-inline: 1rem; }
  .toc nav { padding-inline: 1rem; }
  .pin { width: 1.3rem; height: 1.3rem; font-size: .65rem; }
  /* Tableaux en fiches : chaque ligne devient un bloc, chaque cellule porte son intitulé. */
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid th, table.grid td { display: block; width: auto; }
  table.grid tr { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  table.grid th, table.grid td, table.grid .sep { border: 0; padding: .15rem 0; }
  table.grid tbody th { font-size: 1rem; margin-bottom: .2rem; }
  table.grid td::before { content: attr(data-label) " · "; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  table.keys tbody th { width: auto; }
  .pager { grid-template-columns: 1fr; }
}
