/* Météo du vol libre — le livre en ligne. S'appuie sur ../style.css (couleurs, en-tête, pied, boutons). */

/* L'espace insécable (U+00A0, avant « : », dans « 1 °C », « 100 m ») est deux fois trop large en Charter : 10 px au lieu
   de 5 à 18 px. Ce seul caractère est pris dans Georgia (ou Times), où il a la largeur d'une espace ordinaire. */
@font-face { font-family: "Espace insécable"; src: local("Georgia"), local("Times New Roman"), local("Times"); unicode-range: U+00A0; }

:root {
  --lecture: "Espace insécable", Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --mesure: 42rem;
  --rayon: 14px;
  --ciel-haut: #8cbbe8; --ciel-bas: #e6f1fb; --accent: #2f6fb3; --relief-1: #5d7ea3; --relief-2: #87a3c2; --relief-3: #b7cbe0;
  --c-pourquoi: #2563c9; --f-pourquoi: #eaf1fd;
  --c-piege: #c0392b;    --f-piege: #fdecea;
  --c-rando: #2f855a;    --f-rando: #e7f5ec;
  --c-vol: #0e7490;      --f-vol: #e3f4f8;
  --c-retenir: #a86a12;  --f-retenir: #fdf3e1;
  --c-avous: #7048c4;    --f-avous: #f3eefd;
  --c-memo: #4b5868;     --f-memo: #f1f4f8;
  --fig-fond: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-pourquoi: #8fb6ff; --f-pourquoi: #18253b;
    --c-piege: #ff9a8b;    --f-piege: #3a1c19;
    --c-rando: #7fd6a0;    --f-rando: #15301f;
    --c-vol: #6fd0e6;      --f-vol: #102e36;
    --c-retenir: #f2c26b;  --f-retenir: #34280f;
    --c-avous: #c3a8ff;    --f-avous: #271d3d;
    --c-memo: #b5c1cf;     --f-memo: #1c2533;
  }
}
:root[data-theme="dark"] {
  --c-pourquoi: #8fb6ff; --f-pourquoi: #18253b;
  --c-piege: #ff9a8b;    --f-piege: #3a1c19;
  --c-rando: #7fd6a0;    --f-rando: #15301f;
  --c-vol: #6fd0e6;      --f-vol: #102e36;
  --c-retenir: #f2c26b;  --f-retenir: #34280f;
  --c-avous: #c3a8ff;    --f-avous: #271d3d;
  --c-memo: #b5c1cf;     --f-memo: #1c2533;
}

