/* Site hommage Louis Rigon
   Une colonne de lecture, comme les pages d'un cahier qu'on tourne.
   Couleurs tirées de ses documents : papier des feuillets, encre du manuscrit,
   machine à écrire, lagune, latérite. */

:root {
  --papier: #F5F4F0;
  --ligne: #D9DCE6;
  --encre: #2C314B;      /* sa voix : couleur mesurée de l'écriture du feuillet 3 */
  --machine: #1E1D1B;    /* texte courant */
  --lagune: #2F5D50;     /* liens, chapitres gabonais */
  --laterite: #A4512F;   /* dates, facettes */
  --archive: #6B6A66;    /* sources, légendes, « à confirmer » */
  --carte: #FFFFFF;      /* documents, tirages */
  --surligne: #F1DDC9;
  --ombre: rgba(0, 0, 0, .18);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #14201C; --ligne: #2A3833; --encre: #C9D0EA; --machine: #ECE8DE;
    --lagune: #8CC3B0; --laterite: #E09A78; --archive: #A3A79F; --carte: #1B2925;
    --surligne: #4A3426; --ombre: rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #14201C; --ligne: #2A3833; --encre: #C9D0EA; --machine: #ECE8DE;
  --lagune: #8CC3B0; --laterite: #E09A78; --archive: #A3A79F; --carte: #1B2925;
  --surligne: #4A3426; --ombre: rgba(0, 0, 0, .5); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--machine);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 4rem;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--lagune); text-underline-offset: .15em; }
.col { max-width: 36rem; margin: 0 auto; display: flex; flex-direction: column; gap: 3rem; }

h1, h2, h3 { text-wrap: balance; font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.6rem; }
h3 {
  font-family: var(--mono); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--archive);
}
p { margin: 0; }

.lien-evitement { position: absolute; left: -9999px; }
.lien-evitement:focus { left: 1rem; top: 1rem; background: var(--carte); padding: .5rem; z-index: 2; }
:focus-visible { outline: 2px solid var(--lagune); outline-offset: 2px; }

/* Ouverture */
.ouverture { display: flex; flex-direction: column; gap: .75rem; padding-top: 2.5rem; }
.dates { font-family: var(--mono); font-size: .95rem; color: var(--laterite); }
.aide { font-size: .85rem; color: var(--archive); }

/* Index de ses vies */
.facettes { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.facettes button {
  font: inherit; font-family: var(--mono); font-size: .82rem;
  background: transparent; color: var(--machine);
  border: 1px solid var(--ligne); border-radius: 2px; padding: .35rem .65rem; cursor: pointer;
}
.facettes button[aria-pressed="true"] { background: var(--laterite); color: var(--papier); border-color: var(--laterite); }
mark { background: transparent; color: inherit; transition: background-color .2s; }
mark.on { background: var(--surligne); }

/* Sommaire */
.sommaire { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sommaire li { display: grid; grid-template-columns: 5.5rem 1fr; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--ligne); }
.sommaire .an { font-family: var(--mono); font-size: .85rem; color: var(--laterite); font-variant-numeric: tabular-nums; padding-top: .15rem; }
.sommaire .t { min-width: 0; }
.sommaire .a-venir { color: var(--archive); }
.sommaire .a-venir small { font-family: var(--mono); font-size: .75rem; }
.sommaire li.on .t { background: var(--surligne); }

/* Chapitres */
.chapitre { display: flex; flex-direction: column; gap: 1.5rem; border-top: 1px solid var(--ligne); padding-top: 1.75rem; scroll-margin-top: 1rem; }
.periode { font-family: var(--mono); color: var(--laterite); font-size: .9rem; }
.bloc { display: flex; flex-direction: column; gap: .75rem; }

/* Sa voix : encre du manuscrit sur lignage de cahier */
.onglets { display: flex; border: 1px solid var(--ligne); border-radius: 2px; width: max-content; max-width: 100%; overflow-x: auto; }
.onglets button {
  font: inherit; font-family: var(--mono); font-size: .8rem; white-space: nowrap;
  background: transparent; color: var(--archive); border: 0; padding: .45rem .75rem; cursor: pointer;
}
.onglets button[aria-selected="true"] { background: var(--encre); color: var(--papier); }
.cahier {
  color: var(--encre); font-style: italic; font-size: 1.12rem; line-height: 2rem;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(2rem - 1px), var(--ligne) calc(2rem - 1px) 2rem);
  padding: .1rem 0 0 1rem; border-left: 2px solid var(--encre);
  display: flex; flex-direction: column; gap: 2rem;
}
.cahier.exacte { font-family: var(--mono); font-style: normal; font-size: .9rem; white-space: pre-wrap; display: block; }
.cahier .h { font-style: normal; font-family: var(--mono); font-size: .8rem; color: var(--archive); }

