/* fx-recits.css — passe « forward design » du 24/11. Périmètre : gabarit des récits (editorial.js) : ouverture, chapitres,
   citation, Nos terroirs, fin de page, carnet, lecteur de l'entretien.
   Feuille de l'expert « récits » : chargée après toutes les feuilles de base (style.css, editorial.css, type.css…), qui
   restent gelées ; tout ce qui change dans ce périmètre s'écrit ici.
   Règle du gabarit : un écran = une image, une phrase forte ; la lecture dessous ou à côté, jamais sur la photo.
   Tailles : jetons --fs-* de type.css. Mouvement : jetons --mm-* de transitions.css ; ce qui bouge suit le défilement
   (animation-timeline), seulement transform, opacity et clip-path. Mouvement réduit ou navigateur sans animation liée au
   défilement : les états finaux, immobiles. */

/* ── 0. Jetons du chantier ───────────────────────────────────────────────────────────────────── */
#story-view {
  --rc-rayon: var(--sys-arrondi, clamp(12px, 1.2vw, 18px));   /* coins des photos et des cartes (langage commun) */
  --rc-air: clamp(14px, 2.6svh, 28px);      /* l'air entre l'en-tête et une photo qui prend l'écran */
}
#story-view :is(.ed-cover, .ed-ch, .ed-suite) { --rc-r: var(--r, 1.3333); }
@media (max-width: 767px) { #story-view :is(.ed-cover, .ed-ch, .ed-suite) { --rc-r: var(--r-s, var(--r, 1.3333)); } }

/* ── 1. L'ouverture : plein écran, puis la photo dézoome dans un cadre arrondi à son format ────── */
/* Géométrie (tout part du cadre final, qui montre la photo entière) :
   --rc-fw × --rc-fh : le cadre, aussi grand que possible sous l'en-tête ; --rc-fx : son bord gauche.
   Ici, l'état posé (mouvement réduit, navigateur sans animation liée au défilement) : la photo dans son cadre, le titre
   dans son coin. Le plein écran et le dézoom sont écrits au § 8. */
#story-view .ed-cover--plein {
  --rc-nav: var(--nav-height, 56px);
  --rc-mx: max(var(--gutter), calc((100cqw - var(--page-max)) / 2));
  --rc-pad: clamp(16px, 2.2vw, 30px);
  --rc-fw: min(100cqw - 2 * var(--rc-mx), (100svh - var(--rc-nav) - 2 * var(--rc-air)) * var(--rc-r));
  --rc-fh: calc(var(--rc-fw) / var(--rc-r));
  --rc-fx: calc((100cqw - var(--rc-fw)) / 2);
  --rc-vf: min(var(--rc-fh) * .6, clamp(200px, 30svh, 310px));
  --rc-ve: 0px;
  margin-top: calc(-1 * var(--rc-nav));     /* la photo passe sous l'en-tête en verre */
}
/* le rail mesure la page (100cqw = sa largeur, sans la barre de défilement) et coupe ce qui dépasse : rien sur le
   bandeau d'annonce, aucun défilement horizontal */
#story-view .ed-cover--plein .ed-cover-piste { position: relative; container-type: inline-size; overflow: clip; }
#story-view .ed-cover--plein .ed-cover-cadre {
  position: relative; display: block; isolation: isolate; min-height: 0; overflow: visible;
  height: calc(var(--rc-nav) + 2 * var(--rc-air) + var(--rc-fh));
}
#story-view .ed-cover--plein .ed-cover-media {
  position: absolute; z-index: 0; inset: auto; left: var(--rc-fx); top: calc(var(--rc-nav) + var(--rc-air));
  width: var(--rc-fw); height: var(--rc-fh); margin: 0; overflow: hidden; border-radius: var(--rc-rayon);
  background: var(--u-line);
}
/* le voile sous le titre : il vit dans la fenêtre de la photo, jamais sur la page, et ne monte pas plus haut que le
   titre n'en a besoin (--rc-vf) ; --rc-ve : sa réserve pleine sous le titre, quand la photo remplit l'écran (§ 8) */
#story-view .ed-cover--plein .ed-cover-media::after {
  content: ""; position: absolute; inset: auto 0 0; height: calc(var(--rc-ve) + var(--rc-vf)); pointer-events: none;
  background: linear-gradient(to top, rgb(14 11 9 / 62%) var(--rc-ve), rgb(14 11 9 / 54%) calc(var(--rc-ve) + .2 * var(--rc-vf)),
    rgb(14 11 9 / 38%) calc(var(--rc-ve) + .45 * var(--rc-vf)), rgb(14 11 9 / 17%) calc(var(--rc-ve) + .7 * var(--rc-vf)),
    rgb(14 11 9 / 5%) calc(var(--rc-ve) + .88 * var(--rc-vf)), rgb(14 11 9 / 0) 100%);
}
#story-view .ed-cover--plein .ed-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: none; }
#story-view .ed-cover--plein .ed-cover-titre {
  position: absolute; z-index: 2; display: block; left: calc(var(--rc-fx) + var(--rc-pad)); bottom: calc(var(--rc-air) + var(--rc-pad));
  width: calc(var(--rc-fw) - 2 * var(--rc-pad)); padding: 0; color: #f6efe9;
}
#story-view .ed-cover h1 { margin: 0; max-width: 13em; }
/* tour 3 : posé dans le coin du cadre, le titre prend la taille d'un titre de page (--fs-5) ; au départ, en plein écran,
   l'animation l'agrandit jusqu'à la taille d'affichage (--rc-ts, § 8) — il dézoome avec la photo. --rc-titre-max :
   la largeur qui l'arrête avant le flacon (editorial.js, poserOuverture) */
