/* Thème etagere : page de livre (article), pages simples, citations. Chargé avec shelf.css (matières des dos). */

:root {
  --page: #fbf7ec; --page-ink: #2a2119; --page-dim: #6e6253; --page-link: #7d2a20; --page-line: rgba(70, 50, 30, .18);
  --code-bg: #f2eadb; --c-com: #7a6f5f; --c-key: #8c2f22; --c-str: #4f6b2e; --c-num: #93560f; --c-fn: #2c4a6e; --c-type: #6b4025; --c-attr: #2c405f;
}
/* Soir : page sombre et chaude, encre claire, pour lire sans éblouir. */
html.dark {
  --page: #3a2f24; --page-ink: #eee3cc; --page-dim: #c3b293; --page-link: #f0c27a; --page-line: rgba(240, 220, 180, .16);
  --code-bg: #2b231b; --c-com: #a19479; --c-key: #ec9a7d; --c-str: #bccb8f; --c-num: #e8bb78; --c-fn: #a9c1df; --c-type: #ddb88f; --c-attr: #a9c1df;
}

/* Teinte de la reliure par matière (les livres du rayon varient autour de ces teintes). */
:is(.sheet, .spn).m-leather { --c: #5c201b; }
:is(.sheet, .spn).m-cloth { --c: #2c405f; --s1: #b5832c; --s2: #505b34; }
:is(.sheet, .spn).m-board { --c: #56635a; }
:is(.sheet, .spn).m-kraft { --c: #b38e5e; }

/* Mise en page : feuille au centre, table des matières en marge droite sur écran large. */
.folio { display: grid; grid-template-columns: 1fr minmax(0, 86rem) 1fr; column-gap: 3.2rem; padding: 2.4rem 2.4rem 4rem; }
.folio > * { grid-column: 2; }

/* Feuille de papier ; avec une matière, la reliure dépasse en liseré sur le bord gauche (côté dos). */
.sheet { position: relative; border-radius: 3px; box-shadow: 0 1px 2px rgba(30, 18, 8, .18), 0 2.4rem 4rem -2rem rgba(30, 18, 8, .45); }
.sheet[class*="m-"] { padding-left: .8rem; background: var(--fine), var(--c); }
.sheet.m-cloth { background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 2px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 2px), var(--c); }
.sheet.m-kraft { background: var(--fiber), var(--c); }
html.dark .sheet { box-shadow: 0 0 0 1px rgba(255, 220, 170, .06), 0 2.4rem 4rem -1.6rem rgba(0, 0, 0, .8); }
.leaf { padding: 7.8rem 8rem 4.8rem; border-radius: 2px; color: var(--page-ink); background: var(--paper), var(--page); box-shadow: inset 0 0 0 1px rgba(60, 40, 20, .08); }
html.dark .leaf { background: var(--page); }

/* Bande épinglée (article) : titre, rayon et section en cours restent en haut de la page quand le grand titre sort de l'écran (js/post.js).
   Hauteur nulle dans le flux ; la bande pend sous elle. --stick : haut de la zone qui défile (en-tête collant en mobile).
   Hauteur de la bande constante : la ligne de section (.pin-s) s'ouvre dans la bande, le contenu reste centré. */
:root { --pin-h: 6.4rem; --stick: 0px; }
/* sticky compte depuis la boîte de contenu de main, sous son padding-top (2.4rem) : on le retire. */
.pin { position: sticky; top: calc(var(--stick) - 2.4rem); z-index: 2; height: 0; }
.pin > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-content: center; column-gap: 2.4rem; height: var(--pin-h); padding: 0 2.4rem 0 1.6rem; color: var(--page-ink); background: var(--paper), var(--page); border-bottom: 1px solid var(--page-line); box-shadow: 0 1rem 1.2rem -1.2rem rgba(30, 18, 8, .4);
  opacity: 0; visibility: hidden; translate: 0 -.6rem; transition: opacity .2s ease, translate .2s ease, visibility 0s linear .2s; }
html.dark .pin > div { background: var(--page); }
.pin.on > div { opacity: 1; visibility: visible; translate: 0; transition: opacity .2s ease, translate .2s ease; }
.pin-t, .pin-m, .pin-s { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pin-t { font-size: 1.8rem; line-height: 1.4; font-weight: 600; }
.pin-t { grid-row: 1; grid-column: 2; }
.pin-m { grid-row: 1; grid-column: 3; align-self: center; font: 1.25rem/1.5 'Courier Prime', 'Courier New', monospace; color: var(--page-dim); }
.pin-m:empty { display: none; }
/* Section en cours : même filet que dans le sommaire. Fermée (hauteur nulle) avant la première section. */
.pin-s { grid-column: 2 / -1; height: 0; opacity: 0; padding-left: .8rem; border-left: 2px solid var(--focus); font: 1.3rem/2rem 'Courier Prime', 'Courier New', monospace; transition: height .25s ease, opacity .25s ease; }
.pin.sec .pin-s { height: 2rem; opacity: 1; }
/* Retour dans la bande : étiquette kraft (dessin du signet) au bout d'un bout de ruban à la teinte de la reliure, qui descend du haut de la bande. */
.pin-back { position: relative; grid-row: 1 / span 2; grid-column: 1; align-self: center; display: block; text-decoration: none; color: #3a2b1c; }
.pin-back .mtag { margin-top: 0; height: 2.2rem; font-size: 1.1rem; }
.pin-back::before { content: ''; position: absolute; left: .9rem; bottom: 100%; width: 1rem; height: 6rem; background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .2) 35%, rgba(0, 0, 0, .32)), var(--c); }
.pin-back:hover .mname { text-decoration: underline; text-underline-offset: 2px; }
.pin-back:focus-visible { outline: none; }
.pin-back:focus-visible .mtag { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Choix de la vue dans la bande : compact, à droite (écran large seulement, comme le commutateur du haut). */
.pin .pin-views { position: static; grid-row: 1; grid-column: 4; align-self: center; gap: .8rem; }
.pin .pin-views button { font-size: 1.1rem; }
/* Cibles des liens internes : sous la bande épinglée ; « Top » ramène main (ou la page) tout en haut. */
.prose [id] { scroll-margin-top: calc(var(--stick) + var(--pin-h) + 2.4rem); }
#top { scroll-margin-top: calc(var(--stick) + 2.4rem); }

/* En-tête de la page. */
.opening { margin-bottom: 4rem; }
.kicker, .dateline { font: 1.35rem/1.5 'Courier Prime', 'Courier New', monospace; color: var(--page-dim); }
.kicker a { color: var(--page-ink); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.kicker a:hover { text-decoration: underline; text-underline-offset: 3px; }
.opening .dot { margin: 0 .6em; }
.opening h1 { margin: 1.2rem 0 1.4rem; font-size: 4rem; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; }

/* Corps du texte : environ 66 caractères par ligne. */
.prose { max-width: 66ch; font-size: 1.9rem; line-height: 1.7; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.4em; }
.prose :is(h1, h2, h3, h4) { line-height: 1.25; font-weight: 600; margin-top: 2em; }
.prose :is(h1, h2) { font-size: 2.6rem; }
.prose h3 { font-size: 2.15rem; }
.prose h4 { font-size: 1.9rem; font-style: italic; }
.prose :is(h1, h2, h3, h4) + * { margin-top: .7em; }
.prose a, .leaf .prose a { color: var(--page-link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose :is(ul, ol) { padding-left: 1.4em; }
.prose li + li, .prose li > :is(ul, ol) { margin-top: .4em; }
.prose blockquote { padding-left: 1.4em; border-left: 3px solid var(--page-line); font-style: italic; color: var(--page-dim); }
.prose hr { width: 8rem; margin: 3em auto; border: 0; border-top: 1px solid var(--page-line); }
.prose :not(pre) > code { padding: .1em .35em; border-radius: 3px; font: .86em 'Courier Prime', 'Courier New', monospace; background: var(--code-bg); }
.prose > table { width: 100%; border-collapse: collapse; font-size: .9em; }
.prose > table :is(th, td) { padding: .4em .7em; border-bottom: 1px solid var(--page-line); text-align: left; }
.prose :is(video, iframe) { display: block; max-width: 100%; margin-inline: auto; }
.prose sup { line-height: 0; }

/* Images : centrées, petit cadre papier, légende tirée du titre. */
.plate { display: block; width: fit-content; max-width: 100%; margin: 2.4em auto; padding: .6rem; background: #fffefa; box-shadow: 0 0 0 1px rgba(60, 40, 20, .14), 0 .2rem .6rem rgba(30, 18, 8, .18); }
.plate img { display: block; max-width: 100%; height: auto; }
html.dark .plate { background: #efe5cf; }
html.dark .plate img { filter: brightness(.92); }
.caption { display: block; padding: .6rem .2rem 0; text-align: center; font: 1.3rem/1.4 'Courier Prime', 'Courier New', monospace; color: #6e6253; }

/* Blocs de code highlight.js (hljs: false, line_number: true) : tableau gouttière + code. */
.prose figure.highlight { margin: 2em 0; overflow-x: auto; border-radius: 3px; background: var(--code-bg); box-shadow: inset 0 0 0 1px var(--page-line); font: 1.45rem/1.6 'Courier Prime', 'Courier New', monospace; }
figure.highlight table { border-collapse: collapse; }
figure.highlight td { padding: 1.2rem 0; vertical-align: top; }
figure.highlight pre { font: inherit; }
figure.highlight .gutter { padding: 1.2rem 1rem; text-align: right; color: var(--c-com); border-right: 1px solid var(--page-line); user-select: none; }
figure.highlight .code { width: 100%; padding: 1.2rem 1.6rem; }
figure.highlight .meta { font: inherit; color: var(--c-com); }
figure.highlight :is(.comment, .quote) { color: var(--c-com); font-style: italic; }
figure.highlight :is(.keyword, .selector-tag, .section, .bullet) { color: var(--c-key); }
figure.highlight :is(.string, .regexp, .addition) { color: var(--c-str); }
figure.highlight :is(.number, .literal, .symbol) { color: var(--c-num); }
figure.highlight :is(.title, .function, .name) { color: var(--c-fn); }
figure.highlight :is(.built_in, .type, .params) { color: var(--c-type); }
figure.highlight :is(.attr, .attribute, .variable, .template-variable) { color: var(--c-attr); }
figure.highlight .deletion { color: var(--c-key); }
figure.highlight .section { font-weight: 700; }

/* Table des matières : en marge (écran large) ou repliable (sinon). */
.contents ol { list-style: none; }
.contents ol ol { padding-left: 1.2em; }
.contents a { text-decoration: none; }
.contents a:hover { text-decoration: underline; text-underline-offset: 3px; }
.contents.side { display: none; grid-column: 3; grid-row: 1; align-self: start; position: sticky; top: 3.2rem; max-width: 24rem; max-height: calc(100dvh - var(--head-h) - var(--foot-h) - 6.4rem); overflow-y: auto; padding-top: 6.4rem; font-size: 1.45rem; line-height: 1.35; color: var(--dim); }
.contents.side p { margin-bottom: 1rem; font: 700 1.2rem/1 'Courier Prime', 'Courier New', monospace; letter-spacing: .12em; text-transform: uppercase; }
.contents.side li { margin-top: .7rem; }
.contents.side a:hover, .contents.side a[aria-current] { color: var(--ink); }
/* Section en cours : filet à gauche (dans la boîte, car .contents.side coupe ce qui déborde). */
.contents.side a { display: block; padding-left: 1rem; border-left: 2px solid transparent; }
.contents.side p { padding-left: 1.2rem; }
.contents.side a[aria-current] { border-left-color: var(--focus); }
.contents.fold { max-width: 66ch; margin-bottom: 3.2rem; padding: 1rem 1.4rem; border: 1px solid var(--page-line); border-radius: 3px; font-size: 1.6rem; }
.contents.fold summary { cursor: pointer; font: 700 1.25rem/1.6 'Courier Prime', 'Courier New', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--page-dim); }
.contents.fold > ol { margin-top: .8rem; }
.contents.fold li { margin-top: .4rem; }
@media (min-width: 1280px) {
  .contents.side { display: block; }
  .contents.fold { display: none; }
}

/* Fin d'article. */
.colophon { max-width: 66ch; margin-top: 5.6rem; padding-top: 2.4rem; border-top: 1px solid var(--page-line); display: grid; gap: 2.8rem; }
.hint { display: block; margin-bottom: .6rem; font: 1.2rem/1.2 'Courier Prime', 'Courier New', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--page-dim); }
.volumes, .neighbours { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.volumes .next, .neighbours .next { margin-left: auto; text-align: right; }
.neighbours a { max-width: 28rem; text-decoration: none; font-size: 1.7rem; line-height: 1.3; }
.neighbours a:hover { text-decoration: underline; text-underline-offset: 3px; }
.exits { display: flex; justify-content: space-between; font: 1.35rem/1.5 'Courier Prime', 'Courier New', monospace; }
.exits a { color: var(--page-dim); text-underline-offset: 3px; }
.exits a:hover { color: var(--page-ink); }

/* Petit dos de livre couché, dans la matière du rayon (styles .spine de shelf.css). */
.spn { --w: 34; --mh: 34; position: relative; display: block; width: 26rem; max-width: 100%; height: 3.4rem; text-decoration: none; box-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 .4rem .8rem -.2rem rgba(0, 0, 0, .4); transition: transform .2s ease; }
.spn .vol b { transform: none; }
.spn .t { text-align: left; }
a.spn:hover { transform: translateY(-2px); }
a.spn:focus-visible { outline-offset: 3px; }

/* Étiquettes kraft : tags. */
.labels { list-style: none; display: flex; flex-wrap: wrap; gap: .8rem 1rem; }
.label { display: inline-flex; align-items: center; gap: .6rem; height: 2.4rem; padding: 0 1rem 0 2rem; text-decoration: none; font: 700 1.25rem/1 'Courier Prime', 'Courier New', monospace; letter-spacing: .04em; color: #3a2b1c;
  background: radial-gradient(circle at .9rem 50%, #3b2a18 0 .2rem, #f3e6c6 .22rem .38rem, transparent .4rem), linear-gradient(180deg, rgba(255, 250, 235, .3), transparent 40%, rgba(80, 55, 25, .12)), var(--paper), #e2cfa5;
  clip-path: polygon(.7rem 0, 100% 0, 100% 100%, .7rem 100%, 0 calc(100% - .7rem), 0 .7rem); }
.label:hover { background-color: #ead9b2; text-decoration: underline; text-underline-offset: 2px; }
.label .count { font-weight: 400; color: #6e5a40; }

/* Liste des rayons. */
.shelf-list { list-style: none; display: grid; gap: 1.8rem; max-width: 66ch; }
.shelf-list li { display: grid; grid-template-columns: 12rem 1fr auto; align-items: center; gap: 2rem; font-size: 2rem; }
.shelf-list .spn { width: 12rem; height: 2.8rem; }
.shelf-list a { color: var(--page-ink); text-underline-offset: 3px; }
.shelf-list .count { font: 1.35rem 'Courier Prime', 'Courier New', monospace; color: var(--page-dim); }

/* Citation dans un article (balise cq). La page /quotes/ a son propre style (quotes.css). */
.cq { text-align: center; }
.cq blockquote { font-size: 2rem; line-height: 1.55; }
.cq blockquote > * + * { margin-top: 1em; }
.cq figcaption { margin-top: 1.4rem; font: 1.35rem 'Courier Prime', 'Courier New', monospace; color: var(--page-dim); }
.prose .cq { margin: 2.4em auto; max-width: 52ch; }

/* Signet de retour : ruban de soie à la teinte de la reliure (--c), pendu au bord haut de la feuille ; étiquette kraft nouée au bout,
   au nom du rayon (ou « Blog »). Vue Scroll et mobile : étiquette horizontale dans la marge haute. Vue Book : étiquette debout dans la marge extérieure. */
.mark { position: absolute; z-index: 3; left: 2.6rem; top: -.4rem; display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; color: #3a2b1c; transition: transform .25s ease; }
.mark:hover, .mark:focus-visible { transform: translateY(.6rem); }
.mark:focus-visible { outline: none; }
.mark:focus-visible .mtag { outline: 2px solid var(--focus); outline-offset: 2px; }
.silk { position: relative; width: 1.4rem; height: 3.2rem; margin-left: .2rem; border-radius: 1px 1px 0 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .2) 35%, rgba(255, 255, 255, .06) 55%, rgba(0, 0, 0, .32)), var(--c);
  box-shadow: 1px 2px 3px rgba(20, 12, 4, .35); }
/* Nœud de raphia au bout du ruban, fil jusqu'à l'œillet de l'étiquette. */
.silk::after { content: ''; position: absolute; left: 50%; top: 100%; width: .3rem; height: .9rem; translate: -50% -.3rem; border-radius: .2rem; background: linear-gradient(90deg, #b9a06a, #e8d9ac 50%, #a88c55); box-shadow: 0 1px 1px rgba(30, 18, 6, .35); }
.mtag { display: flex; align-items: center; gap: .5rem; height: 2.4rem; margin-top: .4rem; padding: 0 1rem 0 2.4rem; white-space: nowrap; font: 700 1.2rem/1 'Courier Prime', 'Courier New', monospace; letter-spacing: .14em; text-transform: uppercase;
  background: radial-gradient(circle at 1.1rem 50%, #3b2a18 0 .22rem, #f3e6c6 .24rem .42rem, transparent .44rem), linear-gradient(180deg, rgba(255, 250, 235, .3), transparent 40%, rgba(80, 55, 25, .12)), var(--paper), #e2cfa5;
  clip-path: polygon(.8rem 0, 100% 0, 100% 100%, .8rem 100%, 0 calc(100% - .8rem), 0 .8rem); }
.mark:hover .mname { text-decoration: underline; text-underline-offset: 2px; }
/* Choix de la vue : deux mots discrets au-dessus du coin haut droit de la feuille (ou du livre). Écran large et JS seulement. */
.views { display: none; position: absolute; z-index: 3; right: 0; bottom: calc(100% + .4rem); gap: 1.2rem; }
.views button { border: 0; padding: 0; background: none; cursor: pointer; font: 1.2rem/1.6 'Courier Prime', 'Courier New', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.views button:hover { color: var(--ink); }
.views button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media screen and (min-width: 1024px) and (min-height: 640px) { html.js .views { display: flex; } }
/* Pièces du livre ouvert : absentes de la vue Scroll. */
.bookwork, .sweep, .tabs, .tabtip { display: none; }

/* ------------------------------------------------------------------------------------------------
   Vue Book (écran large, html.book posé par post.ejs) : l'article est un livre ouvert, vu de face, entre l'en-tête et le plancher.
   .leaf est la zone qui défile : colonnes CSS (une colonne = une page), deux par vue, défilement horizontal par double page.
   Pas de transform pour paginer : la recherche du navigateur, les ancres et le focus amènent d'eux-mêmes à la bonne page (js/post.js).
   Mesures (toutes en px, depuis la taille de l'écran) :
     --fs taille du texte ; --cw largeur d'une colonne (environ 55 à 65 caractères) ; --g gouttière (deux marges intérieures) ;
     --om marge extérieure ; --tm, --bm marges de tête et de pied ; --cb débord de la couverture ; --ed tranche des pages de chaque côté ;
     --bh hauteur du livre ; --th hauteur du texte d'une page. */
@media screen and (min-width: 1024px) and (min-height: 640px) {
  html.book {
    --fs: clamp(14.5px, min(1.2vw, 2.3vh), 20px);
    --g: calc(var(--fs) * 2.2); --om: calc(var(--fs) * 2.8); --tm: calc(var(--fs) * 3.4); --bm: calc(var(--fs) * 3.2);
    --cb: 7px; --ed: 10px; --wp: 22px;
    --bh: calc(100dvh - var(--head-h) - var(--foot-h) - 2 * var(--wp));
    --cw: min(calc(var(--fs) * 28), calc(50vw - 32px - var(--cb) - var(--ed) - var(--om) - var(--g) / 2));
    --th: calc(var(--bh) - 2 * var(--cb) - var(--tm) - var(--bm));
  }
  html.book body > main.folio { display: flex; align-items: center; justify-content: center; padding: var(--wp) 0; overflow: hidden; }
  html.book .pin, html.book .contents, html.book .exits { display: none; }
  /* Couverture : la reliure dépasse autour des pages ; la tranche des pages est dans son rembourrage latéral. */
  html.book .sheet, html.book .sheet[class*="m-"] { position: relative; z-index: 0; flex: none; width: calc(2 * (var(--cw) + var(--om) + var(--g) / 2 + var(--ed) + var(--cb))); height: var(--bh);
    padding: var(--cb) calc(var(--cb) + var(--ed)); border-radius: 5px; }
  /* Papier des deux pages : pli central (ombre douce de la reliure), pages un peu bombées vers les bords. */
  html.book .bookwork { display: block; position: absolute; z-index: 0; inset: var(--cb) calc(var(--cb) + var(--ed)); pointer-events: none; border-radius: 2px; color: var(--page-dim);
    background:
      linear-gradient(90deg, rgba(60, 40, 20, .1), transparent 3%, transparent 46%, rgba(60, 40, 20, .1) 48.6%, rgba(40, 25, 10, .32) 50%, rgba(60, 40, 20, .1) 51.4%, transparent 54%, transparent 97%, rgba(60, 40, 20, .1)),
      var(--paper), var(--page);
    box-shadow: inset 0 0 0 1px rgba(60, 40, 20, .1); }
  html.dark.book .bookwork { background:
      linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 3%, transparent 46%, rgba(0, 0, 0, .16) 48.6%, rgba(0, 0, 0, .45) 50%, rgba(0, 0, 0, .16) 51.4%, transparent 54%, transparent 97%, rgba(0, 0, 0, .18)),
      var(--page); }
  /* Tranches : feuillets déjà lus à gauche, à lire à droite. --done (0 à 1, posé sur .bookwork par js/post.js : seul ce sous-arbre est recalculé) règle leur épaisseur, sans relayout. */
  html.book .edge { position: absolute; top: 2px; bottom: 2px; width: var(--ed); transition: transform .3s ease;
    background: linear-gradient(180deg, rgba(60, 40, 20, .25), transparent 3%, transparent 97%, rgba(60, 40, 20, .25)), repeating-linear-gradient(90deg, #f4ecda 0 1px, #cdbd9c 1px 2px); }
  html.dark.book .edge { background: linear-gradient(180deg, rgba(0, 0, 0, .3), transparent 3%, transparent 97%, rgba(0, 0, 0, .3)), repeating-linear-gradient(90deg, #d9c9a8 0 1px, #8f7c5e 1px 2px); }
  html.book .edge.l { right: 100%; transform-origin: 100% 50%; transform: scaleX(calc(.2 + .8 * var(--done, 0))); border-radius: 2px 0 0 2px; }
  html.book .edge.r { left: 100%; transform-origin: 0 50%; transform: scaleX(calc(1 - .8 * var(--done, 0))); border-radius: 0 2px 2px 0; }
  /* En-têtes courants (titre à gauche, section à droite) et folios : petites capitales Courier Prime, discrets. */
  html.book :is(.rh, .fo) { position: absolute; font-family: 'Courier Prime', 'Courier New', monospace; font-variant-caps: all-small-caps; letter-spacing: .1em; white-space: nowrap; }
  html.book .rh { top: calc(var(--tm) * .36); width: var(--cw); overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: calc(var(--fs) * .92); line-height: 1.4; }
  html.book .rh.l { left: var(--om); }
  html.book .rh.r { right: var(--om); }
  html.book .sheet[data-at="0"] .rh.l { visibility: hidden; }
  html.book .fo { bottom: calc(var(--bm) * .34); font-size: calc(var(--fs) * .92); line-height: 1.4; }
  html.book .fo.l { left: var(--om); }
  html.book .fo.r { right: var(--om); }
  html.book .fo.n { left: 50%; translate: -50% 0; font-size: calc(var(--fs) * .78); opacity: .75; }
  /* Marges extérieures : un clic tourne la page. */
  html.book .turn { position: absolute; top: 0; bottom: 0; width: var(--om); pointer-events: auto; }
  html.book .turn.p { left: 0; cursor: w-resize; }
  html.book .turn.n { right: 0; cursor: e-resize; }
  html.book .turn.off { cursor: default; }
  /* Texte : deux colonnes visibles, les suivantes à droite (défilement horizontal, barre masquée, arrêt par double page). */
  html.book .leaf { position: relative; z-index: 1; height: 100%; margin: 0 var(--om); padding: var(--tm) 0 var(--bm); border-radius: 0; background: none; box-shadow: none;
    columns: 2; column-gap: var(--g); column-fill: auto; overflow: auto hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none;
    font-size: var(--fs); line-height: 1.6; }
  html.book .leaf::-webkit-scrollbar { display: none; }
  /* Repères d'arrêt (un par double page, js/post.js) : ils portent aussi la largeur défilable jusqu'à la dernière double page. */
  html.book .snaps { position: absolute; left: 0; top: 0; height: 1px; display: flex; pointer-events: none; }
  html.book .snaps i { flex: none; width: var(--w); margin-right: var(--g); scroll-snap-align: start; scroll-snap-stop: always; }
  html.book .snaps i:last-child { margin-right: 0; }
  /* Contenu dans la page : rien de coupé entre deux pages, titres jamais seuls en bas de page. */
  html.book .opening { margin-bottom: 2.2em; }
  html.book .kicker, html.book .dateline { font-size: .78em; }
  html.book .opening h1 { margin: .5em 0 .6em; font-size: 2.1em; line-height: 1.12; }
  html.book .prose { max-width: none; font-size: 1em; line-height: 1.6; }
  html.book .prose > * + * { margin-top: 1em; }
  html.book .prose :is(h1, h2, h3, h4) { margin-top: 1.6em; break-after: avoid; break-inside: avoid; }
  html.book .prose :is(h1, h2) { font-size: 1.36em; }
  html.book .prose h3 { font-size: 1.14em; }
  html.book .prose h4 { font-size: 1em; }
  html.book .prose :is(h1, h2, h3, h4) + * { margin-top: .5em; }
  html.book .prose :is(.plate, figure, pre, table, blockquote, .cq, video, iframe, li) { break-inside: avoid; }
  html.book .plate { margin: 1.4em auto; }
  html.book .plate img { width: auto; max-height: calc(var(--th) - 4.4em); }
  html.book .caption { font-size: .72em; }
  html.book .prose figure.highlight { margin: 1.2em 0; max-height: var(--th); overflow: auto; font-size: .8em; }
  html.book .prose > table { display: block; max-width: 100%; max-height: var(--th); overflow: auto; }
  html.book .prose :is(video, iframe) { width: 100%; height: auto; max-height: var(--th); }
  html.book .prose iframe { aspect-ratio: 16 / 9; }
  html.book .prose .cq { margin: 1.6em auto; }
  html.book .cq blockquote { font-size: 1.05em; }
  /* Fin du livre : tags et navigation en haut d'une page. */
  html.book .colophon { max-width: none; margin-top: 0; padding-top: 1.2em; gap: 1.6em; break-before: column; }
  html.book .volumes, html.book .neighbours { flex-direction: column; }
  html.book .volumes .next, html.book .neighbours .next { margin-left: 0; text-align: left; }
  html.book .spn { width: 100%; }
  /* Effet de page : une ombre douce balaie le papier (transform et opacity, js/post.js). */
  html.book .sweep { display: block; position: absolute; z-index: 2; inset: var(--cb) calc(var(--cb) + var(--ed)); overflow: hidden; pointer-events: none; }
  html.book .sweep i { position: absolute; top: 0; bottom: 0; left: 0; width: 34%; opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(60, 40, 20, .14) 36%, rgba(40, 25, 10, .32) 50%, rgba(255, 250, 235, .22) 56%, transparent); }
  /* Table des matières : onglets de papier qui dépassent de la tranche droite, glissés entre les pages et la couverture.
     .wide : place à droite du livre, libellé en entier ; sinon libellé au survol ou au focus (.tabtip, au-dessus de la page). */
  html.book .tabs { display: block; position: absolute; z-index: -1; left: calc(100% - var(--cb) - var(--ed) - 6px); top: 0; width: 0; height: 100%; }
  html.book .tab { position: absolute; left: 0; display: flex; align-items: center; width: calc(6px + var(--cb) + var(--ed) + 16px); padding: 0 6px 0 calc(var(--cb) + var(--ed) + 12px); overflow: hidden;
    border-radius: 0 4px 4px 0; text-decoration: none; white-space: nowrap; font: 600 12px/1.2 'Source Serif 4', Georgia, serif; color: var(--page-ink);
    background: linear-gradient(90deg, rgba(60, 40, 20, .2), transparent 40%), var(--paper), color-mix(in oklab, var(--c) 18%, var(--page));
    box-shadow: 1px 1px 2px rgba(30, 18, 8, .35); transition: transform .2s ease; }
  html.book .tab.sub { width: calc(6px + var(--cb) + var(--ed) + 10px); font-weight: 400; background: linear-gradient(90deg, rgba(60, 40, 20, .2), transparent 40%), var(--paper), var(--page); }
  html.book .tab span { overflow: hidden; text-overflow: ellipsis; }
  html.book .tabs:not(.wide) .tab span { opacity: 0; } /* caché à la vue, pas au lecteur d'écran */
  html.book .tab:hover, html.book .tab:focus-visible { transform: translateX(4px); }
  html.book .tab[aria-current] { transform: translateX(6px); background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 40%), color-mix(in oklab, var(--c) 70%, var(--page)); color: #f6ecd8; }
  html.book .m-kraft .tab[aria-current] { color: #2a1f14; }
  /* Soir : onglets un peu plus clairs que la page, pour se détacher du mur sombre. */
  html.dark.book .tab:not([aria-current]) { background: linear-gradient(90deg, rgba(0, 0, 0, .3), transparent 40%), color-mix(in oklab, var(--c) 22%, #574735); }
  html.book .tab:focus-visible { outline-offset: -2px; }
  html.book .tabs.wide .tab { width: calc(6px + var(--cb) + var(--ed) + var(--tabw, 180px)); }
  html.book .tabs.wide .tab.sub { width: calc(6px + var(--cb) + var(--ed) + var(--tabw, 180px) - 14px); font-size: 11.5px; }
  html.book .tabtip { position: absolute; z-index: 4; right: calc(var(--cb) + var(--ed) + 6px); max-width: calc(var(--om) + var(--cw)); padding: 5px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 600 12.5px/1.3 'Source Serif 4', Georgia, serif; color: var(--page-ink); background: var(--paper), color-mix(in oklab, var(--c) 18%, var(--page)); border-radius: 3px;
    box-shadow: 0 1px 2px rgba(30, 18, 8, .3), 0 6px 14px -6px rgba(30, 18, 8, .45); pointer-events: none; }
  html.book .tabtip.on { display: block; }
  /* Signet : pend du haut du livre devant la marge extérieure de la page de gauche ; étiquette debout (texte comme sur un dos). */
  html.book .mark { left: calc(var(--cb) + var(--ed) + var(--om) / 2 - .9rem); top: -5px; align-items: center; }
  html.book .silk { height: 5.2rem; margin-left: 0; }
  html.book .mtag { writing-mode: vertical-rl; height: auto; width: 2.4rem; margin-top: .4rem; padding: 2.4rem 0 1rem; justify-content: flex-start; font-size: 1.1rem;
    background: radial-gradient(circle at 50% 1.1rem, #3b2a18 0 .22rem, #f3e6c6 .24rem .42rem, transparent .44rem), linear-gradient(90deg, rgba(255, 250, 235, .3), transparent 40%, rgba(80, 55, 25, .12)), var(--paper), #e2cfa5;
    clip-path: polygon(0 .8rem, .8rem 0, calc(100% - .8rem) 0, 100% .8rem, 100% 100%, 0 100%); }
  html.book .views { right: calc(var(--cb) + var(--ed)); }
}
@media screen and (min-width: 1024px) and (min-height: 640px) and (prefers-reduced-motion: reduce) {
  html.book .sweep { display: none; }
}

/* ------------------------------------------------------------------------------------------------
   Images agrandissables (js/post.js) : loupe au survol ; la visionneuse est un dialog modal, toutes vues.
   La pièce s'assombrit, l'image est posée sur un passe-partout en papier Antemoro (classe commune, sans filtre), légende dessous.
   Ajustée à l'écran par défaut ; .real : taille réelle, la visionneuse défile. Ouverture et fermeture : fondu et léger agrandissement. */
.prose img[data-zoom] { cursor: zoom-in; }
.prose img[data-zoom]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
html:has(.viewer[open]) { overflow: hidden; }
.viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: #2b2118; background: transparent; overflow: auto; overscroll-behavior: contain; }
.viewer[open] { display: flex; }
.viewer::backdrop { background: rgba(22, 14, 8, .76); transition: opacity .2s ease; }
.viewer[open]::backdrop { opacity: 1; }
@starting-style { .viewer[open]::backdrop { opacity: 0; } }
.viewer.closing::backdrop { opacity: 0; }
/* Passe-partout : margin auto le centre, et le garde atteignable quand l'image en taille réelle déborde. */
.vw-mat { --fringe-top: 10px; --fringe-right: 10px; --fringe-bottom: 10px; --fringe-left: 10px; --ant-seed: 23;
  margin: auto; padding: 22px 22px 12px; transition: opacity .2s ease, transform .2s ease; }
.viewer[open] .vw-mat { opacity: 1; transform: none; }
@starting-style { .viewer[open] .vw-mat { opacity: 0; transform: scale(.96); } }
.viewer.closing .vw-mat { opacity: 0; transform: scale(.96); }
.vw-img { display: block; max-width: calc(100vw - 120px - 44px); max-height: calc(100dvh - 48px - 34px - 2.4rem - 28px); width: auto; height: auto; object-fit: contain; background: #fffefa;
  box-shadow: 0 0 0 1px rgba(60, 40, 20, .25), inset 0 0 0 1px rgba(0, 0, 0, .1); }
.vw-img.can { cursor: zoom-in; }
.viewer.real .vw-img { max-width: none; max-height: none; cursor: zoom-out; }
.vw-cap { max-width: calc(100vw - 120px - 44px); padding-top: 10px; text-align: center; font: 13px/1.4 'Courier Prime', 'Courier New', monospace; color: #54493b; }
.viewer.real .vw-cap { max-width: none; }
.vw-cap:empty { display: none; }
/* Boutons discrets : fermer en haut à droite, image précédente et suivante sur les bords, repère « 3 / 7 » en haut à gauche (jamais sur la légende). Fixes : ils restent en place quand l'image défile. */
.vw-btn { position: fixed; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; font: 26px/40px 'Source Serif 4', Georgia, serif; color: #f1e6cf; background: rgba(30, 20, 12, .55); }
.vw-btn:hover { background: rgba(30, 20, 12, .8); }
.vw-btn:focus-visible { outline: 2px solid #f0c27a; outline-offset: 2px; }
.vw-x { top: 14px; right: 14px; font-size: 24px; }
.vw-prev { left: 12px; top: calc(50% - 20px); }
.vw-next { right: 12px; top: calc(50% - 20px); }
.vw-btn[hidden] { display: none; }
.vw-n { /* dans le passe-partout, sous la légende : jamais sur l'image */ display: block; width: max-content; margin: 6px auto 0; padding: 2px 10px; border-radius: 10px; font: 12px/18px 'Courier Prime', 'Courier New', monospace; letter-spacing: .08em; color: #f1e6cf; background: rgba(30, 20, 12, .55); }
.vw-n:empty { display: none; }
@media not all and (min-width: 720px) {
  /* Bandes de 56 px en haut (fermer, repère) et en bas (précédente, suivante) : les boutons ne couvrent jamais le passe-partout. */
  .viewer { padding: 56px 0; }
  .vw-mat { padding: 12px 12px 8px; }
  .vw-img { max-width: calc(100vw - 24px - 24px); max-height: calc(100dvh - 112px - 20px - 30px - 28px); }
  .vw-cap { max-width: calc(100vw - 48px); }
  .vw-prev, .vw-next { top: auto; bottom: 8px; }
}

/* Impression : toujours la page défilante, sans en-tête, plancher ni pièces du livre. */
@media print {
  body { display: block; height: auto; overflow: visible; background: none; }
  body > main { overflow: visible; }
  .bar, .foot, .mark, .views, .pin, .contents.side, .exits { display: none !important; }
  .folio { display: block; padding: 0; }
  .sheet, .sheet[class*="m-"], .leaf { box-shadow: none; background: none; padding: 0; color: #000; }
}

/* Mobile. */
@media not all and (min-width: 720px) {
  /* Bande sous l'en-tête collant (76 px, base.css) ; titre, rayon et série, section : trois lignes. */
  :root { --stick: 76px; --pin-h: 7.2rem; }
  .pin { top: var(--stick); }
  .pin > div { grid-template-columns: auto minmax(0, 1fr); column-gap: 1.2rem; padding: 0 1.6rem 0 1.2rem; }
  .pin-t { font-size: 1.6rem; line-height: 1.35; }
  .pin-m { grid-row: 2; grid-column: 2; line-height: 1.45; }
  .pin-back { grid-row: 1 / span 3; }
  .pin-s { font-size: 1.25rem; }
  .folio { display: block; padding: 1.2rem 1.2rem 3rem; }
  .sheet[class*="m-"] { padding-left: .5rem; }
  .leaf { padding: 6.6rem 2rem 2.8rem; }
  .mark { left: 1.4rem; }
  .silk { height: 1.8rem; }
  .opening h1 { font-size: 2.9rem; }
  .prose { font-size: 1.75rem; line-height: 1.65; }
  .prose :is(h1, h2) { font-size: 2.3rem; }
  .prose h3 { font-size: 2rem; }
  .prose figure.highlight { margin-inline: -1rem; font-size: 1.3rem; }
  .volumes, .neighbours { flex-direction: column; }
  .volumes .next, .neighbours .next { margin-left: 0; text-align: left; }
  .spn { width: 100%; }
  .shelf-list li { grid-template-columns: 7rem 1fr auto; gap: 1.2rem; font-size: 1.8rem; }
  .shelf-list .spn { width: 7rem; }
}