/* Tirages et documents */
.tirage { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.tirage img { width: 100%; border: 6px solid var(--carte); box-shadow: 0 1px 3px var(--ombre); }
.tirage figcaption, .source { font-family: var(--mono); font-size: .78rem; color: var(--archive); }
.doc {
  background: var(--carte); border: 1px solid var(--ligne); padding: 1rem;
  font-family: var(--mono); font-size: .9rem; display: flex; flex-direction: column; gap: .5rem;
}
.note { font-size: .92rem; color: var(--archive); border-left: 2px dashed var(--archive); padding-left: .8rem; }
.note strong { color: var(--machine); font-weight: 600; }
.vide { color: var(--archive); font-style: italic; }

/* Souvenirs */
form { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .95rem; }
label small { color: var(--archive); font-size: .8rem; }
input, textarea {
  font: inherit; font-size: 1rem; background: var(--carte); color: var(--machine);
  border: 1px solid var(--ligne); border-radius: 2px; padding: .6rem; width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
.case { flex-direction: row; align-items: flex-start; gap: .6rem; }
.case input { width: auto; margin-top: .3rem; }
.envoyer {
  font: inherit; font-weight: 600; background: var(--lagune); color: var(--papier);
  border: 0; border-radius: 2px; padding: .75rem 1rem; cursor: pointer; align-self: flex-start;
}
.envoyer[disabled] { opacity: .6; cursor: wait; }
.piege { position: absolute; left: -9999px; }
.merci { background: var(--carte); border: 1px solid var(--lagune); padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }

footer { font-size: .85rem; color: var(--archive); border-top: 1px solid var(--ligne); padding-top: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
footer .credit { font-weight: 600; }
footer .credit a { color: inherit; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  mark { transition: none; }
  html { scroll-behavior: auto; }
}
@media (min-width: 48rem) {
  h1 { font-size: 3.4rem; }
  body { font-size: 1.125rem; }
}

/* ===== Parcours visuel (27/10/2026) ===== */
:root { --teinte-fr: #EEE9E2; --teinte-ga: #E2ECE8; --voile: rgba(12, 18, 16, .78); --clair: #F5F4F0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --teinte-fr: #1E2421; --teinte-ga: #16261F; --voile: rgba(0, 0, 0, .8); --clair: #F5F4F0; } }
:root[data-theme="dark"] { --teinte-fr: #1E2421; --teinte-ga: #16261F; --voile: rgba(0, 0, 0, .8); --clair: #F5F4F0; }
html { overflow-x: clip; scroll-behavior: smooth; }

/* Le fil : où l'on est dans sa vie */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--papier); }
.fil {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  margin-inline: calc(50% - 50cqw); padding: .5rem max(16px, env(safe-area-inset-right, 0px)) .45rem max(16px, env(safe-area-inset-left, 0px));
  background: var(--papier); border-bottom: 1px solid var(--ligne);
  font-family: var(--mono); font-size: .8rem; display: flex; justify-content: space-between; gap: 1rem;
}
.fil .an { color: var(--laterite); font-variant-numeric: tabular-nums; }
.fil .lieu { color: var(--machine); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil .barre { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: linear-gradient(90deg, var(--laterite), var(--lagune) 60%); }

/* Quatre âges */
.ages { display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; margin: 0; list-style: none; padding-left: 0; }
.ages li { flex: 0 0 9.5rem; scroll-snap-align: start; display: flex; flex-direction: column; gap: .35rem; }
.ages button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.ages img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 5px solid var(--carte); box-shadow: 0 1px 3px var(--ombre); }
.ages .an { font-family: var(--mono); color: var(--laterite); font-size: .85rem; }
.ages .ou { font-size: .82rem; color: var(--archive); line-height: 1.35; }

/* La route */
.route { list-style: none; margin: 0; padding: 0 0 0 1.1rem; position: relative; display: flex; flex-direction: column; gap: .15rem; }
.route::before { content: ""; position: absolute; left: .3rem; top: .6rem; bottom: .6rem; width: 2px; background: linear-gradient(var(--laterite), var(--laterite) 45%, var(--lagune) 55%); }
.route li { position: relative; display: flex; align-items: baseline; gap: .6rem; }
.route li::before { content: ""; position: absolute; left: -1.05rem; top: .55rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--papier); border: 2px solid var(--laterite); }
.route li.ga::before { border-color: var(--lagune); }
.route li.on::before { background: currentColor; }
.route .an { font-family: var(--mono); font-size: .8rem; color: var(--archive); min-width: 4.2rem; font-variant-numeric: tabular-nums; }
.route a, .route span.t { color: var(--machine); text-decoration: none; padding: .3rem 0; }
.route a:hover { text-decoration: underline; }
.route .a-venir { color: var(--archive); }
.route .pays { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--archive); padding: .6rem 0 .2rem; }
.route .pays::before { display: none; }

/* Chapitres en bandes de couleur */
.chapitre { border-top: 0; padding-top: 0; margin-inline: calc(50% - 50cqw); padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 3rem; }
.chapitre > * { width: 100%; max-width: 36rem; margin-inline: auto; }
.chapitre.fr { background: var(--teinte-fr); }
.chapitre.ga { background: var(--teinte-ga); }
.chapitre.ga .periode, .chapitre.ga .doc .t { color: var(--lagune); }
main { display: flex; flex-direction: column; }

/* Ouverture d'un chapitre : image pleine largeur, titre posé dessus */
.chapitre > .ouvreur { max-width: none; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px))); width: auto; position: relative; margin-bottom: .5rem; }
.ouvreur img { width: 100%; height: min(70vh, 34rem); object-fit: cover; }
.ouvreur .titre {
  position: absolute; inset: auto 0 0 0; padding: 4rem max(16px, env(safe-area-inset-left, 0px)) 1.25rem;
  background: linear-gradient(transparent, var(--voile)); color: var(--clair);
}
.ouvreur .titre > div { max-width: 36rem; margin: 0 auto; display: flex; flex-direction: column; gap: .35rem; }
.ouvreur .periode { color: var(--clair); opacity: .9; }
.ouvreur h2 { color: var(--clair); font-size: 1.9rem; }
.ouvreur .credit { position: absolute; top: .5rem; right: .5rem; font-family: var(--mono); font-size: .68rem; color: var(--clair); background: var(--voile); padding: .15rem .4rem; }
.ouvreur-texte { padding-top: 2.5rem; display: flex; flex-direction: column; gap: .35rem; }
.chapitre.ga .ouvreur-texte h2 { color: var(--lagune); }
.chantier { font-family: var(--mono); font-size: .8rem; color: var(--archive); border: 1px dashed var(--archive); padding: .5rem .75rem; align-self: flex-start; width: auto !important; margin-inline: 0 !important; }
.chapitre > .chantier { margin-inline: auto !important; width: 100% !important; }

/* Grande citation de lui, pour les chapitres sans manuscrit */
.parole { color: var(--encre); font-style: italic; font-size: 1.35rem; line-height: 1.45; border-left: 2px solid var(--encre); padding-left: 1rem; margin: 0; }