#story-view .ed-cover--plein h1 { font-size: var(--fs-5); line-height: var(--lh-titre); letter-spacing: var(--ls-titre); max-width: min(13em, var(--rc-titre-max, 13em)); }
/* les deux couches de l'ouverture « ambiante » (fond flou, photo fondue) n'existent qu'en mouvement (§ 8) */
#story-view .ed-cover-fond, #story-view .ed-cover-plume { display: none; }
#story-view .ed-cover--plein h1:focus { outline: none; }
/* écran bas (téléphone couché) : le cadre est petit, le titre descend d'un cran pour ne pas le remplir */
@media (max-height: 520px) { #story-view .ed-cover--plein h1 { font-size: var(--fs-5); line-height: var(--lh-titre); letter-spacing: var(--ls-titre); } }

/* la suite de l'ouverture : les repères à gauche, le chapeau (et le lecteur, le sommaire) à droite, sous la photo */
#story-view .ed-cover-suite {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(14px, 1.6vw, 22px) var(--col-gap); align-items: start;
  width: min(100% - 2 * var(--edge), max(var(--rc-fw, 66rem), 66rem)); margin-inline: auto;
  padding: clamp(20px, 2.6vw, 40px) 0 calc(var(--section-y) * .5);
}
#story-view .ed-cover-reperes { display: grid; gap: 6px; }
#story-view .ed-cover-reperes > * { margin: 0; }
#story-view .ed-cover-reperes .ed-section { color: var(--u-ink); }
#story-view .ed-cover-chapo { display: grid; justify-items: start; gap: clamp(18px, 2vw, 26px); min-width: 0; }
#story-view .ed-cover .ed-deck { margin: 0; max-width: var(--mesure-chapeau); }
@media (min-width: 1024px) {
  #story-view .ed-cover-suite { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  #story-view .ed-cover-reperes { padding-top: .35em; }
}
/* sans photo : le titre, puis la même suite */
#story-view .ed-cover--texte { padding-top: var(--section-y); }
#story-view .ed-cover--texte .ed-cover-titre { display: block; width: min(100% - 2 * var(--edge), 66rem); margin-inline: auto; }

/* ── 2. Les chapitres ─────────────────────────────────────────────────────────────────────────── */
#story-view .ed-ch-tete > .ed-section { margin: 0 0 .8rem; }
#story-view .ed-ch-tete h2 { margin: 0; max-width: 16em; }
#story-view .ed-ch-phrase { margin: .65em 0 0; max-width: var(--mesure-chapeau); color: var(--u-ink-2); text-wrap: pretty; }
#story-view .ed-ch-tete + .ed-ch-corps { margin-top: clamp(16px, 1.8vw, 24px); }
#story-view .ed-ch-corps > p:not([class]) {
  margin: 0 0 1em; max-width: var(--mesure-lecture); text-wrap: pretty;
  font: 400 var(--fs-1)/var(--lh-texte) var(--serif); letter-spacing: 0; font-variant-numeric: oldstyle-nums;
}
#story-view .ed-ch-corps > p:not([class]):last-of-type { margin-bottom: 0; }
#story-view .ed-ch-actions { margin: 1.3rem 0 0; }
/* le lien d'action d'un chapitre est le lien isolé du système (.underlink : le trait se dessine au survol) */
#story-view .ed-ch-actions .underlink { display: inline-flex; align-items: center; min-height: var(--tap); }
/* tour 3 (jury : « une phrase, et le détail au clic ») : la lecture d'un chapitre peut attendre derrière une pilule */
#story-view .ed-ch-tete + .ed-ch-replie { margin-top: clamp(18px, 2vw, 26px); }
#story-view .ed-ch-replie > summary { list-style: none; cursor: pointer; width: max-content; }
#story-view .ed-ch-replie > summary::-webkit-details-marker { display: none; }
#story-view .ed-ch-replie .ed-ch-plus-fermer, #story-view .ed-ch-replie[open] .ed-ch-plus-ouvrir { display: none; }
#story-view .ed-ch-replie[open] .ed-ch-plus-fermer { display: inline; }
#story-view .ed-ch-replie > .ed-ch-corps { margin-top: clamp(18px, 2vw, 26px); }
@media (prefers-reduced-motion: no-preference) {
  #story-view .ed-ch-replie[open] > .ed-ch-corps { animation: rc-monte var(--mm-t-reveal) var(--mm-ease) both; }
}

/* la photo d'un chapitre : entière, dans un cadre arrondi à son format */
#story-view .ed-ch .ed-ch-media { margin: 0; padding: 0; overflow: hidden; border-radius: var(--rc-rayon); aspect-ratio: var(--rc-r); background: var(--u-line); }
#story-view .ed-ch .ed-ch-media .ed-ch-img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; }

/* côte à côte : la photo d'un côté, la phrase et la lecture de l'autre ; empilés sous 1024 px */
#story-view .ed-ch--cote { padding-inline: var(--edge); }
#story-view .ed-ch--cote .ed-ch-media { width: min(100%, calc(72svh * var(--rc-r))); margin-inline: auto; }
#story-view .ed-ch--cote .ed-ch-carte { width: min(100%, max(calc(72svh * var(--rc-r)), 34rem)); margin: clamp(20px, 3vw, 32px) auto 0; padding: 0; }
@media (min-width: 1024px) {
  #story-view .ed-ch--cote { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: center; }
  #story-view .ed-ch--cote .ed-ch-media { grid-column: 1 / 7; grid-row: 1; width: min(100%, calc(78svh * var(--rc-r))); margin: 0; justify-self: start; }
  #story-view .ed-ch--cote .ed-ch-carte { grid-column: 7 / 13; grid-row: 1; width: auto; margin: 0; padding: 0 0 0 clamp(8px, 2vw, 40px); }
  #story-view .ed-ch--inverse .ed-ch-media { grid-column: 7 / 13; justify-self: end; }
  #story-view .ed-ch--inverse .ed-ch-carte { grid-column: 1 / 7; padding: 0 clamp(8px, 2vw, 40px) 0 0; }
  #story-view .ed-ch--portrait .ed-ch-media { grid-column: 2 / 7; justify-self: center; }
  #story-view .ed-ch--portrait.ed-ch--inverse .ed-ch-media { grid-column: 8 / 13; justify-self: center; }
  #story-view .ed-ch--portrait.ed-ch--inverse .ed-ch-carte { grid-column: 2 / 7; }
}
@media (min-width: 1280px) {
  #story-view .ed-ch--cote:not(.ed-ch--portrait) .ed-ch-media { grid-column: 1 / 8; }
  #story-view .ed-ch--cote:not(.ed-ch--portrait) .ed-ch-carte { grid-column: 8 / 13; padding-left: clamp(16px, 3vw, 56px); }
  #story-view .ed-ch--inverse:not(.ed-ch--portrait) .ed-ch-media { grid-column: 6 / 13; }
  #story-view .ed-ch--inverse:not(.ed-ch--portrait) .ed-ch-carte { grid-column: 1 / 6; padding: 0 clamp(16px, 3vw, 56px) 0 0; }
}