/* Teintes des parties : le ciel du bandeau et la couleur d'accent */
.teinte-prelude { --ciel-haut: #8cbbe8; --ciel-bas: #e6f1fb; --accent: #2f6fb3; --relief-1: #5d7ea3; --relief-2: #87a3c2; --relief-3: #b7cbe0; }
.teinte-p1 { --ciel-haut: #f2b878; --ciel-bas: #fdeedd; --accent: #c4610f; --relief-1: #8a6a52; --relief-2: #b08c6e; --relief-3: #d6b99c; }
.teinte-p2 { --ciel-haut: #9aa9ec; --ciel-bas: #e9ecfc; --accent: #4256b8; --relief-1: #59628f; --relief-2: #8790bd; --relief-3: #b6bce0; }
.teinte-p3 { --ciel-haut: #86cdb9; --ciel-bas: #e3f5ef; --accent: #1f7a5c; --relief-1: #4c7465; --relief-2: #79a090; --relief-3: #a9c9bb; }
.teinte-p4 { --ciel-haut: #b8a3db; --ciel-bas: #f0eaf8; --accent: #7a3fa8; --relief-1: #5e5170; --relief-2: #8a7d9e; --relief-3: #b9afc9; }
.teinte-annexe { --ciel-haut: #b4c2d3; --ciel-bas: #eef2f6; --accent: #4b5f78; --relief-1: #5c6b7d; --relief-2: #8a98a9; --relief-3: #b9c3cf; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { --ciel-bas: var(--surface); filter: saturate(.85); }
  :root:not([data-theme="light"]) .hero::before { opacity: .55; }
}
:root[data-theme="dark"] .hero { --ciel-bas: var(--surface); }

/* Accent pour du texte : identique en clair, éclairci en sombre (sinon illisible sur fond noir).
   Déclaré sur chaque élément qui porte une teinte, pour suivre son --accent. */
:root, [class*="teinte-"] { --accent-texte: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), :root:not([data-theme="light"]) [class*="teinte-"] { --accent-texte: color-mix(in srgb, var(--accent) 50%, #ffffff); }
}
:root[data-theme="dark"], :root[data-theme="dark"] [class*="teinte-"] { --accent-texte: color-mix(in srgb, var(--accent) 50%, #ffffff); }

[hidden], .btn[hidden] { display: none !important; }

/* ------------------------------------------------------------ cadre */
.evitement { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 50; }
.evitement:focus { left: 8px; }
.barre-lecture { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; pointer-events: none; }
.barre-lecture span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* overflow-x: hidden (style.css) empêcherait le sommaire de rester collé : clip ne crée pas de zone de défilement */
body.livre { overflow-x: clip; }
.livre-cadre { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.livre main.livre-page { min-width: 0; max-width: none; margin: 0; padding: 0; }
.livre .site-header .inner, .livre .site-footer .inner { max-width: 1280px; }
@media (min-width: 1080px) {
  .livre-cadre { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 40px; padding: 0 24px; }
}

/* ------------------------------------------------------------ sommaire latéral */
.livre-cote { font-size: .9rem; }
.sommaire-bouton {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  border: 0; border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer;
}
.livre-nav { display: none; }
.livre-cote.ouvert .livre-nav {
  display: block; position: fixed; inset: 0 0 0 auto; width: min(340px, 88vw); z-index: 35;
  background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; padding: 16px 12px 80px;
  box-shadow: -8px 0 30px rgba(0,0,0,.2);
}
@media (min-width: 1080px) {
  .sommaire-bouton { display: none; }
  .livre-nav, .livre-cote.ouvert .livre-nav {
    display: block; position: sticky; inset: 0 auto auto auto; width: auto; box-shadow: none; border: 0;
    max-height: 100vh; overflow-y: auto; padding: 24px 4px 40px 0; background: transparent;
  }
}
.livre-nav ol { list-style: none; margin: 0; padding: 0; }
.livre-nav li { margin: 0; }
.livre-nav .groupe {
  margin: 18px 0 6px; padding: 0 10px; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.livre-nav a {
  display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35;
}
.livre-nav a:hover { background: var(--surface-2); }
.livre-nav li.actif > a { font-weight: 700; color: var(--accent-texte); background: var(--surface-2); }
.livre-nav .sections { margin: 4px 0 8px 12px; border-left: 2px solid var(--border); }
.livre-nav .sections a { font-size: .84rem; padding: 4px 10px; color: var(--muted); border-radius: 0 8px 8px 0; margin-left: -2px; border-left: 2px solid transparent; }
.livre-nav .sections a .n { display: inline-block; min-width: 2.4em; font-variant-numeric: tabular-nums; opacity: .8; }
.livre-nav .sections a.courant { color: var(--accent-texte); border-left-color: var(--accent); font-weight: 600; background: var(--surface-2); }
.livre-nav li[data-lu="1"] > a::after { content: " ✓"; color: var(--ok); font-weight: 700; }

/* ------------------------------------------------------------ bandeau */
.hero {
  position: relative; overflow: hidden; margin: 16px 0 8px; border-radius: 20px;
  background: linear-gradient(180deg, var(--ciel-haut), var(--ciel-bas) 78%);
  padding: 40px 28px 120px; isolation: isolate;
}
.hero::before { /* soleil diffus */
  content: ""; position: absolute; width: 340px; height: 340px; right: -60px; top: -120px; z-index: -1;
  background: radial-gradient(circle, rgba(255,255,255,.75), rgba(255,255,255,0) 65%);
}
.hero-relief { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; z-index: -1; }
.hero-relief .r1 { fill: var(--relief-1); }
.hero-relief .r2 { fill: var(--relief-2); }
.hero-relief .r3 { fill: var(--relief-3); }
.hero-texte { max-width: 44rem; color: #1b2430; }
.hero-sur { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-texte); }
.hero-num { margin: 0; font-weight: 600; opacity: .8; }
.hero h1 { margin: 4px 0 12px; font-size: clamp(1.8rem, 4.2vw, 2.7rem); line-height: 1.12; letter-spacing: -.01em; }
.hero-chapeau { font-family: var(--lecture); font-size: 1.15rem; line-height: 1.55; margin: 0 0 12px; }
.hero-meta { margin: 0; font-size: .88rem; font-weight: 600; opacity: .75; }
.hero-actions { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-texte { color: var(--text); }
  :root:not([data-theme="light"]) .hero { background: linear-gradient(180deg, color-mix(in srgb, var(--ciel-haut) 45%, #0f151d), var(--surface) 80%); }
}
:root[data-theme="dark"] .hero-texte { color: var(--text); }
:root[data-theme="dark"] .hero { background: linear-gradient(180deg, color-mix(in srgb, var(--ciel-haut) 45%, #0f151d), var(--surface) 80%); }

@media (max-width: 600px) {
  .hero { padding: 26px 18px 92px; border-radius: 16px; margin-top: 12px; }
  .hero-relief { height: 86px; }
  .hero-chapeau { font-size: 1.05rem; }
}

/* ------------------------------------------------------------ texte courant */
.texte { max-width: var(--mesure); margin: 0 auto; padding: 8px 0 24px; font-family: var(--lecture); font-size: 1.125rem; line-height: 1.68; }
.texte p { margin: 0 0 1em; hyphens: auto; -webkit-hyphens: auto; }
.texte strong { font-weight: 700; }
.texte h2 {
  font-family: var(--font); font-size: clamp(1.35rem, 2.6vw, 1.65rem); line-height: 1.25; margin: 2.6em 0 .7em;
  scroll-margin-top: 20px; position: relative;
}
.texte h2 .num {
  display: inline-block; margin-right: .55em; padding: .1em .5em; border-radius: 8px; font-size: .72em; vertical-align: .12em;
  background: var(--accent); color: #fff; font-variant-numeric: tabular-nums;
}
.texte h2 .ancre { margin-left: .4em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.texte h2:hover .ancre, .texte h2 .ancre:focus { opacity: 1; }
.texte h3 { font-family: var(--font); font-size: 1.15rem; margin: 1.8em 0 .5em; }
.texte ul, .texte ol { padding-left: 1.3em; margin: 0 0 1em; }
.texte li { margin: .3em 0; }
.texte a { color: var(--accent-texte); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.texte .v { white-space: nowrap; }

/* L'essentiel */
.essentiel {
  margin: 8px 0 2.2em; padding: 1.3em 1.4em .6em; border-radius: var(--rayon);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 6px 24px rgba(20,40,70,.08);
}
.essentiel .ess-titre {
  display: flex; align-items: center; gap: .55em; margin: 0 0 .7em; font-family: var(--font);
  font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-texte);
}
.ico { width: 1.4em; height: 1.4em; flex: none; }

/* Encadrés */
.encadre {
  --c: var(--c-memo); --f: var(--f-memo);
  margin: 1.6em 0; padding: 1em 1.2em .3em; border-radius: var(--rayon); background: var(--f);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); border-left: 5px solid var(--c);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
}
.encadre .titre { display: flex; align-items: center; gap: .5em; margin: 0 0 .5em; font-weight: 700; color: var(--c); }
.encadre.pourquoi { --c: var(--c-pourquoi); --f: var(--f-pourquoi); }
.encadre.piege { --c: var(--c-piege); --f: var(--f-piege); }
.encadre.rando { --c: var(--c-rando); --f: var(--f-rando); }
.encadre.vol { --c: var(--c-vol); --f: var(--f-vol); }
.encadre.retenir { --c: var(--c-retenir); --f: var(--f-retenir); }
.encadre.memo { --c: var(--c-memo); --f: var(--f-memo); padding-bottom: .8em; }

/* À vous */
.avous {
  margin: 1.8em 0; padding: 1em 1.2em; border-radius: var(--rayon); background: var(--f-avous);
  border: 2px dashed color-mix(in srgb, var(--c-avous) 55%, transparent); font-family: var(--font); font-size: 1rem;
}
.avous .avous-titre { display: flex; align-items: center; gap: .5em; margin: 0 0 .5em; font-weight: 700; color: var(--c-avous); }
details.reponse { margin-top: .6em; }
details.reponse summary {
  display: inline-flex; align-items: center; gap: .4em; cursor: pointer; list-style: none; user-select: none;
  padding: .45em .9em; border-radius: 999px; font-weight: 600; font-size: .92rem;
  background: var(--c-avous); color: #fff;
}
details.reponse summary::-webkit-details-marker { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) details.reponse summary { color: #1b1530; } }
:root[data-theme="dark"] details.reponse summary { color: #1b1530; }
details.reponse summary::before { content: "▸"; transition: transform .2s; }
details.reponse[open] summary::before { transform: rotate(90deg); }
details.reponse[open] summary { margin-bottom: .7em; }
details.reponse[open] { padding: 0 0 .2em; animation: deplie .25s ease-out; }
@keyframes deplie { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Étapes */
.etapes { margin: 1.6em 0; counter-reset: etape; font-family: var(--font); font-size: 1rem; }
.etape { position: relative; padding: .2em 0 .9em 2.4em; border-left: 2px solid var(--border); margin-left: .9em; }
.etape:last-child { border-left-color: transparent; }
.etape::before {
  counter-increment: etape; content: counter(etape); position: absolute; left: -1em; top: 0;
  width: 1.9em; height: 1.9em; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .9em;
}
.etape .quoi { font-weight: 700; margin: 0 0 .2em; }
.etape .comment { margin: 0; color: var(--text); }

/* Tableaux */
.defile { overflow-x: auto; margin: 1em 0; -webkit-overflow-scrolling: touch; }
.texte table { border-collapse: collapse; width: 100%; font-family: var(--font); font-size: .93rem; line-height: 1.45; }
.texte th, .texte td { text-align: left; vertical-align: top; padding: .5em .7em; border-bottom: 1px solid var(--border); }
.texte th { font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border-bottom-width: 2px; }
.texte tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.memo td:last-child { font-variant-numeric: tabular-nums; }

/* Lexique */
.texte dl { font-family: var(--font); font-size: 1rem; margin: 1em 0; }
.texte dt { font-weight: 700; margin-top: .9em; scroll-margin-top: 80px; }
.texte dd { margin: .2em 0 0; color: var(--text); }
.texte dt:target { color: var(--accent-texte); }
@media (min-width: 760px) {
  .texte dl.lexique { display: grid; grid-template-columns: minmax(10em, 32%) 1fr; gap: .2em 1.2em; }
  .texte dl.lexique dt { margin: 0; padding: .55em 0; border-top: 1px solid var(--border); }
  .texte dl.lexique dd { margin: 0; padding: .55em 0; border-top: 1px solid var(--border); }
}
a.terme { color: inherit; text-decoration: underline dotted color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 3px; cursor: help; }
.bulle {
  position: absolute; z-index: 45; max-width: min(360px, calc(100vw - 32px)); padding: .8em 1em; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-family: var(--font); font-size: .92rem; line-height: 1.5;
}
.bulle strong { display: block; margin-bottom: .25em; color: var(--accent-texte); }
.bulle a { font-size: .85rem; }

.fin {
  margin: 3em 0 1em; padding: 1em 1.2em; border-radius: var(--rayon); background: var(--surface-2);
  font-family: var(--font); font-size: .98rem;
}

/* ------------------------------------------------------------ figures */
.fig {
  margin: 2em 0; border-radius: var(--rayon); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 4px 18px rgba(20,40,70,.07);
}
@media (min-width: 1200px) { .fig { margin-left: -3.5rem; margin-right: -3.5rem; } }
.fig > img { display: block; width: 100%; height: auto; background: var(--fig-fond); cursor: zoom-in; }
.fig figcaption { padding: .8em 1.1em .9em; font-family: var(--font); font-size: .92rem; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--border); }
.fig figcaption b { color: var(--text); }
.fig .bascule {
  display: inline-flex; align-items: center; gap: .35em; margin: 0 0 .5em; padding: .3em .75em; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.fig.interactive > img { display: none; }
.fig.interactive.statique > img { display: block; }
.fig.interactive.statique > .illus { display: none; }
.fig .badge-anim {
  display: inline-block; margin-right: .5em; padding: .1em .55em; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--accent); color: #fff; vertical-align: .1em;
}

.visionneuse {
  position: fixed; inset: 0; z-index: 60; background: rgba(10,14,20,.88); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px; overflow: auto;
}
.visionneuse img { max-width: 100%; max-height: calc(100vh - 90px); background: #fff; border-radius: 10px; cursor: zoom-out; }
.visionneuse.grand { justify-content: flex-start; align-items: flex-start; }
.visionneuse.grand img { max-width: none; max-height: none; width: 200%; }
.visionneuse .outils { position: fixed; top: 12px; right: 12px; display: flex; gap: 8px; }
.visionneuse button { border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; background: #fff; color: #1b2430; cursor: pointer; }
.visionneuse p { color: #e6ebf1; max-width: 60rem; font-size: .92rem; margin: 10px 0 0; }

/* ------------------------------------------------------------ illustrations animées (illus/illus.js) */
.illus { background: var(--surface); }
.illus-scene { background: #e9f1f9; line-height: 0; }
.illus-scene svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.illus-texte {
  min-height: 4.6em; padding: .85em 1.1em; font-family: var(--font); font-size: .98rem; line-height: 1.55;
  border-top: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.illus-texte strong { color: var(--accent-texte); }
.illus-texte p { margin: 0 0 .4em; }
.illus-texte p:last-child { margin-bottom: 0; }
.illus-commandes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: .9em 1.1em 1em; border-top: 1px solid var(--border); font-family: var(--font); }
.illus-curseur { flex: 1 1 220px; min-width: 0; }
.illus-curseur label { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.illus-curseur output { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.illus-curseur input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; }
.illus-aide { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.illus-choix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.illus-choix-libelle { width: 100%; font-size: .86rem; font-weight: 600; color: var(--muted); }
.illus-choix button, .illus-bouton {
  font: inherit; font-size: .88rem; font-weight: 600; padding: .45em .9em; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); min-height: 36px;
}
.illus-choix button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.illus-bouton.illus-lecture { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 7.5em; }
.illus-bouton:hover, .illus-choix button:hover { border-color: var(--accent); }
/* au doigt : boutons de 44 px, curseur plus facile à saisir */
@media (pointer: coarse) {
  .illus-choix button, .illus-bouton { min-height: 44px; }
  .recit-points button { width: 44px; height: 44px; }
  .illus-curseur input[type=range] { height: 36px; }
}
/* téléphone : commandes serrées, pour que scène et commandes tiennent ensemble dans l'écran */
@media (max-width: 600px) {
  .illus-commandes { gap: 8px 14px; padding: .55em .85em .7em; }
  .illus-curseur label { margin-bottom: 0; }
  .illus-aide { margin-top: 0; }
  .illus-texte { padding: .75em .9em; }
}
/* boutons flottants masqués quand une animation passe dessous (classe illus-dessous posée par illus.js) */
@media (max-width: 1079px) {
  .sommaire-bouton, .pm-assistant-bouton { transition: opacity .2s, visibility .2s; }
  .illus-dessous .livre-cote:not(.ouvert) .sommaire-bouton, .illus-dessous .pm-assistant-bouton { opacity: 0; visibility: hidden; }
}

/* ------------------------------------------------------------ récits animés (Illus ctx.recit) */
@media (min-width: 1280px) { .fig.recit { margin-left: -9rem; margin-right: -9rem; } }
.fig.recit .illus-texte { min-height: 10.5em; }
.illus-texte .recit-etape { font-weight: 700; font-size: 1.05rem; margin-bottom: .35em; }
.illus-texte .recit-etape span {
  display: inline-block; margin-right: .6em; padding: .1em .55em; border-radius: 999px; font-size: .74rem;
  letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: #fff; vertical-align: .12em;
}
.illus-texte .recit-lien { margin-top: .5em; font-size: .92rem; }
.illus-texte .recit-lien a, .illus-texte a { color: var(--accent-texte); font-weight: 600; }
.recit-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; width: 100%; }
.recit-points { display: flex; flex-wrap: wrap; gap: 6px; }
.recit-points button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; padding: 0;
}
.recit-points button.vu { border-color: var(--accent); }
.recit-points button[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.recit-nav .illus-bouton[disabled] { opacity: .45; cursor: default; }
.recit-lire { margin-left: auto; }
@media (max-width: 600px) {
  .recit-points { display: none; }          /* sur téléphone : ◀ Précédent · Suivant ▶ · Lecture ; l'étape est écrite dans le texte */
  .recit-prec::after { content: " Précédent"; }
}
.fig .revoir {
  display: inline-flex; align-items: center; gap: .35em; margin: .55em 0 0; padding: .35em .85em; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-texte); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; text-decoration: none;
}

/* ------------------------------------------------------------ fin de chapitre */
.fin-chapitre { max-width: var(--mesure); margin: 0 auto 48px; }
.fin-quiz {
  padding: 1.4em 1.5em; border-radius: var(--rayon); margin: 0 0 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}
.fin-quiz p { margin: 0 0 .8em; }
.fin-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-texte); }
/* L'aperçu d'une page réservée (livre_web.py, apercu()) : l'invitation et le sommaire des sections */
.apercu-suite { margin: 0 0 2.2em; font-family: var(--font); }
.texte .apercu-suite .btn { color: var(--primary-ink); text-decoration: none; }   /* et non la couleur des liens du texte */
.apercu-sommaire { list-style: none; margin: 0 0 1em; padding: 0; columns: 2 18rem; column-gap: 2em; }
.apercu-sommaire li { break-inside: avoid; margin: 0 0 .35em; padding-left: 2.6em; text-indent: -2.6em; line-height: 1.4; }
.apercu-sommaire .n { display: inline-block; width: 2.6em; text-indent: 0; font-weight: 700; color: var(--muted); }
.voisins { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.voisin {
  display: block; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.35;
}
.voisin span { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.voisin.suiv { text-align: right; grid-column: 2; }
.voisin:hover { border-color: var(--accent); }

/* ------------------------------------------------------------ accueil du livre */
.livre-accueil main { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.hero-accueil { padding-bottom: 130px; display: grid; gap: 24px; }
.hero-couverture { display: none; }
@media (min-width: 860px) {
  .hero-accueil { grid-template-columns: 1fr 200px; align-items: start; padding: 48px 40px 140px; }
  .hero-couverture { display: block; width: 200px; height: auto; border-radius: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.3); transform: rotate(2deg); }
}
.partie { margin: 40px 0 0; }
.partie h2 { font-size: 1.5rem; margin: 0 0 4px; }
.partie h2 span { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-texte); }
.partie-accroche { margin: 0 0 14px; color: var(--muted); }
.cartes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.carte-chap {
  position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 18px 22px; border-radius: 16px;
  text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.carte-chap::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--ciel-haut), var(--accent)); }
.carte-chap:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20,40,70,.12); }
.cc-image { display: block; margin: -18px -18px 8px; height: 150px; background: #fff; border-bottom: 1px solid var(--border); overflow: hidden; }
.cc-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; transition: transform .4s ease; }
.carte-chap:hover .cc-image img { transform: scale(1.04); }
.cc-image-vide { background: linear-gradient(180deg, var(--ciel-haut), var(--ciel-bas)); }
.carte-chap::before { z-index: 1; }
.cc-num { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-texte); }
.cc-titre { font-weight: 700; font-size: 1.08rem; line-height: 1.3; }
.cc-chapeau { font-family: var(--lecture); font-size: .95rem; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta { margin-top: auto; font-size: .8rem; font-weight: 600; color: var(--muted); }
.cc-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: transparent; }
.cc-prog i { display: block; height: 100%; width: 0; background: var(--accent); }
.liste-annexes { columns: 2 280px; padding-left: 1.2em; }
.liste-annexes li { margin: .3em 0; }

/* ------------------------------------------------------------ apparition douce */
.anim .apparait { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.anim .apparait.vu { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .anim .apparait { opacity: 1; transform: none; transition: none; }
  .carte-chap, details.reponse[open] { transition: none; animation: none; }
}

@media print {
  .site-header, .livre-cote, .barre-lecture, .fin-chapitre, .site-footer, .hero-relief { display: none !important; }
  .livre-cadre { display: block; }
  .hero { background: none; padding: 0; }
  .fig { break-inside: avoid; box-shadow: none; }
}

/* ------------------------------------------------------------ avant-propos : « Vous avez une liseuse ? » (livre.js) */
.bandeau-liseuse {
  margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(20, 40, 70, .06); font-family: var(--font);
}
.bl-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.bl-question p { margin: 0 auto 0 0; font-weight: 700; font-size: 1.02rem; }
.bl-question .btn { min-width: 4.5em; justify-content: center; }
.bl-question .btn[aria-expanded="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.bl-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .97rem; line-height: 1.55; }
.bl-section h2 { margin: 0 0 .4em; font-size: 1.12rem; }
.bl-section h2:focus { outline: none; }
.bl-section h3 { margin: 1em 0 .3em; font-size: 1rem; }
.bl-section p { margin: 0; }
.bl-section ul { margin: 0; padding-left: 1.2em; }
.bl-section li { margin: .3em 0; }
.bl-section .bl-fin { margin-top: 12px; }
