/* L'Enchanteur — liseuse et fiches des œuvres lisibles. S'appuie sur les jetons du thème (--bg, --ink, --accent, --serif…). */

@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-latin-600-italic.woff2) format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }

:root {
	--cb-taille: 20px;
	--cb-mesure: 66ch;
	--cb-police: "EB Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--cb-barre: 48px;
	--cb-surface: color-mix(in srgb, var(--bg) 92%, var(--ink) 8%);
}
html[data-police="georgia"] { --cb-police: Georgia, "Iowan Old Style", "Times New Roman", serif; }
html[data-police="sans"] { --cb-police: var(--sans); }

/* Fonds de lecture : ils s'appliquent à toute la page (le thème lit ces mêmes jetons). */
html[data-lecture="sepia"] {
	--bg: #f3ead6; --bg-2: #e9dec5; --ink: #3a2e20; --ink-2: #66553f; --ink-3: #998566; --line: rgba(58, 46, 32, .16);
	--cb-surface: #ece1c8; color-scheme: light;
}
html[data-lecture="nuit"] {
	--bg: #121212; --bg-2: #1c1b19; --ink: #d8d1c4; --ink-2: #a39b8e; --ink-3: #736c61; --line: rgba(216, 209, 196, .13);
	--cb-surface: #1b1a18; color-scheme: dark;
}
html[data-lecture] body { background: var(--bg); color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Boutons communs                                                     */
/* ------------------------------------------------------------------ */
.cb-bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); font: 500 .9375rem var(--sans); text-decoration: none; color: var(--ink); background: transparent; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease); }
.cb-bouton:hover { border-color: var(--ink-2); color: var(--ink); }
.cb-bouton--plein { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cb-bouton--plein:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }

/* ------------------------------------------------------------------ */
/* Fiche d'une œuvre : présentation à gauche, livre à droite            */
/* ------------------------------------------------------------------ */
.cb-oeuvre-grille { display: grid; gap: 40px; padding-bottom: 24px; }
.cb-oeuvre-grille__texte { min-width: 0; max-width: 760px; }
.cb-oeuvre-grille__texte > .le-source, .cb-oeuvre-grille__texte > .le-chips { max-width: none; }
@media (min-width: 1100px) {
	.cb-oeuvre-grille { grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; }
	.cb-panneau { position: sticky; top: calc(var(--head) + 20px); max-height: calc(100vh - var(--head) - 40px); }
	.admin-bar .cb-panneau { top: calc(var(--head) + 52px); max-height: calc(100vh - var(--head) - 72px); }
}
@media (max-width: 1099px) {
	.cb-oeuvre-grille .cb-panneau { order: -1; }
	.cb-panneau__table .cb-toc { max-height: 60vh; }
}
/* les images du texte restent dans la colonne de gauche (la marge de droite porte le livre) */
.cb-oeuvre-grille .entry-content > figure.cb-marge { float: right; clear: right; width: min(260px, 42%); margin: 4px 0 20px 28px; }
@media (max-width: 700px) { .cb-oeuvre-grille .entry-content > figure.cb-marge { float: none; width: auto; margin: 1.6em 0; } }