/* plein cadre : la photo prend l'écran (son titre reste visible dessous) ; puis le titre à gauche, la lecture à droite */
#story-view .ed-ch--plein {
  padding-inline: var(--edge); padding-top: var(--rc-air);
  --rc-plein: min(100%, calc((100svh - var(--nav-height, 56px) - 2 * var(--rc-air) - clamp(7.5rem, 18svh, 10rem)) * var(--rc-r)));
}
#story-view .ed-ch--plein .ed-ch-media { width: var(--rc-plein); margin-inline: auto; }
#story-view .ed-ch--plein .ed-ch-carte {
  position: static; width: max(var(--rc-plein), min(100%, 40rem)); margin: clamp(20px, 2.4vw, 34px) auto 0; padding: 0; background: none; animation: none;
}
@media (min-width: 1024px) {
  #story-view .ed-ch--plein .ed-ch-carte:has(> .ed-ch-tete + .ed-ch-corps) {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--col-gap); align-items: start;
  }
  #story-view .ed-ch--plein .ed-ch-tete + .ed-ch-corps { margin-top: .3em; }
}

/* texte seul : le titre à gauche, la lecture à droite (la même grille que sous une photo plein cadre) */
#story-view .ed-ch--texte { display: block; padding-inline: var(--edge); }
#story-view .ed-ch--texte .ed-ch-carte { width: min(100%, 36rem); margin-inline: auto; }
@media (min-width: 1024px) {
  #story-view .ed-ch--texte .ed-ch-carte { width: min(100%, 66rem); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--col-gap); align-items: start; }
  #story-view .ed-ch--texte .ed-ch-tete + .ed-ch-corps { margin-top: .3em; }
}

/* une grande phrase, le temps d'un écran ; la citation, de même */
#story-view .ed-ch--phrase { min-height: min(76svh, 48rem); }
/* l'année d'une grande phrase est une étiquette : un seul texte d'affichage par page, le titre de l'ouverture */
#story-view .ed-ch-annee { margin: 0 0 1.1rem; color: var(--u-ink-2); font: 400 var(--fs-n2)/var(--lh-petit) var(--mono); letter-spacing: var(--ls-etiquette); }
#story-view .ed-ch--citation { min-height: min(64svh, 40rem); align-content: center; }
#story-view .ed-ch--citation figcaption { margin-top: 1.4rem; }

/* ── 3. Nos terroirs : deux pilules pour sauter à un pays, puis l'index des domaines ──────────── */
#story-view .ed-sommaire { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 0; border: 0; }
#story-view .ed-sommaire .ed-section { margin: 0; }
#story-view .ed-sommaire div { display: flex; flex-wrap: wrap; gap: 8px; }
/* le point de l'élément actif du cadran des domaines (fx-cadran.css lit --cadran-point) : sur le papier de la lecture,
   la couleur de la page (Nos terroirs : sauge, 4,9:1 sur le papier) — aucune troisième couleur ; sur un autre fond
   (la fin de page en sauge qui passe la ligne des 45 %), l'encre de ce fond */