/* Tirage cliquable */
.zoom { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
/* Photo agrandie, façon fiche « Genius » : photo à gauche, panneau sombre à droite (en dessous sur téléphone). */
.zoom-dialog { border: 0; padding: 0; max-width: 100vw; max-height: 100dvh; width: 100%; height: 100%; background: #0E1013; color: #E8E6E0; }
.zoom-dialog::backdrop { background: rgba(8, 10, 12, .96); }
.zoom-grille { margin: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 58fr) minmax(0, 42fr); }
.zoom-photo { min-height: 0; display: flex; align-items: center; justify-content: center; background: #08090B; padding: max(12px, env(safe-area-inset-top, 0px)) 12px 12px; cursor: zoom-out; }
.zoom-photo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: default; }
.zoom-panneau { position: relative; min-height: 0; overflow-y: auto; padding: 1.4rem 16px max(1.2rem, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .7rem; background: #14171C; }
.zoom-surtitre { margin: 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: #9AA0A8; }
.zoom-titre { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 5vw, 2.6rem); line-height: 1.1; color: #F2F0EA; }
.zoom-titre::after { content: ""; display: block; width: 2rem; height: 1px; background: #E8E6E0; opacity: .5; margin-top: .9rem; }
.zoom-texte { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.55; color: #D6D3CC; max-width: 34rem; }
.zoom-source { margin: 0; font-family: var(--mono); font-size: .75rem; line-height: 1.5; color: #9AA0A8; max-width: 34rem; }
.zoom-nav { display: flex; align-items: center; gap: .9rem; margin-top: auto; padding-top: .8rem; }
.zoom-nav button { width: 2.6rem; height: 2.6rem; border: 1px solid rgba(232, 230, 224, .45); background: transparent; color: #E8E6E0; font-size: 1.1rem; cursor: pointer; }
.zoom-nav button:hover, .zoom-nav button:focus-visible { background: #E8E6E0; color: #14171C; }
.zoom-nav span { font-family: var(--mono); font-size: .78rem; color: #9AA0A8; }
.zoom-x { position: absolute; top: .8rem; right: 12px; width: 2.4rem; height: 2.4rem; border: 0; background: transparent; color: #E8E6E0; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.zoom-x:focus-visible, .zoom-nav button:focus-visible { outline: 2px solid #E8E6E0; outline-offset: 2px; }
@media (min-width: 56rem) {
  .zoom-grille { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) 26rem; }
  .zoom-photo { padding: 2rem; }
  .zoom-panneau { justify-content: center; padding: 3rem 2.4rem; gap: 1rem; }
  .zoom-nav { margin-top: 1.4rem; }
  .zoom-x { top: 1.4rem; right: 1.4rem; }
}

/* Apparition douce : le contenu est visible au repos, il se pose en glissant */
.js .rv { transform: translateY(18px); transition: transform .7s ease-out; }
.js .rv.vu { transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rv { transform: none; transition: none; } }
@media (min-width: 48rem) { .ages li { flex-basis: 10.5rem; } .ouvreur h2 { font-size: 2.6rem; } }

/* Fonds d'images : une bande qu'on fait glisser par chapitre, une planche pour l'album */
.fonds h3 { margin-bottom: .25rem; }
.bande, .planche { list-style: none; margin: .5rem 0 0; padding: 0; }
.bande {
  display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: .75rem; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.bande li { flex: 0 0 auto; width: min(62vw, 15rem); scroll-snap-align: start; display: flex; flex-direction: column; gap: .3rem; }
.planche { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(44%, 9.5rem), 1fr)); gap: .75rem; }
.planche li { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.vignette { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.vignette img {
  display: block; width: 100%; height: 11rem; object-fit: cover;
  border: 5px solid var(--carte); box-shadow: 0 1px 3px var(--ombre); background: var(--ligne);
}
.planche .vignette img { height: auto; aspect-ratio: 1; }
.quand { font-family: var(--mono); font-size: .75rem; color: var(--laterite); display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.quand .accord { color: var(--archive); border: 1px dashed var(--archive); padding: 0 .3rem; font-size: .68rem; }

/* Traces en ligne : le passage souligné, la carte, la petite fenêtre */
a.trace { color: inherit; text-decoration: underline dotted var(--lagune); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a.trace::after { content: " ↗"; color: var(--lagune); font-style: normal; font-size: .8em; }
.nature { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .4rem; border: 1px solid currentColor; align-self: flex-start; }
.nature.fait { color: var(--lagune); }
.nature.temoignage { color: var(--encre); }
.nature.incertain, .nature.famille { color: var(--archive); border-style: dashed; }
.traces-liste li { width: min(78vw, 17rem); }
.carte-trace {
  font: inherit; text-align: left; cursor: pointer; width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: .45rem; padding: .9rem;
  background: var(--carte); color: var(--machine); border: 1px solid var(--ligne); box-shadow: 0 1px 3px var(--ombre);
}
.cadre-page { display: flex; flex-direction: column; border: 1px solid var(--ligne); background: var(--papier); margin-bottom: .75rem; }
.carte-trace .cadre-page { margin: 0; height: 9rem; overflow: hidden; }
.cadre-page .barre { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .3rem .55rem; border-bottom: 1px solid var(--ligne); font-family: var(--mono); font-size: .7rem; color: var(--archive); background: var(--carte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cadre-page .barre::before { content: ""; flex: none; width: .45rem; height: .45rem; border: 1px solid var(--archive); border-radius: 50%; }
.cadre-page .cite-source, .cadre-page .c { margin: .6rem .7rem; border-left: 0; padding-left: 0; }
.cadre-page .apercu { border: 0; margin: 0; }
.carte-trace img { width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: center 25%; }
.carte-trace .t { font-weight: 600; line-height: 1.25; }
.carte-trace .site, .trace-dialog .site { font-family: var(--mono); font-size: .75rem; color: var(--archive); margin: 0; }
.carte-trace .c { font-size: .9rem; font-style: italic; color: var(--encre); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.trace-dialog {
  width: min(100vw - 2rem, 34rem); max-height: calc(100dvh - 2rem); overflow-y: auto;
  border: 1px solid var(--ligne); background: var(--papier); color: var(--machine); padding: 1rem 1rem 1.25rem;
}
.trace-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.trace-dialog h2 { font-size: 1.25rem; margin: .2rem 0 .6rem; }
.trace-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.trace-tete .fermer { font: inherit; font-family: var(--mono); font-size: .8rem; background: none; border: 1px solid var(--ligne); color: var(--machine); padding: .3rem .6rem; cursor: pointer; }
.apercu { max-height: 45vh; overflow-y: auto; border: 1px solid var(--ligne); margin-bottom: .75rem; overscroll-behavior: contain; }
.apercu img { display: block; width: 100%; }
.cite-source { margin: 0 0 .5rem; font-size: 1.05rem; border-left: 2px solid var(--ligne); padding-left: .8rem; }
.cite-source p { margin: 0; }
.trace-pied { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
.trace-pied button { font: inherit; font-size: 1.4rem; line-height: 1; width: 2.75rem; height: 2.75rem; background: var(--carte); border: 1px solid var(--ligne); color: var(--machine); cursor: pointer; }
.trace-pied a { font-family: var(--mono); font-size: .9rem; background: var(--lagune); color: var(--papier); padding: .7rem 1rem; text-decoration: none; text-align: center; flex: 1; }
#trace-pos { text-align: center; margin-top: .4rem; }

/* La couleur du temps (valeurs posées par site.js, tirées des photos) */
.chapitre.teinte { --t: var(--t-clair); --t-suiv: var(--t-clair-suiv); background: linear-gradient(var(--t) 0, var(--t) calc(100% - 14rem), var(--t-suiv)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chapitre.teinte { --t: var(--t-sombre); --t-suiv: var(--t-sombre-suiv); } }
:root[data-theme="dark"] .chapitre.teinte { --t: var(--t-sombre); --t-suiv: var(--t-sombre-suiv); }
/* Accent du chapitre (dates, titres des documents), tiré d'une photo : le bateau, un coucher de soleil */
.chapitre.accent { --acc: var(--t-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chapitre.accent { --acc: var(--t-accent-sombre); } }
:root[data-theme="dark"] .chapitre.accent { --acc: var(--t-accent-sombre); }
.chapitre.accent .periode, .chapitre.accent .doc .t { color: var(--acc); }
.chapitre.accent .ouvreur .periode { color: var(--clair); }

/* Bande d'ouverture dans la couleur profonde du chapitre (vert de Gamba…), texte clair */
.chapitre.profond > .ouvreur-texte {
  max-width: none; width: auto; background: var(--t-profond); color: var(--clair);
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding: 4.5rem max(16px, env(safe-area-inset-left, 0px)) 2rem; margin-bottom: 0;
}
.chapitre.profond > .ouvreur-texte > * { max-width: 36rem; width: 100%; margin-inline: auto; }
.chapitre.profond > .ouvreur-texte .periode, .chapitre.profond > .ouvreur-texte h2 { color: var(--clair); }
.chapitre.profond > .ouvreur-texte h2 { font-size: 1.9rem; }

/* Le lieu aujourd'hui : une courte vidéo muette qui tourne en boucle */
.lieu-vivant { position: relative; max-width: none !important; width: auto !important; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px))) !important; background: var(--t-profond, #2F4E2B); }
.lieu-vivant video { display: block; width: 100%; max-width: 30rem; margin: 0 auto; height: min(80vh, 40rem); object-fit: cover; }
.lieu-vivant figcaption { max-width: 36rem; margin: 0 auto; padding: .75rem max(16px, env(safe-area-inset-left, 0px)) 1rem; color: var(--clair); font-family: var(--mono); font-size: .8rem; line-height: 1.5; }
.lieu-vivant .pause { position: absolute; top: .75rem; right: max(16px, env(safe-area-inset-right, 0px)); font: inherit; font-family: var(--mono); font-size: .75rem; color: var(--clair); background: var(--voile); border: 0; padding: .5rem .7rem; min-height: 2.75rem; cursor: pointer; }

/* Une photo de lui pleine largeur, entière (on ne coupe personne) */
.pleine { max-width: none !important; width: auto !important; margin: 0 calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))) !important; background: var(--t-profond, var(--machine)); }
.pleine button { display: block; width: 100%; max-width: 48rem; margin: 0 auto; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pleine img { display: block; width: 100%; height: auto; }
.pleine figcaption { max-width: 36rem; margin: 0 auto; padding: .75rem max(16px, env(safe-area-inset-left, 0px)) 1rem; color: var(--clair); font-family: var(--mono); font-size: .8rem; line-height: 1.5; }
.chapitre > .ouvreur-texte + .pleine { margin-top: -1.5rem !important; }

/* Ouverture : sa photo, d'abord dans un cadre, s'ouvre en plein écran au défilement */
.hero { position: relative; height: calc(100vh + 70vh); height: calc(100svh + 70svh); background: #11140F; }
.hero-scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; clip-path: inset(var(--cadre, 14%) round 4px); }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; transform: scale(var(--zoom, 1.12)); transform-origin: 50% 35%; }
/* Petite photo d'ouverture (livret militaire, provisoire) : entière sur les écrans larges plutôt qu'agrandie et floue */
.hero-img.entiere { object-position: 37% 28%; } /* visage à gauche du centre sur la photo de 1956 : ne pas couper l'œil sur téléphone */
@media (min-aspect-ratio: 1/1) { .hero-img.entiere { object-fit: contain; object-position: 50% 45%; } }
.hero-texte { position: absolute; inset: auto 0 0 0; padding: 6rem 16px 2.5rem; text-align: center; color: #F5F4F0; background: linear-gradient(transparent, rgba(8, 10, 8, .8)); opacity: var(--texte, 0); }
.hero-texte h1 { margin: 0; font-size: clamp(2.6rem, 11vw, 4.5rem); font-weight: 400; color: #F5F4F0; }
.hero-an { font-family: var(--mono); letter-spacing: .15em; margin: 0 0 .4rem; }
.hero-aide { font-family: var(--mono); font-size: .8rem; margin: 1rem 0 0; opacity: .8; }
.hero-credit { font-family: var(--mono); font-size: .65rem; margin: 1.25rem 0 0; opacity: .7; }
.js .hero-texte { transition: opacity .3s; }
@media (prefers-reduced-motion: reduce) {
  .hero { height: 100vh; height: 100svh; }
  .hero-scene { clip-path: none; }
  .hero-img { transform: none; }
  .hero-texte { opacity: 1; }
}
.no-js .hero-texte, html:not(.js) .hero-texte { opacity: 1; }

/* Ses traces sur Internet : la pile de pages (js/traces-pile.js), sur un papier quadrillé
   comme celui de sa lettre de 2023 */
#traces { background-color: var(--papier); background-image: linear-gradient(to right, rgba(44, 49, 75, .07) 1px, transparent 1px), linear-gradient(rgba(44, 49, 75, .07) 1px, transparent 1px); background-size: 1.5rem 1.5rem; padding-block: 2.5rem 3rem; }
#traces > .pile-traces { max-width: 56rem; }
.pile-traces { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 48rem) { .pile-traces { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.pile { position: relative; height: 20rem; width: 100%; max-width: 19rem; margin: 1rem auto 0; }
.page-pile { position: absolute; inset: 0; padding: 0; border: 1px solid var(--ligne); border-radius: 1rem; overflow: hidden; background: var(--carte); cursor: pointer;
  display: flex; flex-direction: column; font: inherit; color: var(--machine); text-align: left; transform-origin: bottom center;
  transform: translateY(calc(var(--d, 1) * 10px)) rotate(var(--r)) scale(.92); opacity: .55; box-shadow: 0 8px 22px var(--ombre);
  transition: transform .5s ease-in-out, opacity .5s ease-in-out; }
.page-pile.dessus { transform: none; opacity: 1; box-shadow: 0 16px 40px var(--ombre); }
.page-pile .barre { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; border-bottom: 1px solid var(--ligne); font-family: var(--mono); font-size: .7rem; color: var(--archive); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.page-pile .barre::before { content: ""; flex: none; width: .45rem; height: .45rem; border: 1px solid var(--archive); border-radius: 50%; }
.page-pile img { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.page-pile .sans-capture { flex: 1; padding: 1.25rem 1rem; font-style: italic; color: var(--encre); font-size: 1.05rem; line-height: 1.45; background: var(--papier); }
.pile-fiche { display: flex; flex-direction: column; gap: .6rem; animation: pile-entree .3s ease-in-out; }
@keyframes pile-entree { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pile-titre { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--machine); margin: 0; }
.pile-site { font-family: var(--mono); font-size: .78rem; color: var(--archive); margin: 0; }
.pile-citation { font-size: 1.15rem; line-height: 1.5; color: var(--encre); margin: .6rem 0 0; }
.pile-lire { align-self: flex-start; font: inherit; font-family: var(--mono); font-size: .85rem; background: var(--lagune); color: var(--papier); border: 0; padding: .7rem 1rem; cursor: pointer; margin-top: .4rem; }
.pile-commandes { display: flex; align-items: center; gap: 1rem; padding-top: 1.75rem; }
.pile-commandes .rond { transition: transform .3s; }
@media (hover: hover) { .pile-g:hover { transform: translateX(-3px); } .pile-d:hover { transform: translateX(3px); } }
.pile-pos { font-family: var(--mono); font-size: .85rem; color: var(--archive); }
@media (prefers-reduced-motion: reduce) { .page-pile, .pile-fiche, .pile-commandes .rond { transition: none; animation: none; } }

/* ---------- « Sa route » sur le globe (js/globe.js) ---------- */
.globe-route { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.25rem; }
.globe-scene { position: relative; width: min(100%, 30rem); aspect-ratio: 1; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.globe-toile { width: 100%; height: 100%; display: block; border-radius: 50%; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.2s ease; }
.globe-toile:active { cursor: grabbing; }
.globe-fils { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.globe-fils line { stroke: var(--laterite); stroke-width: 1.2; stroke-dasharray: 2 3; transition: opacity .3s; }
.globe-emojis { position: absolute; inset: 0; pointer-events: none; }
/* Chaque emoji est un autocollant : contour blanc, petite ombre, il flotte */
.globe-emoji { position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; background: none; padding: .15rem; cursor: pointer;
  font-size: 1.75rem; line-height: 1; transition: opacity .3s, filter .3s;
  filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff) drop-shadow(0 2px 5px rgba(0, 0, 0, .3)); }
.globe-emoji > * { pointer-events: none; }
.globe-emoji { animation: flotte 3s ease-in-out infinite; }
@keyframes flotte { 0%, 100% { margin-top: 0; } 50% { margin-top: -4px; } }
.globe-emoji.cache { opacity: 0; pointer-events: none; }
.globe-emoji.actif { font-size: 2.2rem; z-index: 2; }
.globe-emoji:focus-visible { outline: 3px solid var(--lagune); outline-offset: 2px; border-radius: .5rem; }
/* Ses vacances : plus petits, fil bleu, aucun trait de route */
.globe-emoji.vacances { font-size: 1.35rem; }
.globe-emoji.vacances.actif { font-size: 1.9rem; }
@media (hover: hover) { .globe-emoji.vacances:hover { font-size: 1.7rem; } }
.globe-fils line.vacances { stroke: var(--lagune); }
.globe-vacances { margin: 0; text-align: center; }
@media (hover: hover) { .globe-emoji:hover { font-size: 2.1rem; z-index: 2; } }
/* Le petit zoom, qui part de l'emoji touché */
.globe-zoom { position: absolute; inset: 4% 3%; z-index: 5; display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1rem .9rem;
  background: var(--carte); color: var(--machine); border-radius: 1.25rem; box-shadow: 0 12px 34px var(--ombre); overflow: auto; }
.globe-zoom.ouvert { animation: zoom-ouvre .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes zoom-ouvre { from { transform: scale(.15); opacity: 0; } to { transform: none; opacity: 1; } }
.gz-fermer { position: absolute; top: .5rem; right: .5rem; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: var(--papier); color: var(--machine); font-size: 1.4rem; cursor: pointer; }
.gz-tete { display: flex; align-items: center; gap: .6rem; margin: 0; padding-right: 2.6rem; }
.gz-emoji { font-size: 2rem; line-height: 1; }
.gz-an { display: block; font-family: var(--mono); font-size: .8rem; color: var(--laterite); }
.gz-lieu { display: block; font-family: var(--mono); font-size: .78rem; color: var(--archive); }
.gz-titre { font-family: var(--serif); font-size: 1.2rem; margin: 0; line-height: 1.25; }
.gz-texte { margin: 0; font-size: .98rem; line-height: 1.45; }
.gz-photos { position: relative; flex: 1; min-height: 7.5rem; margin: .4rem 0 .2rem; }
.gz-photo { position: absolute; left: 50%; top: 50%; width: 46%; max-height: 100%; aspect-ratio: 4 / 5;
  transform: translate(calc(-50% + var(--x, 0%)), -50%) rotate(var(--r, 0deg)); transition: transform .3s ease-out, box-shadow .3s;
  background: #fff; padding: 4px; box-shadow: 0 3px 10px var(--ombre); border-radius: 3px; }
.gz-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: hover) { .gz-photo:hover { transform: translate(calc(-50% + var(--x, 0%)), -54%) rotate(0deg) scale(1.06); z-index: 9 !important; box-shadow: 0 10px 24px var(--ombre); } }
.gz-photo:focus-visible { outline: 3px solid var(--lagune); outline-offset: 2px; z-index: 9 !important; }
.gz-lien { align-self: flex-start; font-family: var(--mono); font-size: .88rem; color: var(--lagune); }
.globe-suivre { align-self: center; font-family: var(--mono); font-size: .9rem; border: 0; border-radius: 2rem; padding: .7rem 1.2rem; background: var(--machine); color: var(--papier); cursor: pointer; }
.route .e-route { font-style: normal; }
@media (prefers-reduced-motion: reduce) {
  .globe-emoji { animation: none; }
  .globe-zoom.ouvert { animation: none; }
  .globe-toile, .gz-photo { transition: none; }
}

/* ===== Structure (28/10/2026) : d'après « Genius » (National Geographic) et une page mémoriale.
   Un seul fond pour toute la page : les chapitres ne changent plus de couleur.
   Chaque chapitre s'ouvre sur un rectangle sombre, photo ou texte, toujours le même ;
   dessous, son récit à gauche et, sur grand écran, les documents dans une marge à droite.
   Sur grand écran, le sommaire reste sur le côté. ===== */
:root { --nuit: #1A201D; --nuit-texte: #EDEAE2; --large: 64rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --nuit: #0C110F; } }
:root[data-theme="dark"] { --nuit: #0C110F; }
body { padding-left: 0; padding-right: 0; }
.page { container-type: inline-size; min-width: 0; }
.col { width: 100%; max-width: calc(36rem + 32px); padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }

/* Plus de bandes de couleur : le fond reste celui de la page */
.chapitre.fr, .chapitre.ga, .chapitre.teinte { background: none; }
.chapitre { padding-bottom: 1.5rem; }

/* L'ouverture : un rectangle sombre, le même pour tous les chapitres */
main .chapitre.chapitre > .ouvreur, main .chapitre.chapitre > .ouvreur-texte { margin-top: 2.5rem; }
main .chapitre.chapitre > .ouvreur-texte {
  position: relative; overflow: hidden; background: var(--nuit); color: var(--nuit-texte);
  max-width: none; width: auto; min-height: 15rem; justify-content: flex-end; gap: .5rem;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding: 3.5rem max(16px, env(safe-area-inset-left, 0px)) 1.5rem;
}
main .chapitre.chapitre > .ouvreur-texte > * { position: relative; z-index: 1; max-width: 36rem; width: 100%; margin-inline: auto; }
main .chapitre.chapitre > .ouvreur-texte h2, main .chapitre.chapitre > .ouvreur-texte .periode,
main .chapitre.chapitre > .ouvreur-texte p { color: var(--nuit-texte); }
main .chapitre.chapitre > .ouvreur-texte .source { color: var(--nuit-texte); opacity: .7; }
/* les années en très grand, à peine visibles, au fond du rectangle */
.chapitre > .ouvreur-texte[data-an]::after {
  content: attr(data-an); position: absolute; right: -.04em; bottom: -.22em; z-index: 0;
  font-family: var(--serif); font-size: clamp(4.5rem, 24cqw, 13rem); line-height: 1; white-space: nowrap;
  color: var(--nuit-texte); opacity: .07; pointer-events: none;
}
.ch-num { display: block; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .22em; opacity: .8; }
.ch-an { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1.1; letter-spacing: -.01em; margin-top: .35rem; color: inherit; }
.chapitre .periode:has(.ch-an) { color: var(--nuit-texte); }
.ouvreur h2, main .chapitre.chapitre > .ouvreur-texte h2 { font-size: 1.7rem; font-weight: 400; }
.ch-lieu { font-family: var(--mono); font-size: .78rem; opacity: .75; }
.ouvreur .ch-lieu { color: var(--clair); }
.ch-nav { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; }
.ch-fleche { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid rgba(237, 234, 226, .45); color: var(--nuit-texte); text-decoration: none; font-size: 1.05rem; }
a.ch-fleche:hover { background: rgba(237, 234, 226, .12); }
span.ch-fleche { opacity: .25; }
.ch-pos { font-family: var(--mono); font-size: .75rem; color: var(--nuit-texte); opacity: .7; min-width: 3rem; text-align: center; }
.ouvreur .titre { padding-top: 6rem; }

/* La photo entière et la vidéo prolongent le rectangle, dans le même sombre */
.pleine, .lieu-vivant { background: var(--nuit) !important; }
.chapitre > .ouvreur-texte + .pleine { margin-top: -1.5rem !important; }

/* Sous l'ouverture : le récit, puis la marge des documents */
.chapitre > .ch-grille { display: flex; flex-direction: column; gap: 2rem; }
.corps, .marge { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.marge { border-top: 1px solid var(--ligne); padding-top: 1.5rem; }
.marge .chantier { width: auto !important; }

/* ---- Tablette et plus : les rectangles gardent une marge autour d'eux ---- */
@media (min-width: 48rem) {
  .ch-an { font-size: 3.4rem; }
  .ouvreur h2, main .chapitre.chapitre > .ouvreur-texte h2 { font-size: 2.2rem; }
  main .chapitre.chapitre > .ouvreur, main .chapitre.chapitre > .ouvreur-texte, .chapitre > .pleine, .chapitre > .lieu-vivant {
    width: 100% !important; max-width: var(--large) !important; margin-inline: auto !important; border-radius: 6px; overflow: hidden;
  }
  main .chapitre.chapitre > .ouvreur-texte { padding: 4.5rem 3rem 2.25rem; min-height: 19rem; }
  main .chapitre.chapitre > .ouvreur-texte > * { max-width: none; margin-inline: 0; }
  .ouvreur .titre { padding-inline: 3rem; }
  .ouvreur .titre > div { max-width: none; margin: 0; }
  .chapitre > .ouvreur-texte:has(+ .pleine) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .chapitre > .ouvreur-texte + .pleine { border-top-left-radius: 0; border-top-right-radius: 0; }
  .pleine button { max-width: none; }
}

/* ---- Grand écran : page large, récit et marge côte à côte ---- */
@media (min-width: 64rem) {
  .col { max-width: calc(var(--large) + 32px); }
  .col > .ouverture, .col > .bloc > .aide, .col > .bloc > p { max-width: 40rem; }
  .chapitre > .ch-grille { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; align-items: start; max-width: var(--large); }
  .marge { border-top: 0; padding-top: 0; padding-left: 1.75rem; border-left: 1px solid var(--ligne); }
  .ch-grille > .corps:only-child { grid-column: 1 / -1; max-width: 42rem; }
  /* Quatre fois lui : les quatre portraits côte à côte */
  .ages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; gap: 1.25rem; }
  .ages li { flex: none; }
  /* Sa route : le globe à gauche, les étapes à droite */
  nav[aria-labelledby="route-titre"] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem 3rem; align-items: center; }
  nav[aria-labelledby="route-titre"] > h3 { grid-column: 1 / -1; }
  nav[aria-labelledby="route-titre"] .globe-route { margin-bottom: 0; }
}

/* ---- Très grand écran : le sommaire sur le côté ---- */
.cote { display: none; }
@media (min-width: 75rem) {
  .mise { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }
  .cote:not([hidden]) {
    display: flex; flex-direction: column; gap: 1.75rem; position: sticky; top: 0; height: 100vh; height: 100svh; overflow-y: auto;
    padding: 2rem 1.25rem 2rem 1.5rem; border-right: 1px solid var(--ligne);
  }
  .fil { display: none; }
}
.cote-tete { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--machine); }
.cote-nom { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.cote-an { font-family: var(--mono); font-size: .78rem; color: var(--laterite); letter-spacing: .08em; }
.cote-liste, .cote-plus { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cote-liste a { display: grid; grid-template-columns: 1.9rem 1fr; gap: 0 .4rem; padding: .45rem .5rem .45rem .6rem; margin-left: -.6rem; text-decoration: none; color: var(--archive); border-left: 2px solid transparent; }
.cote-n { grid-row: span 2; font-family: var(--mono); font-size: .72rem; padding-top: .2rem; }
.cote-t { font-size: .92rem; line-height: 1.3; color: var(--machine); }
.cote-a { font-family: var(--mono); font-size: .68rem; }
.cote-liste a:hover .cote-t { text-decoration: underline; }
.cote-liste a[aria-current] { border-left-color: var(--laterite); background: var(--carte); }
.cote-liste .ga a[aria-current] { border-left-color: var(--lagune); }
.cote-liste a[aria-current] .cote-t { font-weight: 600; }
.cote-plus { gap: .5rem; border-top: 1px solid var(--ligne); padding-top: 1.25rem; }
.cote-plus a { font-family: var(--mono); font-size: .8rem; color: var(--lagune); }
/* la photo du tarpon a une marge blanche de scanner en haut et en bas : on ne montre que la photo */
#ch7 .pleine img { aspect-ratio: 1400 / 912; object-fit: cover; object-position: 50% 51%; }

/* ===== Harmonisation (01/11/2026, d'après les sites de camps du Gabon choisis par Louis Rigon junior) :
   même mise en page qu'avant, mais les photos des chapitres se voient en grand, entières, jamais recadrées,
   avec plus d'air autour. L'album garde sa planche de vignettes carrées. ===== */
.chapitre .fonds { margin-top: 1rem; gap: .5rem; }
.chapitre .bande { gap: 1.25rem; padding-bottom: 1rem; align-items: flex-start; }
.chapitre .bande li { width: auto; max-width: 82cqw; gap: .5rem; }
.chapitre .bande .vignette img {
  width: auto; max-width: 100%; height: clamp(14rem, 55vw, 20rem); object-fit: contain;
  border-width: 6px; transition: transform .35s ease-out, box-shadow .35s ease-out;
}
@media (hover: hover) {
  .chapitre .bande .vignette:hover img { transform: translateY(-3px); box-shadow: 0 10px 22px var(--ombre); }
}
@media (prefers-reduced-motion: reduce) { .chapitre .bande .vignette img { transition: none; } }
.vignette:focus-visible { outline: 3px solid var(--lagune); outline-offset: 3px; }

/* ===== Une couleur par vie (01/11/2026, demande de Louis Rigon junior) :
   le fond de page ne change pas ; chaque chapitre a sa couleur, sombre et sobre, dans son rectangle
   d'ouverture, avec un rappel plus clair sur les filets (citations, marge, sommaire).
   --vie = fond du rectangle, --vie-clair = filets. ===== */
#ch1 { --vie: #6E3426; --vie-clair: #C27760; } /* Italie et Lot-et-Garonne : la brique, la terre */
#ch2 { --vie: #45442A; --vie-clair: #A29C62; } /* la ferme : l'olive, les champs */
#ch3 { --vie: #2B3F57; --vie-clair: #7E9EC2; } /* le vélo : le bleu des maillots */
#ch4 { --vie: #4A3346; --vie-clair: #AE88A5; } /* Miramont : le prune des façades et du commerce */
#ch5 { --vie: #73381F; --vie-clair: #D08457; } /* l'arrivée au Gabon : la latérite */
#ch6 { --vie: #213D2B; --vie-clair: #78AA86; } /* Gamba : la forêt */
#ch7 { --vie: #123F55; --vie-clair: #6AADCB; } /* Sette-Cama : la lagune */
#ch8 { --vie: #57283A; --vie-clair: #D0879D; } /* Ozouri : le coucher de soleil sur la mer */
main .chapitre.chapitre > .ouvreur-texte { background: var(--vie, var(--nuit)); }
main .chapitre > .ouvreur { border-bottom: 6px solid var(--vie, var(--nuit)); }
main .chapitre > .ouvreur .titre { background: linear-gradient(transparent, color-mix(in srgb, var(--vie, var(--nuit)) 92%, transparent) 55%); }
main .chapitre > .ouvreur-texte + .pleine, main .chapitre > .ouvreur-texte + .lieu-vivant { background: var(--vie, var(--nuit)) !important; }
main .chapitre .ch-num { color: var(--vie-clair, inherit); opacity: 1; }
main .chapitre .parole { border-left-color: var(--vie-clair, var(--encre)); border-left-width: 3px; }
main .chapitre .marge { border-color: color-mix(in srgb, var(--vie-clair, var(--ligne)) 55%, transparent); }
main .chapitre .bloc > h3 { color: var(--vie, inherit); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) main .chapitre .bloc > h3 { color: var(--vie-clair, inherit); } }
:root[data-theme="dark"] main .chapitre .bloc > h3 { color: var(--vie-clair, inherit); }
.cote-liste a[aria-current], .cote-liste .ga a[aria-current] { border-left-color: var(--repere, var(--laterite)); border-left-width: 3px; }

/* v19 : lien vers l'album souvenir */
.vers-album-lien { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; align-items: center; text-decoration: none; color: inherit; border: 1px solid var(--ligne); background: var(--carte); padding: .6rem; }
.vers-album-lien img { width: 100%; height: 5rem; object-fit: cover; display: block; }
.vers-album-lien strong { display: block; font-size: 1.25rem; font-weight: 600; color: var(--lagune); margin-bottom: .15rem; }
.vers-album-lien span { line-height: 1.45; }
.vers-album-lien:hover strong, .vers-album-lien:focus-visible strong { text-decoration: underline; }
@media (min-width: 48rem) { .vers-album-lien { grid-template-columns: 11rem 1fr; } .vers-album-lien img { height: 7rem; } }

/* Ouverture « entière » (chapitre 1, demande de Louis junior, 07/11/2026) : la photo de famille se voit en entier,
   sans recadrage ni dégradé posé sur les visages ; le titre passe à côté (écran large) ou dessous (téléphone). */
main .chapitre > .ouvreur.entiere { background: var(--vie, var(--nuit)); display: grid; }
.ouvreur.entiere .zoom { display: block; background: var(--vie, var(--nuit)); }
.ouvreur.entiere img { width: 100%; height: auto; max-height: none; object-fit: contain; display: block; }
main .chapitre > .ouvreur.entiere .titre { position: static; background: var(--vie, var(--nuit)); padding: 1.4rem max(16px, env(safe-area-inset-left, 0px)) 1.6rem; }
@media (min-width: 48rem) {
  main .chapitre > .ouvreur.entiere { grid-template-columns: auto minmax(0, 1fr); align-items: end; }
  .ouvreur.entiere img { width: auto; height: min(82vh, 46rem); max-width: 100%; }
  main .chapitre > .ouvreur.entiere .titre { padding: 2.5rem 3rem; }
}


/* Mosaïque façon tableau Pinterest (Fin : le garage de Castelculier, juillet 2021).
   Colonnes de hauteurs libres ; les photos animées tournent en boucle, sans le son, quand elles sont à l'écran (js/mosaique.js). */
.chapitre > .mosaique-bloc { max-width: 60rem; }
.mosaique { list-style: none; margin: .25rem 0 0; padding: 0; columns: 2; column-gap: .7rem; }
@media (min-width: 40rem) { .mosaique { columns: 3; column-gap: 1rem; } }
.mosaique li { break-inside: avoid; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .4rem; }
.mosaique .zoom { position: relative; overflow: hidden; border-radius: 14px; background: var(--carte); box-shadow: 0 1px 3px var(--ombre); transition: transform .25s ease, box-shadow .25s ease; }
.mosaique .zoom:hover, .mosaique .zoom:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px var(--ombre); }
.mosaique .zoom:focus-visible { outline: 2px solid var(--laterite); outline-offset: 3px; }
.mosaique img, .mosaique video { display: block; width: 100%; height: auto; }
.mosaique.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 4px; columns: auto; }
@media (min-width: 40rem) { .mosaique.grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mosaique.grille li { margin: 0; align-self: start; }
.mosaique.deux { columns: 2; }
.mosaique.grille.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mosaique-anime { position: absolute; top: .55rem; left: .55rem; font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; line-height: 1; padding: .3rem .5rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; }
.mosaique-leg { font-family: var(--mono); font-size: .74rem; line-height: 1.35; color: var(--archive); padding-inline: .2rem; }
@media (prefers-reduced-motion: reduce) { .mosaique .zoom { transition: none; } .mosaique .zoom:hover { transform: none; } }
.zoom-photo video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* ===== Mode public (js/public.js) ===== */
/* 25/11/2026 : Louis confirme les accords écrits des proches, leurs textes sont publiés.
   Restent masqués : les étiquettes « accord à confirmer », les messages intimes (accord:false
   dans js/livre-dor.js) et le texte sans auteur connu (.attente). */
.public .accord, .public .attente, .public .livre-page .aide{display:none!important}
.public .seulement-prive{display:none}

/* ===== Aération (demande de Louis, 24/11/2026) : plus d'espace entre les sections ===== */
.corps, .marge { gap: 2.75rem; }
.bloc { gap: 1rem; }
.chapitre > .ch-grille { gap: 3rem; }
.chapitre { padding-bottom: 4.5rem; }
@media (min-width: 60rem) { .corps, .marge { gap: 3.5rem; } }

/* ===== Images vivantes (js/vivant.js, demande de Louis Rigon junior, 25/11/2026) ===== */
/* 1. La revue : les magazines d'un chapitre, à feuilleter */
.revue { gap: .6rem; }
.revue-scene { position: relative; width: 100%; margin-inline: auto; perspective: 2400px; transition: aspect-ratio .5s ease, max-width .5s ease; touch-action: pan-y; }
.revue-page { position: absolute; inset: 0; padding: 0; border: 0; background: var(--carte); cursor: zoom-in;
  transform-origin: left center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .8s cubic-bezier(.3, .1, .2, 1), box-shadow .8s;
  box-shadow: 0 8px 26px var(--ombre), inset 16px 0 20px -16px rgba(0, 0, 0, .35); border-radius: 2px 8px 8px 2px; overflow: hidden; }
.revue-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
.revue-page.tournee { transform: rotateY(-179deg); box-shadow: none; pointer-events: none; }
.revue-page:focus-visible { outline: 3px solid var(--lagune); outline-offset: 3px; }
.revue-scene[data-bord="d"] .revue-page { cursor: e-resize; }
.revue-scene[data-bord="g"] .revue-page { cursor: w-resize; }
.revue-barre { display: flex; justify-content: center; align-items: center; gap: 1rem; font-family: var(--mono); font-size: .85rem; color: var(--archive); }
.revue-barre button { width: 2.75rem; height: 2.75rem; border: 1px solid var(--archive); background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer; border-radius: 50%; }
.revue-barre button:disabled { opacity: .3; cursor: default; }
.revue-barre button:not(:disabled):hover, .revue-barre button:focus-visible { background: var(--lagune); border-color: var(--lagune); color: var(--papier); }
.revue-legende { margin: 0; font-family: var(--mono); font-size: .78rem; line-height: 1.5; color: var(--archive); min-height: 3.5em; }
@media (prefers-reduced-motion: reduce) { .revue-page, .revue-scene { transition: none; } }

/* 2. Les bandes qui glissent : plus d'aimant, sinon il se bat avec le défilement */
.vivant .bande.glisse { scroll-snap-type: none; scrollbar-width: thin; }
.vivant .bande.glisse + .bande.glisse { margin-top: .25rem; }

/* 3. « Quatre fois lui » */
.vivant .ages li { transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1), filter 1.1s ease; }
.vivant .ages.attend li { opacity: 0; transform: translateY(28px) scale(.92); filter: grayscale(1) blur(6px); }
.vivant .ages.arrive li:nth-child(2) { transition-delay: .22s; }
.vivant .ages.arrive li:nth-child(3) { transition-delay: .44s; }
.vivant .ages.arrive li:nth-child(4) { transition-delay: .66s; }
.vivant .ages button { transition: transform .25s ease-out; will-change: transform; }
@media (hover: hover) {
  .vivant .ages.arrive:hover li { transition-delay: 0s; transition-duration: .35s; }
  .vivant .ages.arrive:hover li:not(:hover) { opacity: .45; filter: grayscale(.8); }
}

/* 4. Les grandes photos : elles se redressent en arrivant ; la loupe suit la souris */
.js .rv.vv { transform: none; transition: none; }
.vivant .vv button[data-zoom] { position: relative; transform-origin: 50% 100%; will-change: transform, opacity; }
.vivant .pleine.vv button[data-zoom] { overflow: hidden; }
.vivant .pleine.vv img { will-change: transform; transform-origin: 50% 50%; }
.loupe { position: absolute; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .25);
  background-repeat: no-repeat; background-color: #0E1013; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; z-index: 2; }
.loupe.on { opacity: 1; transform: none; }