.cb-panneau { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--cb-surface); font-family: var(--sans); }
.cb-panneau__tete { display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: end; }
.cb-panneau__tete:not(:has(figure)) { grid-template-columns: 1fr; }
.cb-panneau__couverture { margin: 0; }
.cb-panneau__couverture img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: top; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 10px 28px -10px rgba(0, 0, 0, .45); background: #f5efe2; transition: transform .35s var(--ease); }
.cb-panneau__couverture a:hover img { transform: translateY(-3px) rotate(-.6deg); }
.cb-panneau__couverture figcaption { font: 9.5px/1.35 var(--mono); color: var(--ink-3); margin-top: 8px; overflow-wrap: anywhere; }
.cb-panneau__couverture figcaption a { color: inherit; }
.cb-panneau__kicker { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 10px; }
.cb-panneau__actions .cb-bouton { width: 100%; }
.cb-panneau__meta { font-size: .8125rem; color: var(--ink-2); margin: 10px 0 0; }
.cb-panneau__titre { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 4px 0 6px; }
.cb-panneau__table { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cb-panneau__table .cb-toc { overflow: auto; overscroll-behavior: contain; margin-right: -10px; padding-right: 10px; }
.cb-panneau__source { font-size: .75rem; color: var(--ink-3); margin: 0; line-height: 1.5; }
.cb-ocr { color: var(--accent); }

/* Table des chapitres (fiche et liseuse) */
.cb-toc, .cb-toc ol { list-style: none; margin: 0; padding: 0; }
.cb-toc ol { padding-left: 12px; border-left: 1px solid var(--line); margin: 2px 0 6px 8px; }
.cb-toc a, .cb-toc summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 8px; border-radius: 6px; font-size: .875rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
.cb-toc a:hover, .cb-toc summary:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.cb-toc small { font: 10.5px var(--mono); color: var(--ink-3); white-space: nowrap; }
.cb-toc summary { cursor: pointer; font-weight: 600; list-style: none; }
.cb-toc summary::-webkit-details-marker { display: none; }
.cb-toc summary span::before { content: ""; display: inline-block; width: 0; height: 0; margin: 0 8px 1px 0; border: 4px solid transparent; border-left: 5px solid currentColor; vertical-align: middle; transition: transform .2s; transform-origin: 30% 50%; }
.cb-toc details[open] > summary span::before { transform: rotate(90deg); }
.cb-toc .is-current > a { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-weight: 600; }
.cb-toc .is-lu > a span::after { content: " ✓"; color: var(--ink-3); font-size: .8em; }
.cb-toc .is-reprise > a { box-shadow: inset 2px 0 0 var(--accent); }

/* Recherche dans le livre */
.cb-recherche input { width: 100%; height: 40px; padding: 0 14px 0 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E") 12px 50% / 16px no-repeat; color: var(--ink); font: .9375rem var(--sans); }
.cb-recherche input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.cb-resultats { font-size: .875rem; max-height: 46vh; overflow: auto; overscroll-behavior: contain; }
.cb-resultats__total { font: 11px var(--mono); color: var(--ink-3); margin: 0 0 6px; }
.cb-resultats ol { list-style: none; margin: 0; padding: 0; }
.cb-resultats li a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); line-height: 1.45; }
.cb-resultats li a:hover, .cb-resultats li a:focus { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); outline: none; }
.cb-resultats li strong { display: block; font: 600 11px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.cb-resultats mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ------------------------------------------------------------------ */
/* Liseuse                                                             */
/* ------------------------------------------------------------------ */
.cb-lecteur { position: relative; }
.cb-progression { position: sticky; top: var(--head); z-index: 31; height: 0; }
.cb-progression span { position: absolute; left: 0; top: var(--cb-barre); height: 2px; width: 0; background: var(--accent); transition: width .1s linear; }
.admin-bar .cb-progression, .admin-bar .cb-barre { top: calc(var(--head) + 32px); }
@media (max-width: 782px) { .admin-bar .cb-progression, .admin-bar .cb-barre { top: var(--head); } }

.cb-barre { position: sticky; top: var(--head); z-index: 30; display: flex; align-items: center; gap: 6px; height: var(--cb-barre); padding: 0 12px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px); border-bottom: 1px solid var(--line); font-family: var(--sans); }
.cb-barre__titre { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font-size: .875rem; white-space: nowrap; overflow: hidden; }
.cb-barre__titre a { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.cb-barre__titre a:hover { color: var(--accent); }
.cb-barre__titre > span[aria-hidden] { color: var(--ink-3); }
.cb-barre__chap { color: var(--ink); overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cb-barre__reste { font: 11px var(--mono); color: var(--ink-3); white-space: nowrap; }
@media (max-width: 600px) { .cb-barre__reste, .cb-barre__titre a, .cb-barre__titre > span[aria-hidden] { display: none; } }
.cb-barre__btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; font: 600 .9375rem var(--serif); }
.cb-barre__btn:hover, .cb-barre__btn[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.cb-barre__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.cb-aa { font: italic 400 1.25rem/1 var(--cb-police); }

.cb-reglages { position: fixed; z-index: 45; top: calc(var(--head) + var(--cb-barre) + 8px); right: 12px; width: min(360px, calc(100vw - 24px)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .35); font-family: var(--sans); display: grid; gap: 12px; }
.cb-reglages[hidden] { display: none; }
.cb-reglages__ligne { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cb-reglages__ligne > span { width: 64px; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.cb-reglages button { flex: 1; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: .8125rem var(--sans); cursor: pointer; }
.cb-reglages button:hover { border-color: var(--ink-2); }
.cb-reglages button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cb-reglages output { min-width: 34px; text-align: center; font: 12px var(--mono); }
.cb-f-garamond { font-family: "EB Garamond", Garamond, serif !important; font-size: .95rem !important; }
.cb-f-georgia { font-family: Georgia, serif !important; }
.cb-t-clair { background: #faf8f3 !important; color: #141312 !important; }
.cb-t-sepia { background: #f3ead6 !important; color: #3a2e20 !important; }
.cb-t-nuit { background: #121212 !important; color: #d8d1c4 !important; }
.cb-interrupteur { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--ink-2); cursor: pointer; }
.cb-interrupteur input { accent-color: var(--accent); width: 16px; height: 16px; }

.cb-lecteur__grille { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1440px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 1100px) { .cb-lecteur__grille { grid-template-columns: 270px minmax(0, 1fr); gap: 32px; padding: 0 24px; } }
@media (min-width: 1360px) { .cb-lecteur__grille { grid-template-columns: 270px minmax(0, 1fr) 230px; } }

/* table : colonne fixe sur grand écran, tiroir ailleurs */
.cb-lecteur__table { font-family: var(--sans); }
.cb-lecteur__table-tete { display: flex; gap: 12px; align-items: center; padding: 18px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.cb-lecteur__table-tete img { width: 44px; aspect-ratio: 2 / 3; object-fit: cover; object-position: top; border-radius: 2px; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .4); }
.cb-lecteur__table-tete > div { flex: 1; min-width: 0; }
.cb-lecteur__livre { display: block; font: italic 400 1.25rem/1.1 var(--serif); text-decoration: none; }
.cb-lecteur__table-tete small { font-size: .75rem; color: var(--ink-3); }
.cb-ferme { font: 300 1.6rem/1 var(--sans); }
@media (min-width: 1100px) {
	.cb-lecteur__table { position: sticky; top: calc(var(--head) + var(--cb-barre)); align-self: start; max-height: calc(100vh - var(--head) - var(--cb-barre)); overflow: auto; overscroll-behavior: contain; padding-bottom: 32px; scrollbar-width: thin; }
	.admin-bar .cb-lecteur__table { top: calc(var(--head) + var(--cb-barre) + 32px); max-height: calc(100vh - var(--head) - var(--cb-barre) - 32px); }
	.cb-ferme, .cb-barre [data-ouvre="table"] { display: none; }
}
@media (max-width: 1099px) {
	.cb-lecteur__table { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(360px, 88vw); padding: 0 12px 24px; background: var(--bg); border-right: 1px solid var(--line); overflow: auto; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: 20px 0 60px -20px rgba(0, 0, 0, .4); }
	.cb-lecteur.table-ouverte .cb-lecteur__table { transform: none; }
	.cb-lecteur.table-ouverte::after { content: ""; position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .35); }
}

/* texte */
.cb-texte-wrap { min-width: 0; width: 100%; max-width: var(--cb-mesure); margin: 0 auto; padding: 56px 0 40px; font-size: var(--cb-taille); }
.cb-chapitre-tete { text-align: center; margin-bottom: 2.6em; font-family: var(--sans); }
.cb-chapitre-tete__fil { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 14px; }
.cb-chapitre-tete__titre { font: 400 clamp(2rem, 5vw, 3.2rem)/1.05 var(--serif); letter-spacing: -.015em; margin: 0 0 16px; text-wrap: balance; }
.cb-chapitre-tete__meta { font-size: .8125rem; color: var(--ink-3); margin: 0; }
.cb-avertissement { font: .8125rem/1.5 var(--sans); padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--ink-2); margin: 0 0 2em; }

.cb-texte { font-family: var(--cb-police); font-size: 1em; line-height: 1.62; color: var(--ink); font-kerning: normal; font-variant-ligatures: common-ligatures; hanging-punctuation: first; }
html[data-police="sans"] .cb-texte { line-height: 1.6; font-size: .92em; }
.cb-texte p { margin: 0 0 .7em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-indent: 1.4em; position: relative; }
.cb-texte h2, .cb-texte h3, .cb-texte h4 + p, .cb-texte hr + p, .cb-texte .c + p { text-indent: 0; }
.cb-texte > p:first-of-type { text-indent: 0; }
.cb-texte > p:first-of-type:not(.d):not(.c):not(.note-ocr):not(.sommaire):not(.entete-lettre)::first-letter { float: left; font-size: 3.6em; line-height: .8; margin: .07em .08em 0 0; color: var(--accent); }  /* lettrine : seulement sur un paragraphe de texte (pas une date de lettre, un en-tête, une note, un sommaire, un titre centré) */
.cb-texte h2, .cb-texte h3, .cb-texte h4 { font-family: var(--cb-police); font-weight: 600; text-align: center; letter-spacing: .02em; margin: 2em 0 1em; line-height: 1.25; }
.cb-texte h2 { font-size: 1.25em; }
.cb-texte h3 { font-size: 1.1em; }
.cb-texte h4 { font-size: 1em; font-style: italic; font-weight: 400; }
.cb-texte .c { text-align: center; text-indent: 0; }
.cb-texte .entete-lettre { text-align: center; text-indent: 0; font-style: italic; }  /* en-tête de lettre gardé pour son appel de note */
.cb-texte .d { text-align: right; text-indent: 0; }
.cb-texte .sommaire { font-size: .82em; line-height: 1.5; font-style: italic; color: var(--ink-2); text-indent: 0; text-align: justify; margin: 0 0 2.4em; padding: 0 0 1.4em; border-bottom: 1px solid var(--line); }
.cb-texte .sc { font-variant: small-caps; letter-spacing: .03em; }
.cb-texte hr { border: 0; margin: 2em auto; width: 100%; height: 1em; text-align: center; }
.cb-texte hr::before { content: "⁂"; color: var(--ink-3); font-size: 1em; }
.cb-texte blockquote { margin: 1.2em 0 1.2em 1.4em; font-size: .94em; }
.cb-texte .vers, .cb-texte .poem { margin: 1.4em 0 1.4em 2em; text-indent: 0; }
.cb-texte .vers p { text-align: left; text-indent: 0; }
.cb-texte table { margin: 1.4em auto; border-collapse: collapse; font-size: .85em; }
.cb-texte td, .cb-texte th { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* question imprimée en marge, en regard de sa solution (Itinéraire, Mémoire sur Tunis) : donnée avant la solution */
.cb-texte .question { font-size: .88em; line-height: 1.5; font-style: italic; text-indent: 0; text-align: left; color: var(--ink-2); margin: 0 0 .9em; padding-left: .8em; border-left: 2px solid var(--accent); }
/* manchette : date ou remarque imprimée dans la marge, placée à la ligne en regard */
.cb-texte .manchette { font: .72em/1.4 var(--sans); color: var(--ink-2); background: color-mix(in srgb, var(--accent) 9%, transparent); border-radius: 3px; padding: 1px 5px; }
.cb-texte .cb-mise-en-page { font: .8125rem/1.5 var(--sans); color: var(--ink-3); text-indent: 0; text-align: left; }
.cb-texte .tableau-chiffres td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-texte .tableau-chiffres .total td { font-variant: small-caps; border-top: 1px solid var(--ink-3); }
.cb-texte sup.n a { font: 600 .62em var(--sans); color: var(--accent); text-decoration: none; padding: 0 1px; }
/* numéro de page de l'édition imprimée : « p. 55 » à l'endroit exact du changement de page, comme dans les livres d'OpenEdition
   (pas dans la marge : le texte remplit sa colonne, le numéro collait à « Dans ce chapitre ») ; jamais un chiffre surélevé, qu'on
   prendrait pour un appel de note ; cliquable (livres OCR) : page du fac-similé ; masquable dans les réglages (« Pages ») */
.cb-texte .pg::before { content: "p. " attr(data-p); font: .55em/1 var(--mono); color: var(--ink-3); letter-spacing: 0; text-indent: 0; white-space: nowrap; border: 1px solid var(--line); border-radius: 3px; padding: 1px 3px; margin: 0 3px; vertical-align: .12em; }
.cb-texte > .pg { float: right; }  /* page qui commence avec le paragraphe suivant : au bout de sa première ligne */
html[data-pages="non"] .cb-texte .pg { display: none; }
.cb-texte .pg[data-scan] { cursor: pointer; }
.cb-texte .pg[data-scan]:hover::before, .cb-texte .pg[data-scan]:focus-visible::before { color: var(--accent); border-color: var(--accent); text-decoration: underline; }
/* note de bas de page d'un livre OCR, rangée après le paragraphe qu'elle coupait */
.cb-texte .note-ocr { font-size: .8em; line-height: 1.5; color: var(--ink-2); text-indent: 0; text-align: left; margin: -.2em 0 1em 1.4em; padding-left: .8em; border-left: 2px solid var(--line); }
.cb-texte .notes { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); font-size: .8em; line-height: 1.5; color: var(--ink-2); }
.cb-texte .notes h2 { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; text-align: left; color: var(--ink-3); margin: 0 0 1em; }
.cb-texte .notes ol { padding-left: 1.6em; margin: 0; }
.cb-texte .notes li { margin-bottom: .6em; scroll-margin-top: calc(var(--head) + var(--cb-barre) + 60px); }
.cb-texte .notes li:target { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; }
.cb-texte .retour { text-decoration: none; color: var(--ink-3); }
.cb-texte [id^="p"] { scroll-margin-top: calc(var(--head) + var(--cb-barre) + 60px); }
.cb-texte [id^="p"]:target, .cb-texte .is-vise { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: -10px 0 0 color-mix(in srgb, var(--accent) 9%, transparent), 10px 0 0 color-mix(in srgb, var(--accent) 9%, transparent); border-radius: 2px; }

/* numéro de paragraphe au survol : lien vers ce paragraphe */
.cb-pnum { position: absolute; left: -3.4em; top: .25em; width: 2.6em; text-align: right; text-indent: 0; font: 10px var(--mono); color: var(--ink-3); text-decoration: none; opacity: 0; transition: opacity .15s; }
.cb-texte p:hover > .cb-pnum, .cb-pnum:focus { opacity: 1; }
.cb-pnum:hover { color: var(--accent); }
@media (max-width: 760px) { .cb-pnum { display: none; } }

/* liens posés par le site */
.cb-lien { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
.cb-lien:hover { color: var(--accent); text-decoration-style: solid; }
.cb-lien--date { text-decoration-style: dashed; text-decoration-color: color-mix(in srgb, var(--ink-3) 70%, transparent); }
html[data-liens="non"] .cb-lien { text-decoration: none; }
.cb-lien.is-repere { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 2px; transition: background 1.2s; }
mark.cb-surligne { background: color-mix(in srgb, #f5c542 55%, transparent); color: inherit; border-radius: 2px; }
mark.cb-surligne--passage { background: color-mix(in srgb, #f5c542 38%, transparent); box-shadow: 0 2px 0 color-mix(in srgb, #d9a400 70%, transparent); border-radius: 0; }
/* fiche du site qui cite ce paragraphe */
.cb-cite-marque { display: inline-block; margin-left: .3em; padding: 0 .3em; font: 600 .8em/1.2 var(--sans); color: var(--accent); text-decoration: none; text-indent: 0; border-radius: 4px; vertical-align: .1em; opacity: .7; }
.cb-cite-marque + .cb-cite-marque { margin-left: 0; }
.cb-cite-marque:hover, .cb-cite-marque:focus { opacity: 1; background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* pied du chapitre */
.cb-chapitre-pied { margin-top: 3.4em; font-family: var(--sans); }
.cb-suite { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cb-suite__lien { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.cb-suite__lien:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.cb-suite__lien small { font: 11px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.cb-suite__lien span { font: 400 1.15rem/1.2 var(--serif); }
.cb-suite__lien--suiv { text-align: right; }
.cb-chapitre-pied__source { font-size: .75rem; color: var(--ink-3); margin: 1.6em 0 0; line-height: 1.5; text-align: center; }

/* « Dans ce chapitre » */
.cb-lecteur__index { font-family: var(--sans); font-size: .8125rem; padding: 0 0 40px; }
@media (min-width: 1360px) { .cb-lecteur__index { position: sticky; top: calc(var(--head) + var(--cb-barre)); align-self: start; max-height: calc(100vh - var(--head) - var(--cb-barre)); overflow: auto; padding-top: 56px; scrollbar-width: thin; } }
@media (max-width: 1359px) { .cb-lecteur__index { max-width: var(--cb-mesure); margin: 0 auto; width: 100%; border-top: 1px solid var(--line); padding-top: 24px; } .cb-lecteur__grille > .cb-lecteur__index { grid-column: 1 / -1; } }
@media (max-width: 1359px) and (min-width: 1100px) { .cb-lecteur__grille > .cb-lecteur__index { grid-column: 2; } }
.cb-index__titre { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 14px; }
.cb-index__groupe { margin-bottom: 18px; }
.cb-index__groupe h3 { font: 600 .75rem var(--sans); color: var(--ink-2); margin: 0 0 6px; }
.cb-index__groupe h3 small { font: 10px var(--mono); color: var(--ink-3); font-weight: 400; }
.cb-index__groupe ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.cb-index__groupe li a { display: inline-block; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); line-height: 1.4; }
.cb-index__groupe li a:hover { border-color: var(--accent); color: var(--accent); }
.cb-index__groupe li small { font: 10px var(--mono); color: var(--ink-3); margin-left: 2px; }
.cb-index__aide { color: var(--ink-3); font-size: .75rem; line-height: 1.6; }
.cb-index__aide kbd { font-size: 10px; }

/* recherche (dialogue), aperçu des fiches, citation, message */
.cb-dialogue { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(10, 9, 8, .45); backdrop-filter: blur(3px); }
.cb-dialogue[hidden] { display: none; }
.cb-dialogue__panneau { width: min(640px, 100%); padding: 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); display: grid; gap: 10px; font-family: var(--sans); }
.cb-dialogue__panneau .cb-recherche input { height: 48px; font-size: 1.0625rem; }
.cb-dialogue__panneau .cb-resultats { max-height: 56vh; }
.cb-dialogue__aide { font: 11px var(--mono); color: var(--ink-3); margin: 0; }

.cb-bulle { position: absolute; z-index: 55; width: min(340px, calc(100vw - 24px)); padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 18px 50px -14px rgba(0, 0, 0, .45); font: .8125rem/1.5 var(--sans); color: var(--ink-2); }
.cb-bulle[hidden] { display: none; }
.cb-bulle__tete { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.cb-bulle__tete img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.cb-bulle__type { font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.cb-bulle__titre { display: block; font: 400 1.25rem/1.1 var(--serif); color: var(--ink); }
.cb-bulle__dates { font-size: .75rem; color: var(--ink-3); }
.cb-bulle p { margin: 0 0 8px; }
.cb-bulle a.cb-bulle__lien { font-weight: 500; color: var(--accent); text-decoration: none; }
.cb-bulle--note { font-family: var(--cb-police); font-size: .95rem; color: var(--ink); }

.cb-citer { position: absolute; z-index: 56; padding: 7px 12px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 .8125rem var(--sans); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5); cursor: pointer; }
.cb-citer[hidden] { display: none; }
.cb-toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font: .875rem var(--sans); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.cb-toast[hidden] { display: none; }

/* lecture concentrée : en-tête du site masqué en descendant */
.cb-lecture-active .le-header { transform: translateY(-100%); transition: transform .3s var(--ease); }
.cb-lecture-active .cb-barre, .cb-lecture-active .cb-progression, .cb-lecture-active .cb-lecteur__table, .cb-lecture-active .cb-lecteur__index { top: 0; transition: top .3s var(--ease); }
.le-header { transition: transform .3s var(--ease); }

/* ------------------------------------------------------------------ */
/* Bibliothèque                                                        */
/* ------------------------------------------------------------------ */
.cb-etagere { list-style: none; margin: 8px 0 48px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 32px 24px; }
.cb-etagere a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.cb-etagere__couv { display: block; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: var(--bg-2); box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .45); transition: transform .3s var(--ease); }
.cb-etagere a:hover .cb-etagere__couv { transform: translateY(-4px); }
.cb-etagere__couv img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cb-etagere__titre-couv { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font: italic 1.1rem/1.2 var(--serif); }
.cb-etagere__titre { font: 400 1.1rem/1.2 var(--serif); }
.cb-etagere small { font-size: .75rem; color: var(--ink-3); }
.cb-etagere .cb-etagere__meta { font: 10.5px var(--mono); }
.cb-etagere__livre[hidden] { display: none; }
.cb-etagere-regle { max-width: 68ch; margin: 18px 0 0; padding: 10px 14px; border-left: 2px solid var(--accent); background: color-mix(in srgb, var(--ink) 4%, transparent); font: .875rem/1.55 var(--sans); color: var(--ink-2); }
.cb-etagere-outils { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 28px; font: .875rem var(--sans); color: var(--ink-2); }
.cb-etagere-outils input { flex: 1 1 280px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.cb-etagere-outils input:focus { outline: none; border-color: var(--accent); }
.cb-etagere-outils select { height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; padding: 0 8px; }
.cb-etagere-outils [data-compte] { font: 11px var(--mono); color: var(--ink-3); }

@media print {
	.le-header, .le-footer, .cb-barre, .cb-progression, .cb-lecteur__table, .cb-lecteur__index, .cb-chapitre-pied .cb-suite, .cb-reglages { display: none !important; }
	.cb-texte-wrap { max-width: none; padding: 0; font-size: 12pt; }
	.cb-lien { text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { .cb-lecteur *, .cb-panneau * { transition: none !important; } }

/* Manuscrit transcrit feuillet par feuillet : image en regard du texte (Mémoires de ma vie) */
.ms-page { float: right; clear: right; width: 42%; max-width: 330px; margin: .35em 0 1em 1.5em; font-family: var(--sans); }
.ms-page img { display: block; width: 100%; height: auto; border: 1px solid rgba(128, 128, 128, .35); background: #fff; }
.ms-ed { opacity: .6; font-size: .85em; font-family: var(--sans); }
.ms-page figcaption { margin-top: .35em; font-size: .72em; line-height: 1.35; opacity: .75; }
.ms-titre { text-align: center; font-style: italic; text-indent: 0 !important; margin: 1em 0 1.5em; }
.ms-suite { text-indent: 0 !important; }
.ms-suite::first-letter { font: inherit !important; float: none !important; color: inherit !important; margin: 0 !important; }
.ms-vers { margin-left: 2em; text-indent: 0 !important; font-style: italic; }
@media (max-width: 640px) {
	.ms-page { float: none; width: 100%; max-width: none; margin: 1em 0; }
}