#story-view .ed-recit { --cadran-point: var(--u-ink, currentColor); }
html.mm-univers body[data-univers="papier"] #story-view .ed-recit[data-couleur="sauge"],
html:not(.mm-univers) #story-view .ed-recit[data-couleur="sauge"] [data-univers="papier"] { --cadran-point: #676f61; }
html.mm-univers body[data-univers="papier"] #story-view .ed-recit[data-couleur="bois"],
html:not(.mm-univers) #story-view .ed-recit[data-couleur="bois"] [data-univers="papier"] { --cadran-point: #735339; }
html.mm-univers body[data-univers="papier"] #story-view .ed-recit[data-couleur="vin"],
html:not(.mm-univers) #story-view .ed-recit[data-couleur="vin"] [data-univers="papier"] { --cadran-point: #28140e; }
#story-view .ed-domaines { padding-inline: var(--edge); }
#story-view .ed-domaines-tete { align-items: baseline; padding-bottom: 16px; }
#story-view .ed-domaines-liste { column-gap: var(--col-gap); }
@media (min-width: 768px) and (max-width: 1279px) { #story-view .ed-domaines-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#story-view .ed-domaine { position: relative; display: block; padding: 18px 0 20px; }
#story-view .ed-domaine-nom { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
#story-view .ed-domaine-nom h3 { margin: 0; min-width: 0; }
#story-view .ed-domaine-lien {
  flex: none; display: inline-flex; align-items: baseline; gap: .45em; color: var(--u-ink-2); white-space: nowrap;
  font: 400 var(--fs-n1)/var(--lh-petit) var(--sans); transition: color var(--mm-t-hover) var(--mm-ease);
}
#story-view .ed-domaine-lien::after { content: ""; position: absolute; inset: 0; }     /* toute la case mène aux vins */
#story-view .ed-domaine-lien > span[aria-hidden] { display: inline-block; transition: transform var(--mm-t-hover) var(--mm-ease); }
/* le même geste que les liens du système : au survol de la case, le trait se dessine sous « Voir ses vins » */
#story-view .ed-domaine-mot { position: relative; }
#story-view .ed-domaine-mot::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.2em; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%;
}
#story-view .ed-domaine-lien:focus-visible .ed-domaine-mot::after { transform: scaleX(1); transform-origin: 0 50%; }
@media (prefers-reduced-motion: no-preference) { #story-view .ed-domaine-mot::after { transition: transform var(--mm-t-panel) var(--mm-ease); } }
#story-view .ed-domaine-lien:focus-visible { outline: none; }
#story-view .ed-domaine:has(.ed-domaine-lien:focus-visible) { outline: 2px solid var(--u-ink, currentColor); outline-offset: 2px; border-radius: 4px; }
#story-view .ed-domaine-meta { margin: 6px 0 0; }
#story-view .ed-domaine-texte { margin: 10px 0 0; }
@media (max-width: 767px) {
  #story-view .ed-domaine { padding: 14px 0 16px; }
  #story-view .ed-domaine-meta { margin-top: 4px; }
  #story-view .ed-domaine-texte { margin-top: 6px; }
}
@media (hover: hover) {
  #story-view .ed-domaine:hover .ed-domaine-lien { color: var(--u-ink); }
  #story-view .ed-domaine:hover .ed-domaine-lien > span[aria-hidden] { transform: translateX(4px); }
  #story-view .ed-domaine:hover .ed-domaine-mot::after { transform: scaleX(1); transform-origin: 0 50%; }
}
/* à l'ordinateur, à la souris, l'index reste nu : un nom, une flèche. « Voir ses vins » se glisse à côté de la flèche
   au survol de la case et au clavier (au doigt et sous 1024 px, il reste écrit) */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  #story-view .ed-domaine-mot { opacity: 0; translate: 6px 0; }
  #story-view .ed-domaine:hover .ed-domaine-mot, #story-view .ed-domaine-lien:focus-visible .ed-domaine-mot { opacity: 1; translate: 0 0; }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #story-view .ed-domaine-mot { transition: opacity var(--mm-t-hover) var(--mm-ease), translate var(--mm-t-hover) var(--mm-ease); }
}

/* ── 4. La fin de page : la cave, les sources, la suite ───────────────────────────────────────── */
/* jusqu'à trois vins : le titre se range à gauche, les cartes à droite (plus de colonne vide) ; les phrases au-dessus
   des photos gardent leur ligne commune (editorial.css, subgrid) : les photos d'une rangée restent alignées */
@media (min-width: 1280px) {
  #story-view .ed-cave:is([data-n="1"], [data-n="2"], [data-n="3"]) {
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); grid-template-rows: auto auto 1fr; column-gap: var(--col-gap); padding-inline: var(--edge);
  }
  #story-view .ed-cave:is([data-n="1"], [data-n="2"], [data-n="3"]) .ed-cave-tete { grid-column: 1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; }
  #story-view .ed-cave:is([data-n="1"], [data-n="2"], [data-n="3"]) .ed-cave-intro { grid-column: 1; margin: 10px 0 0; }
  #story-view .ed-cave:is([data-n="1"], [data-n="2"], [data-n="3"]) .ed-cave-rail {
    grid-column: 2; grid-row: 1 / span 3; margin: 0; padding: 0; overflow: visible; grid-auto-columns: calc((100% - 2 * var(--col-gap)) / 3);
  }
}
/* tour 3, suite (jury : prix et cartons à 1,1–2:1 quand la page prend la couleur de « Lire ensuite ») : les cartes de
   vin de la rangée suivent l'univers actif — le domaine, l'origine, le carton et la mention en encre seconde, le prix en
   encre pleine. Sur le papier, les mêmes gris qu'avant (#655f5a, 5,9:1 ; #4e4945) */
#story-view .ed-cave .wine-card :is(.catalogue-card-spec, .wine-carton, .catalogue-card-status) { color: var(--u-ink-2); }
#story-view .ed-cave .wine-card .catalogue-card-price { color: var(--u-ink); }
#story-view .ed-cave .wine-card .catalogue-card-status { border-color: var(--u-line); }
/* pendant le fondu de 900 ms d'un changement d'univers (html.mm-univers-fondu, transitions.css), ces encres suivent le
   fond au rythme du titre de la rangée et du nom des vins, au lieu de passer d'un coup au clair avant lui */
@media (prefers-reduced-motion: no-preference) {
  html.mm-univers-fondu #story-view .ed-cave .wine-card :is(.catalogue-card-spec, .catalogue-card-price, .wine-carton, .catalogue-card-status) {
    transition: color 900ms var(--mm-ease), border-color 900ms var(--mm-ease);
  }
}
/* la phrase d'un vin se pose en bas de sa ligne, contre sa photo : le même écart partout, quelle que soit sa longueur */
#story-view .ed-cave-ligne { display: flex; align-items: flex-end; }
#story-view .ed-cave-ligne > span { min-width: 0; }
#story-view .ed-sources { padding: clamp(22px, 2.6vw, 36px) var(--edge); }
#story-view .ed-sources h2 { margin: 0 0 10px; }
/* le titre des sources est aussi leur poignée (<summary>). Liste ouverte à l'ordinateur : un simple titre au-dessus
   d'elle. Liste repliée (au téléphone, à l'arrivée) : une ligne « Sources » et son signe, un geste l'ouvre. */
