/* Mise en page : colonne de lecture étroite, citations en grand Bodoni italique, références en mono "fiche de conférence". */
:root {
  --papier: #f3f2f6;      /* papier légèrement bleuté, l'heure du coucher */
  --surface: #ffffff;
  --encre: #1d1b2c;       /* encre bleu nuit */
  --doux: #5d5a70;
  --filet: #d9d6e2;
  --bordeaux: #8c2c38;    /* le rouge des couvertures */
  --laiton: #9a7a2c;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --texte: "Literata", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --mesure: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #12111c; --surface: #1b1a28; --encre: #ebe7df; --doux: #a9a5b8;
    --filet: #2f2d40; --bordeaux: #e07a86; --laiton: #d4b05e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #12111c; --surface: #1b1a28; --encre: #ebe7df; --doux: #a9a5b8;
  --filet: #2f2d40; --bordeaux: #e07a86; --laiton: #d4b05e; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 1.0625rem/1.7 var(--texte); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--bordeaux) 50%, transparent); text-underline-offset: 0.18em; }
a:hover { color: var(--bordeaux); }
:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
p { margin: 0; }

.cadre { max-width: 68rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.etroit { max-width: calc(var(--mesure) + 32px); }
.sauter { position: absolute; left: -999px; }
.sauter:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 5; }
.etiquette, .ref { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--doux); }
.ref a { text-decoration: none; color: var(--bordeaux); }

/* En-tête */
.entete { border-bottom: 1px solid var(--filet); }
.entete-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 18px; }
.marque { font-family: var(--display); font-size: 1.35rem; font-weight: 600; text-decoration: none; letter-spacing: 0.01em; }
.marque span { font-style: italic; font-weight: 400; color: var(--bordeaux); }
.entete nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.entete nav a { text-decoration: none; color: var(--doux); padding-block: 4px; }
.entete nav a[aria-current] { color: var(--encre); border-bottom: 1px solid var(--bordeaux); }

/* Sections */
section { padding-block: clamp(40px, 7vw, 72px); }
section + section { border-top: 1px solid var(--filet); }
.chapeau { display: grid; gap: 14px; margin-bottom: 32px; }
.chapeau p:not(.etiquette) { color: var(--doux); max-width: var(--mesure); }

/* Citations */
.citation { margin: 0; display: grid; gap: 12px; }
.citation blockquote { margin: 0; font-family: var(--display); font-style: italic; font-size: 1.45rem; line-height: 1.4; }
.citation blockquote a { text-decoration: none; }
.citation blockquote a::before { content: "« "; color: var(--bordeaux); }
.citation blockquote a::after { content: " »"; color: var(--bordeaux); }
.citation.grande blockquote { font-size: clamp(1.75rem, 4.6vw, 2.9rem); line-height: 1.25; }
.citation.grande blockquote p::before { content: "« "; color: var(--bordeaux); }
.citation.grande blockquote p::after { content: " »"; color: var(--bordeaux); }
.liste-citations { display: grid; gap: 40px; max-width: var(--mesure); }
.liste-citations .citation { padding-left: 20px; border-left: 1px solid var(--filet); }

/* Accueil */
.une { padding-block: clamp(48px, 9vw, 96px); }
.une .citation { max-width: 52rem; }
.une-pied { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: 28px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0 40px; }
.theme { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding-block: 18px; border-bottom: 1px solid var(--filet); text-decoration: none; }
.theme strong { font-family: var(--display); font-size: 1.4rem; font-weight: 500; }
.theme span { font-family: var(--mono); font-size: 0.8rem; color: var(--doux); align-self: center; font-variant-numeric: tabular-nums; }
.theme em { grid-column: 1 / -1; font-style: normal; color: var(--doux); font-size: 0.95rem; }

/* Étagère de livres */
.etagere { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 32px 24px; }
.livre-mini { display: grid; gap: 10px; text-decoration: none; align-content: start; }
.livre-mini img { aspect-ratio: 5 / 8; width: 100%; object-fit: cover; box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 8px 18px -10px rgb(0 0 0 / .35); }
.livre-mini strong { font-family: var(--display); font-weight: 500; font-size: 1.05rem; line-height: 1.25; }
.livre-mini span { font-family: var(--mono); font-size: 0.72rem; color: var(--doux); }

/* Fiche livre */
.fiche { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 40px; align-items: start; }
.fiche img { box-shadow: 0 2px 4px rgb(0 0 0 / .12), 0 18px 30px -16px rgb(0 0 0 / .45); }
.fiche-texte { display: grid; gap: 20px; min-width: 0; }
.fiche-texte > p { max-width: var(--mesure); }
.chapitres { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-family: var(--mono); font-size: 0.85rem; }
.chapitres li { display: flex; gap: 12px; }
.chapitres b { color: var(--bordeaux); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .fiche { grid-template-columns: 1fr; } .fiche img { max-width: 11rem; } }

/* Boutons d'achat */
.boutiques { display: grid; gap: 12px; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.bouton { font-family: var(--mono); font-size: 0.8rem; padding: 9px 14px; border: 1px solid var(--filet); border-radius: 3px; text-decoration: none; background: var(--surface); }
.bouton:hover { border-color: var(--bordeaux); color: var(--bordeaux); }
.bouton.plein { background: var(--bordeaux); border-color: var(--bordeaux); color: var(--papier); }
.bouton.plein:hover { filter: brightness(1.08); color: var(--papier); }

/* Passages */
.passage { display: grid; gap: 14px; max-width: var(--mesure); padding: 28px; background: var(--surface); border: 1px solid var(--filet); }
.passage h3 { font-size: 1.3rem; }
.passage p:not(.ref) { font-size: 1.05rem; }

/* Page citation */
.citation-page { display: grid; gap: 36px; }
.partage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.encart { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 20px; align-items: center; padding: 20px; background: var(--surface); border: 1px solid var(--filet); max-width: var(--mesure); }
.encart img { aspect-ratio: 5/8; object-fit: cover; }
.encart div { display: grid; gap: 12px; min-width: 0; }
.encart strong { font-family: var(--display); font-size: 1.25rem; font-weight: 500; }

/* Filtres par thème */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }

/* Biographie */
.prose { display: grid; gap: 18px; max-width: var(--mesure); }

/* Pied */
.pied { border-top: 1px solid var(--filet); margin-top: 24px; }
.pied-in { display: grid; gap: 8px; padding-block: 32px; font-size: 0.9rem; color: var(--doux); }
.mention { font-family: var(--mono); font-size: 0.72rem; }

@media (prefers-reduced-motion: no-preference) {
  .une .citation { animation: lever 0.9s ease-out both; }
  @keyframes lever { from { opacity: 0.001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Livres audio : vignette YouTube cliquable, l'iframe ne se charge qu'au clic */
.audio { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 28px; align-items: start; padding: 24px; background: var(--surface); border: 1px solid var(--filet); }
.audio-lecteur, .audio iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #000; cursor: pointer; overflow: hidden; }
.audio-lecteur img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .2s; }
.audio-lecteur:hover img, .audio-lecteur:focus-visible img { opacity: 1; }
.audio-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--bordeaux); color: #fff; font-size: 1.4rem; padding-left: 4px; box-shadow: 0 6px 18px rgb(0 0 0 / .35); }
.audio-texte { display: grid; gap: 10px; min-width: 0; }
.audio-texte h2, .audio-texte h3 { margin: 0; }
.liste-audio { display: grid; gap: 24px; }
@media (max-width: 720px) { .audio { grid-template-columns: 1fr; } }