#story-view .ed-sources summary { display: flex; align-items: center; justify-content: space-between; list-style: none; }
#story-view .ed-sources summary::-webkit-details-marker { display: none; }
#story-view .ed-sources summary::after { color: var(--u-ink-2); font: 400 var(--fs-1)/1 var(--sans); }
#story-view .ed-sources details:not([open]) > summary { min-height: var(--sys-cible, 44px); cursor: pointer; }
#story-view .ed-sources details:not([open]) > summary::after { content: "+"; }
#story-view .ed-sources details:not([open]) h2 { margin: 0; }
@media (min-width: 768px) { #story-view .ed-sources details[open] > summary { pointer-events: none; } }
@media (max-width: 767px) {
  #story-view .ed-sources { padding-block: 6px; }
  #story-view .ed-sources summary { min-height: var(--sys-cible, 44px); cursor: pointer; }
  #story-view .ed-sources details[open] > summary::after { content: "\2212"; }
  #story-view .ed-sources h2 { margin: 0; }
  #story-view .ed-sources ol { padding-bottom: 14px; }
}
/* un lien dans un texte (source, auteur d'une citation) : le lien du système — trait fin à 40 % de l'encre, plein au survol */
#story-view :is(.ed-sources, .ed-ch--citation figcaption) a {
  text-decoration-thickness: 1px; text-underline-offset: .24em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
#story-view :is(.ed-sources, .ed-ch--citation figcaption) a:is(:hover, :focus-visible) { text-decoration-color: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  #story-view :is(.ed-sources, .ed-ch--citation figcaption) a { transition: text-decoration-color var(--mm-t-hover) var(--mm-ease), color var(--mm-t-hover) var(--mm-ease); }
}
/* au doigt, chaque source est une cible de 44 px (le texte reste petit) */
@media (max-width: 1023px), (pointer: coarse) {
  #story-view .ed-sources li { padding-block: 14px; }
  #story-view .ed-sources li > a { display: block; margin-block: -14px; padding-block: 14px; }
}

/* « Lire ensuite » : la photo du récit suivant, entière dans un grand cadre arrondi ; le titre dessous */
#story-view .ed-suite-lien {
  display: block; width: min(100% - 2 * var(--edge), 44rem); margin-inline: auto; padding: var(--section-y) 0 calc(var(--section-y) * .9);
}
#story-view .ed-suite.has-media .ed-suite-lien { width: min(100% - 2 * var(--edge), calc(62svh * var(--rc-r))); }
#story-view .ed-suite-media { display: block; order: 0; width: 100%; aspect-ratio: var(--rc-r); overflow: hidden; border-radius: var(--rc-rayon); background: var(--u-line); }
#story-view .ed-suite-img { display: block; width: 100%; height: 100%; object-fit: cover; }
#story-view .ed-suite-texte { gap: 10px; margin-top: clamp(18px, 2vw, 26px); }
#story-view .ed-suite:not(.has-media) .ed-suite-texte { margin-top: 0; }
#story-view .ed-suite-titre { max-width: none; }
#story-view .ed-suite-fleche { display: inline-block; margin-left: .32em; transition: transform var(--mm-t-hover) var(--mm-ease); }
#story-view .ed-suite-lien:focus-visible { outline-offset: 6px; border-radius: var(--rc-rayon); }
/* au survol : la flèche avance et la photo s'approche à peine dans son cadre (plus de soulignement posé d'un coup) */
#story-view .ed-suite-lien:is(:hover, :focus-visible) .ed-suite-titre { text-decoration: none; }
@media (hover: hover) { #story-view .ed-suite-lien:hover .ed-suite-fleche { transform: translateX(6px); } }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #story-view .ed-suite-img { transition: scale var(--mm-t-reveal) var(--mm-ease); }
  #story-view .ed-suite-lien:hover .ed-suite-img { scale: 1.03; }
}

/* ── 5. Le carnet : le titre à gauche, les rubriques en pilules, des cartes à photo arrondie ─── */
#story-view .ed-journal { padding: clamp(28px, 4vw, 60px) var(--edge) var(--section-y); }
#story-view .ed-journal--suite { padding-top: 0; }
#story-view .ed-journal--suite > .ed-filters { margin-top: 0; }
/* le carnet (reprise du 25/11) : sous sa photo, la suite de l'ouverture prend la largeur de la page, comme les rubriques
   et les cartes qu'elle annonce — le surtitre, les rubriques et les cartes partagent un même bord gauche (à 1470 × 737,
   la suite centrée des récits les posait à 200 px, 663 px et 48 px) */
#story-view .ed-carnet .ed-cover-suite { width: auto; margin-inline: var(--edge); }
#story-view .ed-journal > header { justify-items: start; text-align: left; }
#story-view .ed-journal .ed-deck { margin: .8rem 0 0; }
#story-view .ed-filters { justify-content: flex-start; gap: 8px; }
/* au téléphone, le rail des rubriques file jusqu'aux bords de l'écran */
@media (max-width: 767px) { #story-view .ed-filters { margin-inline: calc(-1 * var(--edge)); padding-inline: var(--edge); scroll-padding-inline: var(--edge); } }
#story-view .ed-card-photo { border-radius: var(--rc-rayon); }
#story-view .ed-card-caption { padding-top: 14px; }
#story-view .ed-card-caption .ed-section { margin: 0 0 .45rem; }
#story-view .ed-card-caption h2 { margin: 0 0 .35em; }
#story-view .ed-card-caption p { margin: 0 0 .7rem; color: var(--u-ink-2); }
#story-view .ed-carnet-vide { text-align: left; }
/* « Lire l'article » : le lien du système ; son trait se dessine quand on survole la carte */
#story-view .ed-card-caption .underlink { margin-top: auto; }
#story-view .ed-card > a:is(:hover, :focus-visible) .underlink::after { transform: scaleX(1); transform-origin: 0 50%; }
@media (hover: none), (pointer: coarse) {
  #story-view .ed-card > a:hover:not(:focus-visible, :active) .underlink::after { transform: scaleX(0); transform-origin: 100% 50%; }
}
/* la carte survolée reste nette, les autres s'effacent un peu (le geste des cartes de l'accueil, en discret) */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #story-view .ed-card-photo { transition: opacity var(--mm-t-panel) var(--mm-ease), filter var(--mm-t-panel) var(--mm-ease); }
  #story-view .ed-card-grid:has(.ed-card > a:hover) .ed-card:not(:has(> a:hover)) .ed-card-photo { opacity: .62; filter: blur(2px); }
}

/* ── 6. Le lecteur de l'entretien (page Pierre) : une pilule en verre ─────────────────────────── */
#story-view .ed-interview-place { max-width: 100%; }
#story-view .ed-interview {
  display: inline-grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 12px;
  width: auto; max-width: 100%; margin: 0; padding: 5px 22px 5px 5px; border: 1px solid var(--u-line); border-radius: 28px;
  background: color-mix(in srgb, var(--u-ink) 7%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
}
#story-view .ed-interview figcaption { cursor: pointer; }
#story-view .ed-audio-toggle { width: var(--sys-h-bouton, 44px); height: var(--sys-h-bouton, 44px); transition: transform var(--mm-t-hover) var(--mm-ease), opacity var(--mm-t-hover) var(--mm-ease); }
#story-view .ed-audio-toggle:active { transform: scale(.94); transition-duration: var(--mm-t-press); }
#story-view .ed-audio-timeline { margin: 0; padding-left: 12px; }
#story-view .ed-audio-message { padding: 2px 0 8px 12px; }
/* à l'ordinateur, la ligne de lecture se range dans la pilule, à droite de l'intitulé */
@media (min-width: 768px) {
  #story-view .ed-interview:has(.ed-audio-timeline:not([hidden])) { grid-template-columns: auto auto minmax(15rem, 19rem); }
  #story-view .ed-audio-timeline { grid-column: 3; grid-row: 1; padding-left: 6px; margin-right: -12px; }
}
/* pendant l'écoute, quand on a quitté sa place : la pilule flotte en bas de l'écran, en verre */
#story-view .ed-interview.is-flottant {
  position: fixed; z-index: 8; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0;
  width: max-content; max-width: calc(100vw - 2 * var(--gutter)); color: var(--u-ink);
  background: color-mix(in srgb, var(--u-bg) 70%, transparent); border-color: color-mix(in srgb, var(--u-ink) 22%, transparent);
}
/* au téléphone, la pilule flottante tient sur une ligne : le bouton et la ligne de lecture (l'intitulé reste lu) */
@media (max-width: 767px) {
  #story-view .ed-interview.is-flottant { width: calc(100vw - 2 * var(--gutter)); }
  #story-view .ed-interview.is-flottant figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #story-view .ed-interview.is-flottant .ed-audio-timeline { grid-column: 2; grid-row: 1; padding-left: 0; margin-right: -12px; }
}
@media (prefers-reduced-motion: no-preference) { #story-view .ed-interview.is-flottant { animation: rc-flotte var(--mm-t-panel) var(--mm-ease) backwards; } }
@keyframes rc-flotte { from { opacity: 0; transform: translateY(var(--mm-d-s)); } }

/* ── 7. Boutons, puces et liens : ceux du langage commun (fx-systeme.css), sans retouche ici ──── */

/* ── 8. Le mouvement, lié au défilement ───────────────────────────────────────────────────────── */
@supports (animation-timeline: view()) and (scale: tan(atan2(1px, 1px))) {
  @media (prefers-reduced-motion: no-preference) {
    /* L'ouverture. La photo remplit l'écran ; en descendant, sa fenêtre se referme des quatre côtés à la fois jusqu'au
       cadre arrondi, pendant que la photo dézoome dedans jusqu'à tenir entière.
       --rc-k : l'échelle qui fait remplir l'écran à la photo ; --rc-tx, --rc-ty : son décalage à cette échelle (le point
       --cx --cy de la photo reste à l'écran) ; --rc-b0 : le vide que le cadre posé laisse sous lui.
       --rc-d : la longueur du dézoom. Jamais plus courte que --rc-b0 (la suite n'arrive qu'après la fenêtre et ne touche
       jamais la photo). Cadre presque aussi haut que l'écran (ordinateur) : --rc-dc, le temps de voir la photo se poser,
       et la suite entre quand elle est posée. Cadre bien plus court que l'écran (téléphone, fenêtre étroite) : à peine
       plus que ce vide, b0² / (b0 − 8svh) — la suite monte collée au bas de la photo, jamais plus de 8 % d'écran de trou. */
    #story-view .ed-cover--plein {
      --rc-dc: 62svh;
      --rc-k: calc(max(tan(atan2(100cqw, var(--rc-fw))), tan(atan2(100lvh, var(--rc-fh)))) * 1.012);
      --rc-b0: calc(100lvh - var(--rc-nav) - var(--rc-air) - var(--rc-fh));
      --rc-d: max(var(--rc-b0), min(var(--rc-dc), var(--rc-b0) * tan(atan2(var(--rc-b0), max(.01px, var(--rc-b0) - 8svh)))));
      --rc-tx: calc((100cqw - var(--rc-k) * var(--rc-fw)) * var(--cx, .5) - var(--rc-fx));
      --rc-ty: calc((100lvh - var(--rc-k) * var(--rc-fh)) * var(--cy, .5) - var(--rc-nav) - var(--rc-air));
      /* plein écran : le titre à la marge de la page, à la même distance du bas (--rc-m0) ; le voile garde sa partie
         pleine sous lui (25/11 : plus de bandeau d'annonce, ses 30 px ne se retranchent plus) */
      --rc-m0: calc(var(--gutter) + 6px);
      --rc-titre-x: calc(var(--rc-mx) - var(--rc-fx) - var(--rc-pad));
      --rc-titre-y: calc(100svh - var(--rc-m0) - var(--rc-nav) - var(--rc-air) - var(--rc-fh) + var(--rc-pad));
      --rc-ve: calc(100lvh - 100svh + var(--rc-m0) - var(--rc-pad));
      --rc-plage: exit-crossing 0% exit-crossing var(--rc-d);
      --rc-ts: 1;
    }
    #story-view .ed-cover--plein .ed-cover-piste {
      height: calc(var(--rc-nav) + 2 * var(--rc-air) + var(--rc-fh) + var(--rc-d));
      view-timeline: --rc-ouverture block; view-timeline-inset: 0;   /* 0 : le haut de l'écran, pas la marge de défilement de l'en-tête */
    }
    #story-view .ed-cover--plein .ed-cover-cadre { position: sticky; top: 0; }
    /* la fenêtre : tout l'écran, puis le cadre */
    #story-view .ed-cover--plein .ed-cover-media {
      left: 0; top: 0; width: 100%; height: 100lvh; border-radius: 0;
      animation: rc-fenetre-ouverture linear both; animation-timeline: --rc-ouverture; animation-range: var(--rc-plage);
    }
    /* la photo : à la place et à la taille du cadre, agrandie jusqu'à remplir l'écran, puis ramenée à 1 */
    #story-view .ed-cover--plein .ed-cover-img {
      inset: auto; left: var(--rc-fx); top: calc(var(--rc-nav) + var(--rc-air)); width: var(--rc-fw); height: var(--rc-fh);
      transform-origin: 0 0; will-change: transform;
      animation: rc-dezoom linear both; animation-timeline: --rc-ouverture; animation-range: var(--rc-plage);
    }
    /* le voile et le titre suivent le bas de la fenêtre */
    #story-view .ed-cover--plein .ed-cover-media::after {
      will-change: transform;
      animation: rc-voile linear both; animation-timeline: --rc-ouverture; animation-range: var(--rc-plage);
    }
    #story-view .ed-cover--plein .ed-cover-titre {
      transform-origin: 0 100%;
      animation: rc-titre linear both; animation-timeline: --rc-ouverture; animation-range: var(--rc-plage);
    }
    /* tour 3 — une seule ouverture pour tous les récits. Quand un flacon ne tiendrait pas entier dans la photo plein
       écran, editorial.js réduit la photo nette juste assez et pose .est-ambiant : la même photo, en petit fichier
       agrandi et flouté, remplit tout l'écran (le fond) ; une copie nette aux bords fondus (la plume) s'y pose ; la
       photo nette apparaît en se posant dans son cadre (rc-net). Seuls transform et opacity bougent. */
    #story-view .ed-cover--plein.est-ambiant .ed-cover-fond {
      display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
      object-position: calc(var(--cx, .5) * 100%) calc(var(--cy, .5) * 100%);
      transform: scale(1.16); filter: blur(var(--rc-flou, 34px)) saturate(1.06) brightness(.88);
    }
    #story-view .ed-cover--plein.est-ambiant .ed-cover-plume {
      display: block; position: absolute; inset: auto; left: var(--rc-fx); top: calc(var(--rc-nav) + var(--rc-air));
      width: var(--rc-fw); height: var(--rc-fh); object-fit: cover; transform-origin: 0 0; will-change: transform;
      -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--rc-pg, 0%), #000 calc(100% - var(--rc-pd, 0%)), transparent),
        linear-gradient(to bottom, transparent, #000 var(--rc-ph, 0%), #000 calc(100% - var(--rc-pb, 0%)), transparent);
      -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 var(--rc-pg, 0%), #000 calc(100% - var(--rc-pd, 0%)), transparent),
        linear-gradient(to bottom, transparent, #000 var(--rc-ph, 0%), #000 calc(100% - var(--rc-pb, 0%)), transparent);
      mask-composite: intersect;
      animation: rc-dezoom linear both; animation-timeline: --rc-ouverture; animation-range: var(--rc-plage);
    }
    #story-view .ed-cover--plein.est-ambiant .ed-cover-img {
      animation: rc-dezoom linear both, rc-net linear both; animation-timeline: --rc-ouverture, --rc-ouverture;
      animation-range: var(--rc-plage), var(--rc-plage);
    }
    /* la suite de l'ouverture monte avec la page : ses deux textes se posent en entrant à l'écran (le lecteur de
       l'entretien et le sommaire restent hors du mouvement : la pilule du lecteur doit pouvoir flotter sur l'écran) */
    #story-view .ed-cover--plein :is(.ed-cover-reperes, .ed-deck) {
      animation: rc-monte linear both; animation-timeline: view(); animation-range: entry 0% entry 100%;
    }
    /* les photos des chapitres et de « Lire ensuite » : le cadre s'ouvre pendant que la photo dézoome, en entrant à l'écran */
    #story-view .ed-ch .ed-ch-media, #story-view .ed-suite-media {
      animation: rc-fenetre linear both; animation-timeline: view(); animation-range: entry 0% entry 90%;
    }
    #story-view .ed-ch .ed-ch-media .ed-ch-img, #story-view .ed-suite-img {
      animation: rc-pose linear both; animation-timeline: view(); animation-range: entry 0% cover 42%;
    }
  }
  /* au départ, le titre est à la taille d'affichage (--fs-7) ; posé, à celle d'un titre de page (--fs-5) — à l'ordinateur,
     sur un écran assez haut (au téléphone, il garde --fs-5 tout du long, comme avant) */
  @media (prefers-reduced-motion: no-preference) and (min-width: 1024px) and (min-height: 521px) {
    #story-view .ed-cover--plein { --rc-ts: tan(atan2(var(--fs-7), var(--fs-5))); }
  }
  @media (prefers-reduced-motion: no-preference) and (max-width: 767px) { #story-view .ed-cover--plein { --rc-flou: 24px; } }
  /* au doigt, le dézoom suit le doigt : plus court, la suite collée à la photo */
  @media (prefers-reduced-motion: no-preference) and (max-width: 1023px), (prefers-reduced-motion: no-preference) and (pointer: coarse) {
    #story-view .ed-cover--plein { --rc-dc: 34svh; }
  }
}
/* --rc-i0, --rc-r0 : la fenêtre de départ quand la photo ne remplit pas tout l'écran (flacon entier, editorial.js
   poserOuverture) ; sinon tout l'écran, à angles droits */
@keyframes rc-fenetre-ouverture {
  from { clip-path: inset(var(--rc-i0, 0px) round var(--rc-r0, 0px)); }
  to { clip-path: inset(calc(var(--rc-nav) + var(--rc-air)) var(--rc-fx) var(--rc-b0) var(--rc-fx) round var(--rc-rayon)); }
}
@keyframes rc-dezoom { from { transform: translate3d(var(--rc-tx), var(--rc-ty), 0) scale(var(--rc-k)); } to { transform: translate3d(0, 0, 0) scale(1); } }
@keyframes rc-voile { to { transform: translate3d(0, calc(var(--rc-ve) - var(--rc-b0)), 0); } }
@keyframes rc-titre { from { transform: translate3d(var(--rc-titre-x), var(--rc-titre-y), 0) scale(var(--rc-ts, 1)); } to { transform: translate3d(0, 0, 0); } }
@keyframes rc-net { 0% { opacity: 0; } 65%, 100% { opacity: 1; } }
@keyframes rc-monte { from { opacity: 0; transform: translate3d(0, var(--mm-d-s), 0); } }
@keyframes rc-fenetre { from { clip-path: inset(7% 6% 7% 6% round var(--rc-rayon)); } to { clip-path: inset(0 round var(--rc-rayon)); } }
@keyframes rc-pose { from { transform: scale(1.14); } to { transform: scale(1); } }
/* sans animation liée au défilement : les photos des chapitres ne gardent pas l'entrée de chapitres.css */
#story-view .ed-ch--plein .ed-ch-carte { animation: none; }

/* ── 9. Tour 3 : la page introuvable, la page « Crédits » ─────────────────────────────────────── */
/* la page introuvable : la nature morte de Benjamin, entière dans un cadre arrondi à son format, au-dessus du titre */
#story-view .ed-introuvable-photo { width: clamp(168px, 17vw, 240px); margin: 0 auto -.25rem; overflow: hidden; border-radius: var(--rc-rayon); aspect-ratio: 1020 / 1289; background: var(--u-line); }
#story-view .ed-introuvable-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* « Crédits » : la grappe au pointillé, marque discrète sur le papier, au-dessus du titre (une marque de colophon) */
#story-view .ed-credits-marque { display: block; width: clamp(72px, 6.5vw, 104px); height: auto; margin: 0 0 clamp(14px, 1.6vw, 22px); }
/* « Crédits » : un titre de page, puis une section par page — son titre (lien vers elle) à gauche, la liste à droite */
#story-view .ed-credits .ed-credits-groupe { padding-block: clamp(18px, 2.4vw, 32px); border-top: 1px solid var(--u-line); }
#story-view .ed-credits .ed-credits-groupe h2 { font: 400 var(--fs-3)/var(--lh-titre) var(--serif); letter-spacing: var(--ls-sous-titre); }
#story-view .ed-credits .ed-credits-groupe h2 a { color: inherit; font: inherit; letter-spacing: inherit; }
#story-view .ed-credits-liste { margin: 0; padding-left: 1.4em; color: var(--u-ink-2); font: 400 var(--fs-n1)/var(--lh-petit) var(--sans); }
#story-view .ed-credits-liste li { padding-block: 5px; }
#story-view .ed-credits-liste a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .24em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
#story-view .ed-credits-liste a:is(:hover, :focus-visible) { color: var(--u-ink); text-decoration-color: currentColor; }
#story-view .ed-credits-domaine { color: var(--u-ink); }
@media (max-width: 1023px), (pointer: coarse) {
  #story-view .ed-credits-liste li { padding-block: 12px; }
}

/* 25/11 — les vidéos de vigne (videos.js) prennent la place de leur photo : mêmes classes, même cadre. Ici, ce que les
   règles des photos donnaient à « img » seulement, et le cadrage de chaque vidéo (ordinateur, puis téléphone). */
video.mm-video { display: block; object-fit: cover; object-position: var(--mm-pos, 50% 50%); background: #2a221d; }
@media (max-width: 767px) { video.mm-video { object-position: var(--mm-pos-tel, var(--mm-pos, 50% 50%)); } }
.ed-card-photo video.mm-video { width: 100%; height: 100%; transition: transform var(--mm-t-reveal) var(--mm-ease); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .ed-card > a:hover .ed-card-photo video.mm-video { transform: scale(1.03); }
}
.carte video.mm-video { position: absolute; inset: 0; width: 100%; height: 100%; transform: scale(1.14); filter: blur(14px) brightness(.88);
  transition: filter .9s var(--mm-ease, ease), transform 1.1s var(--mm-ease, ease); }
#home-view .carte video.mm-video { transform: scale(1.12); filter: blur(16px) brightness(.84) saturate(.9);
  transition: filter var(--mm-t-chapter, 1100ms) var(--mm-ease, ease), transform var(--mm-t-chapter, 1100ms) var(--mm-ease, ease); }
.carte.is-active video.mm-video, #home-view .carte.is-active video.mm-video { transform: none; filter: none; }

/* 25/11, 18 h (Benjamin, sur iPhone : « les titres sont trop petits ») : au téléphone, le titre d'ouverture des récits
   prend la taille d'affichage (--fs-7, 38 px) au lieu de celle d'un titre de page (--fs-5, 29 px) ; il passe sur deux
   lignes équilibrées plutôt que de s'étirer sur une seule. */
@media (max-width: 767px) {
  #story-view .ed-cover--plein h1 { font-size: var(--fs-7); }
}
