/* Manuel Philosophie Terminale — ebook (Adaptia premium) */
:root {
  --adaptia: #1a4d3e;
  --ink: #1a2330;
  --ink-2: #3d4a5c;
  --ink-3: #6a7688;
  --paper: #f8f9f7;
  --paper-2: #eef0ec;
  --white: #ffffff;
  --sidebar-bg: #ffffff;
  --accent: #2d6a4f;
  --accent-2: #40916c;
  --accent-soft: #e8f3ec;
  --accent-soft-2: #c8e6d0;
  --art: #c2185b;
  --art-soft: #fce4ec;
  --warn: #9a5b24;
  --warn-soft: #f3ebe0;
  --font-d: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-b: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --sidebar: 260px;
  --bar-h: 56px;
  --reader-width: 90%;
  --reader-max: none;
  --font-base: 17.5px;
  --lh: 1.65;
  --radius: 12px;
  --radius-sm: 8px;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-sidebar: 2px 0 12px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
  --ink: #e8ecef;
  --ink-2: #c5ccd4;
  --ink-3: #8a96a4;
  --paper: #141a18;
  --paper-2: #1e2623;
  --white: #1c2420;
  --sidebar-bg: #1a211e;
  --accent: #52b788;
  --accent-2: #74c69d;
  --accent-soft: #1e3d2e;
  --accent-soft-2: #2a5240;
  --art: #f48fb1;
  --art-soft: #3a1f2c;
  --warn: #e0a868;
  --warn-soft: #2e2418;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-sidebar: 2px 0 16px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-hyphens: auto;
  hyphens: auto;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-b);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--font-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button { font: inherit; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: var(--bar-h) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Toolbar ── */
.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--white) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.brand {
  font-family: var(--font-b);
  font-size: 1rem;
  font-weight: 700;
  color: var(--adaptia);
  text-decoration: none;
  line-height: 1.2;
}
.brand span {
  display: block;
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}
.btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--white) 80%, transparent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft-2); }
.btn-icon { padding: 6px 8px; min-width: 2.15rem; justify-content: center; }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 160px;
  max-width: 280px;
}
.search-wrap input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.search-ico.aic,
.nav-ico.aic,
.tool-ico.aic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}
.search-ico.aic { width: 1rem; height: 1rem; color: var(--ink-3); }
.tool-ico.aic { width: 20px; height: 20px; }
.nav-ico.aic { width: 0.95em; height: 0.95em; vertical-align: -0.12em; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
  flex-shrink: 0;
}
.toolbar-group { display: inline-flex; align-items: center; gap: 4px; }
.toolbar-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--border-subtle);
  margin: 0 2px;
  flex-shrink: 0;
}
.font-label {
  font-size: 11px;
  color: var(--ink-3);
  min-width: 2.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.btn-icon .btn-label { display: none; }
.btn-icon:hover .tool-ico.aic { color: var(--accent); }
.btn-icon.active .tool-ico.aic { color: var(--accent); }
.bm-btn.active .tool-ico.aic { color: var(--warn); fill: currentColor; }
.bm-btn.active .tool-ico.aic svg path { fill: currentColor; }
.btn-primary .tool-ico.aic { color: inherit; }

/* ── Sidebar TOC ── */
.sidebar {
  grid-row: 2;
  grid-column: 1;
  min-height: 0;
  background: var(--sidebar-bg);
  border-right: none;
  box-shadow: var(--shadow-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--paper-2) transparent;
}
.sidebar h2 {
  font-family: var(--font-b);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--adaptia);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.sidebar .meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Progression lecture */
.progress-wrap {
  margin-bottom: 20px;
}
.progress-bar {
  height: 4px;
  background: var(--paper-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--adaptia), var(--accent-2));
  width: 0%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.sidebar .meta.progress-label {
  font-size: 11px;
  margin-bottom: 0;
  color: var(--ink-3);
}
.sidebar .meta.progress-label strong {
  color: var(--accent);
  font-weight: 700;
}

.toc-heading {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.toc-list a {
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.toc-list a:hover { background: var(--accent-soft); color: var(--accent); }
.toc-list a.active {
  background: var(--accent-soft);
  color: var(--adaptia);
  font-weight: 600;
}
.toc-list a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.toc-list .pg {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
  padding-top: 2px;
}
.toc-list .kind-partie { font-weight: 700; margin-top: 8px; }
.toc-list .kind-texte { padding-left: 14px; }
.toc-list .bm { color: var(--warn); font-size: 12px; opacity: 0; }
.toc-list a.bookmarked .bm { opacity: 1; }

.toc-chapters { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.toc-chapter-head {
  display: flex;
  align-items: center;
  gap: 2px;
}
.toc-chapter-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.toc-chapter-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.toc-chapter-toggle .chev {
  width: 14px;
  height: 14px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg);
}
.toc-chapter.expanded .toc-chapter-toggle .chev { transform: rotate(90deg); }

.toc-chapter-link {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
a.toc-chapter-link:hover { background: var(--accent-soft); color: var(--accent); }
.toc-chapter.active > .toc-chapter-head a.toc-chapter-link {
  background: var(--accent-soft);
  color: var(--adaptia);
  font-weight: 700;
}
.toc-chapter.active > .toc-chapter-head a.toc-chapter-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.toc-chapter.disabled .toc-chapter-link {
  color: var(--ink-3);
  font-weight: 500;
  cursor: default;
}
.toc-chapter .soon {
  display: inline-block;
  margin-left: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0.85;
}

.toc-sections {
  list-style: none;
  margin: 4px 0 8px 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-sections a {
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.toc-sections a:hover { background: var(--accent-soft); color: var(--accent); }
.toc-sections a.active {
  background: var(--accent-soft);
  color: var(--adaptia);
  font-weight: 600;
}
.toc-sections a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.toc-sections .pg {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
  padding-top: 2px;
}
.toc-sections .kind-partie { font-weight: 700; margin-top: 6px; }
.toc-sections .kind-texte { padding-left: 10px; }
.toc-sections .bm { color: var(--warn); font-size: 12px; opacity: 0; }
.toc-sections a.bookmarked .bm { opacity: 1; }

.loading, .coming-soon {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-3);
  font-size: 15px;
}
.coming-soon strong { display: block; color: var(--ink); font-size: 1.2rem; margin-bottom: 8px; }

/* ── Zone lecture ── */
.main {
  grid-row: 2;
  grid-column: 2;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(45, 106, 79, 0.05), transparent 60%),
    var(--paper);
  scrollbar-width: thin;
  scrollbar-color: var(--paper-2) transparent;
}
html[data-theme="dark"] .main {
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(82, 183, 136, 0.06), transparent 60%),
    var(--paper);
}

.reader {
  width: var(--reader-width);
  max-width: var(--reader-max);
  margin: 0 auto;
  padding: 24px 12px 80px;
}

.banner {
  background: var(--warn-soft);
  border: none;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.banner strong { color: var(--warn); }

.empty {
  padding: 20px 18px;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}
.empty .btn { margin-top: 10px; }

.section {
  margin-bottom: 2.8rem;
  scroll-margin-top: calc(var(--bar-h) + 16px);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.section-head h2 {
  font-family: var(--font-d);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--adaptia);
}
.section-head .meta-line {
  font-family: var(--font-b);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 5px;
}

.badge {
  display: inline-block;
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
}
.badge.texte { background: var(--art-soft); color: var(--art); }
.badge.matiere, .badge.cine, .badge.lexique { background: var(--warn-soft); color: var(--warn); }

.block { margin-bottom: 1.5rem; }

.page-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.page-chip a { color: var(--accent); text-decoration: none; }
.page-chip a:hover { text-decoration: underline; }

/* Contenu prose — largeur manuel (pas de colonne étroite) */
.prose {
  font-family: var(--font-d);
  font-size: 1.02em;
  color: var(--ink);
  max-width: none;
}
.prose p,
.texte-intro p,
.texte-commentaire p {
  margin-bottom: 0.9em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}
.prose blockquote p,
.texte-corpus p,
.texte-corpus .dialogue,
.prose .dialogue,
.texte-commentaire .dialogue {
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}
.prose mark {
  background: #ffe08a;
  color: #1a2330;
  padding: 0 2px;
  border-radius: 2px;
}
html[data-theme="dark"] .prose mark { background: #a67c00; color: #fff; }

/* Rubriques manuel — accents couleur */
.section.partie .section-head,
.section.rubrique-partie .section-head { border-bottom-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle)); }
.section.rubrique-texte .section-head { border-bottom-color: color-mix(in srgb, var(--art) 30%, var(--border-subtle)); }
.section.rubrique-matiere .section-head { border-bottom-color: color-mix(in srgb, var(--warn) 30%, var(--border-subtle)); }
.section.rubrique-cine .section-head { border-bottom-color: color-mix(in srgb, #5c6bc0 30%, var(--border-subtle)); }
.section.rubrique-lexique .section-head { border-bottom-color: color-mix(in srgb, #7b5ea7 30%, var(--border-subtle)); }

/* Cartes contenu — fond léger type manuel, sans cadres lourds */
.section-content {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.section-faithful .section-content {
  padding: 0;
}

.section-faithful .section-head {
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.section-pages {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.book-page {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
}

.book-page::before {
  content: "p. " attr(data-page);
  position: absolute;
  top: -2px;
  right: 0;
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  opacity: 0.6;
}

.page-grid {
  display: grid;
  gap: 1.5rem 2rem;
  align-items: start;
}
.layout-two-col { grid-template-columns: 0.92fr 1.08fr; }
.layout-figure-left { grid-template-columns: minmax(200px, 40%) 1fr; }
.layout-single .page-main { max-width: 100%; }

.page-col-left {
  padding-right: 16px;
  border-right: none;
}
.layout-figure-left .page-col-left {
  position: relative;
}
.layout-figure-left .page-col-left::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.page-col-right { padding-left: 4px; }
.page-figures { display: flex; flex-direction: column; gap: 1rem; }

/* Rubriques type Le Robert */
.rubrique-box {
  margin: 1rem 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: none;
  border-left: none;
  font-size: 0.96em;
}
.rubrique-box.encadre {
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--white));
  color: var(--ink);
}
.rubrique-box.quote {
  background: #faf6ed;
}
html[data-theme="dark"] .rubrique-box.encadre {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
html[data-theme="dark"] .rubrique-box.quote {
  background: #2e2418;
  border-left-color: #e0a868;
}

/* ── Structure pédagogique Texte N ── */
.page-ref { display: none; }

.texte-semantic { margin-bottom: 2rem; }

.texte-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 14px 18px;
  margin-bottom: 1.4rem;
  background: linear-gradient(135deg, var(--adaptia), var(--accent));
  border-radius: var(--radius-sm);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.texte-num {
  font-family: var(--font-b);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
}

.texte-titre,
.prose .texte-header .texte-titre,
.prose .texte-header h3.texte-titre {
  font-family: var(--font-d);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  flex: 1 1 auto;
  color: #fff;
}

.texte-author,
.texte-header .texte-author {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
}

.texte-body { color: var(--ink); }

.texte-intro {
  margin-bottom: 1.4rem;
  padding: 0;
  color: var(--ink);
}

.texte-corpus {
  display: block;
  margin: 1.4rem 0;
  padding: 16px 18px;
  background: #faf8f4;
  border: none;
  border-left: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-d);
  font-style: italic;
  color: var(--ink);
  line-height: 1.7;
}
/* Numéros de ligne du manuel (repère citation, ex. "l. 12-15") : rendus
   dans une colonne dédiée à gauche du texte (comme dans le livre papier),
   positionnés par JS au décalage vertical exact du mot ancré (voir
   positionLineNumbers() dans ebook.js). Recalculé au chargement, au
   redimensionnement et à chaque changement de taille de police / largeur
   de colonne, donc reste juste après reflow. L'ancre elle-même (span
   .line-num) est invisible et ne prend aucune place dans le texte ; seul
   le clone injecté dans .line-num-gutter est visible. */
.texte-corpus.has-line-numbers {
  position: relative;
  padding-left: 2.6em;
}
.texte-corpus .line-num {
  display: inline-block;
  width: 0;
  height: 0;
  overflow: hidden;
}
.line-num-gutter {
  position: absolute;
  left: 0;
  width: 2.1em;
  text-align: right;
  font-style: normal;
  font-size: 0.7em;
  color: var(--ink-2, #8a8a8a);
  user-select: none;
  pointer-events: none;
  line-height: 1;
}
.texte-corpus blockquote {
  background: transparent;
  border: none;
  border-left: none;
  padding-left: 0;
  margin: 0.6rem 0;
  color: var(--ink);
}
.texte-corpus p,
.texte-corpus .dialogue { font-style: italic; color: var(--ink); }
html[data-theme="dark"] .texte-corpus {
  background: #2e2418;
}

.texte-meta {
  font-family: var(--font-b);
  font-size: 0.82em;
  font-style: normal;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0.4rem 0 1.2rem;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  border: none;
}

.texte-commentaire {
  margin: 1.4rem 0;
  padding: 0;
  border-left: none;
  color: var(--ink);
}

.texte-questions {
  margin: 1.4rem 0;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--white));
  border: none;
  border-radius: var(--radius-sm);
}

.texte-questions .exercices { margin: 0; padding: 0; background: transparent; border: 0; }
.texte-questions .exercices li { color: var(--ink); }

/* Encadrés inline — ids = meta/rubriques-types.json */
.texte-body .encadre-conscience,
.texte-body .encadre-dit-aussi,
.texte-body .encadre-reperes,
.texte-body .encadre-frontieres,
.texte-body .encadre-matiere,
.texte-body .encadre-matiere-inline,
.texte-body .encadre-cine,
.texte-body .encadre-cine-inline,
.texte-body .encadre-lexique,
.texte-body .encadre-lexique-inline,
.texte-body .encadre-vers-bac,
.texte-body .encadre-arret-sur-image,
.texte-body .encadre-encadre {
  border: none;
  border-left: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.texte-body .encadre-conscience {
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--white));
}
.texte-body .encadre-dit-aussi { background: #faf6ed; }
html[data-theme="dark"] .texte-body .encadre-dit-aussi { background: #2e2418; }
.texte-body .encadre-reperes {
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--white));
}
.texte-body .encadre-frontieres { background: #f0f4f8; }
html[data-theme="dark"] .texte-body .encadre-frontieres { background: #1e2830; }
.texte-body .encadre-matiere,
.texte-body .encadre-matiere-inline { background: var(--warn-soft); }
.texte-body .encadre-cine,
.texte-body .encadre-cine-inline { background: #e8eaf6; }
html[data-theme="dark"] .texte-body .encadre-cine,
html[data-theme="dark"] .texte-body .encadre-cine-inline { background: #1a1f3a; }
.texte-body .encadre-lexique,
.texte-body .encadre-lexique-inline { background: #f3eef8; }
html[data-theme="dark"] .texte-body .encadre-lexique,
html[data-theme="dark"] .texte-body .encadre-lexique-inline { background: #2a1f3a; }
.texte-body .encadre-vers-bac { background: #fcdc68; color: #1a1a1a; }
html[data-theme="dark"] .texte-body .encadre-vers-bac { background: #5c4a10; color: var(--ink); }
.texte-body .encadre-arret-sur-image {
  background: color-mix(in srgb, var(--art) 8%, var(--white));
}

/* Rubriques annexes / sections */
.rubrique-dit-aussi { background: #faf6ed; }
.rubrique-reperes { background: color-mix(in srgb, var(--accent-soft) 45%, var(--white)); }
.rubrique-frontieres { background: #f0f4f8; }
.rubrique-matiere { background: var(--warn-soft); }
.rubrique-mots { background: #f3eef8; }
.rubrique-cinephilo,
.rubrique-cine { background: #e8eaf6; }
.rubrique-vers-bac { background: #fcdc68; color: #1a1a1a; }
html[data-theme="dark"] .rubrique-dit-aussi,
html[data-theme="dark"] .texte-body .encadre-dit-aussi { background: #2e2418; }
html[data-theme="dark"] .rubrique-frontieres { background: #1e2830; }
html[data-theme="dark"] .rubrique-cinephilo,
html[data-theme="dark"] .rubrique-cine { background: #1a1f3a; }
html[data-theme="dark"] .rubrique-vers-bac { background: #5c4a10; color: var(--ink); }

.rubrique-philosophe,
.texte-philosophe {
  background: #faf8f4;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-family: var(--font-d);
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
}
aside.auteur-fiche {
  float: right;
  max-width: 11rem;
  margin: 0 0 0.8rem 1rem;
  padding: 0.55rem 0.7rem;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--white));
  border-left: 3px solid var(--accent);
  font-family: var(--font-b);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
  color: var(--ink-muted, var(--ink));
}
aside.auteur-fiche p { margin: 0; }
html[data-theme="dark"] aside.auteur-fiche {
  background: #2a2430;
  border-left-color: var(--accent);
}
html[data-theme="dark"] .rubrique-philosophe,
html[data-theme="dark"] .texte-philosophe,
html[data-theme="dark"] .texte-corpus { background: #2e2418; }

.rubrique-matiere,
.rubrique-cine,
.rubrique-mots,
.rubrique-panorama,
.partie-titre,
.rubrique-ouverture {
  margin-bottom: 1.6rem;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: none;
  border-left: none;
  color: var(--ink);
}
.rubrique-matiere { background: var(--warn-soft); }
.rubrique-cine { background: #e8eaf6; }
html[data-theme="dark"] .rubrique-cine { background: #1a1f3a; }
.rubrique-mots { background: #f3eef8; }
html[data-theme="dark"] .rubrique-mots { background: #2a1f3a; }
.rubrique-panorama { background: color-mix(in srgb, var(--accent-soft) 40%, var(--white)); }
.partie-titre { background: color-mix(in srgb, var(--accent-soft) 25%, var(--white)); }

.matiere-header h3,
.cine-header h3,
.mots-header h3,
.panorama-header h3,
.partie-header h3,
.ouverture-header h3,
.dit-aussi-header h3,
.reperes-header h3,
.frontieres-header h3,
.vers-bac-header h3 {
  font-family: var(--font-d);
  font-size: 1.15rem;
  margin: 0 0 0.8rem;
  color: var(--adaptia);
}
.partie-intro { font-family: var(--font-d); }

/* Partie partagée avec la 1re page de Texte (pas de fond, juste le titre +
   le paragraphe d'ouverture avec les renvois (texte N, Auteur) en couleur
   d'accent du chapitre, comme dans le manuel imprimé). */
.partie-lead { margin-bottom: 1.8rem; }
.partie-lead h2 {
  font-family: var(--font-d);
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.9rem;
  color: var(--ink);
}
.partie-lead p { margin: 0; }
.partie-lead .partie-ref {
  color: var(--art, var(--accent));
  font-weight: 700;
  font-style: normal;
}
/* "La notion en question" (page d'intro de chapitre, ex. p.18 du chapitre
   Art) : titre + paragraphe d'accroche + liste de sous-thèmes numérotés en
   amorce colorée dans le paragraphe (pas des titres séparés), avec le
   renvoi de pages en couleur à la fin, fidèle à la mise en page imprimée. */
.rubrique-intro-question h1 {
  font-family: var(--font-d);
  font-size: 2.1rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 1.3rem;
  color: var(--ink);
}
.rubrique-intro-question .intro-lead { margin-bottom: 1.4rem; }
.rubrique-intro-question .intro-item { margin: 0 0 1.1rem; }
.rubrique-intro-question .intro-num,
.rubrique-intro-question .intro-pages {
  color: var(--art, var(--accent));
  font-weight: 700;
}
.rubrique-intro-question .intro-num { text-transform: uppercase; margin-right: 0.3em; }

.partie-lead .partie-tag {
  display: block;
  font-family: var(--font-b);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--art, var(--accent));
  margin-bottom: 0.3rem;
}

/* Scan miroir */
.texte-pages-scan,
.rubrique-pages-scan {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border-subtle);
  opacity: 0.75;
}
.texte-pages-scan::before,
.rubrique-pages-scan::before {
  content: "Mise en page scan (référence)";
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1rem;
}
.section.rubrique-texte + .section.rubrique-texte,
.section.rubrique-texte { border-bottom: none; padding-bottom: 2rem; }

@media print {
  .texte-pages-scan,
  .rubrique-pages-scan { display: none; }
}

/* Figures */
figure.illus-left,
figure.illus-right,
figure.illus-center,
figure.illus-full { margin: 0.4rem 0 0.8rem; }

/* Habillage : l'image se place sur le côté et le texte l'entoure,
   comme dans la mise en page du manuel. */
figure.illus-left {
  float: left;
  width: min(44%, 320px);
  margin: 0.35rem 1.3rem 0.7rem 0;
}
figure.illus-right {
  float: right;
  width: min(44%, 320px);
  margin: 0.35rem 0 0.7rem 1.3rem;
}
figure.illus-full { clear: both; width: 100%; }
figure.illus-center { clear: both; text-align: center; }

figure.illus-left img,
figure.illus-right img,
figure.illus-center img,
figure.illus-full img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow-sm);
}
figure.illus-full img { width: 100%; }
.layout-figure-left .page-figures figure.illus-left { margin-top: 0; }

/* Contenir les figures flottantes dans leur colonne / page */
.page-main.prose::after,
.page-col-right.prose::after,
.page-col-left.prose::after,
.section-content::after { content: ""; display: block; clear: both; }

figure.illus-left figcaption,
figure.illus-right figcaption,
figure.illus-center figcaption,
figure.illus-full figcaption,
figure.illus figcaption {
  margin-top: 10px;
  font-family: var(--font-b);
  font-size: 0.82em;
  color: var(--ink-3);
  font-style: italic;
  line-height: 1.45;
}

.prose h3:not(.texte-titre) {
  font-family: var(--font-d);
  font-size: 1.1em;
  font-weight: 600;
  margin: 1.5em 0 0.6em;
  color: var(--adaptia);
}
.prose blockquote {
  margin: 1rem 0 1.2rem;
  padding: 14px 18px;
  border: none;
  border-left: none;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--white));
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--ink);
}
.prose blockquote p { margin-bottom: 0; }
.prose .dialogue {
  margin-left: 0;
  padding-left: 12px;
  border-left: none;
  font-style: italic;
}
.prose ul.exercices {
  list-style: none;
  margin: 1rem 0 1.4rem;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--accent-soft) 30%, var(--white));
  border: none;
  border-radius: var(--radius-sm);
}
.prose ul.exercices li {
  position: relative;
  padding: 6px 0 6px 24px;
  font-weight: 600;
  color: var(--ink);
}
.prose ul.exercices li::before {
  content: "?";
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
}
.prose ol.section-list {
  list-style: decimal;
  margin: 1rem 0 1.4rem 1.2rem;
  padding: 0;
}
.prose ol.section-list li {
  margin: 0.75rem 0;
  padding-left: 0.4rem;
  line-height: 1.55;
}
.prose ol.section-list li::marker {
  font-weight: 700;
  color: var(--accent);
}
.encadre-label {
  display: inline-block;
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  margin: 1.2rem 0 0.6rem;
}
figure.illus {
  margin: 1.2rem 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  text-align: center;
}
figure.illus img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Footer navigation */
.footer-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--white) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  z-index: 10;
}

body.sidebar-collapsed .app { grid-template-columns: 0 1fr; }
body.sidebar-collapsed .sidebar {
  overflow: hidden;
  padding: 0;
  border: 0;
  box-shadow: none;
  min-width: 0;
}
body.sidebar-collapsed .reader {
  width: var(--reader-width);
  max-width: none;
}

figure.illus-mindmap,
figure.illus-center.mindmap-block figure {
  margin: 0.6rem auto 1.2rem;
  max-width: min(100%, 920px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
figure.illus-mindmap img {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto;
  max-height: min(85vh, 1100px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  border: none;
  border-radius: 4px;
  background: #fff;
}
.mindmap-block {
  margin: 0 0 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.layout-mindmap .page-main {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* OCR résiduel sous carte mentale (anciens contenus) — garder le lien « Voir la page » */
.section-content:has(.illus-mindmap) .page-main.prose > p {
  display: none;
}

.page-source-link-wrap {
  margin: 1.25rem 0 0;
  text-align: right;
}
.page-source-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-b);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.page-source-link:hover {
  color: var(--accent);
}

.page-source-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.page-source-modal.open {
  display: flex;
}
.page-source-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 28, 0.55);
}
.page-source-modal-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 920px);
  max-height: 92vh;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-source-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.page-source-modal-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.page-source-modal-body {
  overflow: auto;
  padding: 12px;
  background: #f4f4f2;
}
.page-source-modal-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}
body.page-source-open {
  overflow: hidden;
}

/* ── Mode page fidèle (scan HD — popup uniquement) ── */
.faithful-pages {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

figure.page-faithful {
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: center;
}

figure.page-faithful img.page-full,
img.page-full {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: none;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  background: #fff;
}

.page-full-caption {
  margin-top: 8px;
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-pages.layout-faithful {
  max-width: none;
}

details.ocr-fallback {
  margin-top: 1rem;
  padding: 12px 14px;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  font-size: 0.92em;
}

details.ocr-fallback summary {
  cursor: pointer;
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  user-select: none;
}

details.ocr-fallback .ocr-fallback-body {
  margin-top: 12px;
  opacity: 0.85;
}

html[data-theme="dark"] figure.page-faithful img.page-full {
  background: #fff;
}

/* Mode édition */
.edit-toolbar { display: inline-flex; align-items: center; gap: 6px; }
body.edit-mode .banner {
  background: color-mix(in srgb, var(--accent) 12%, var(--warn-soft));
}
body.edit-mode .banner strong { color: var(--accent); }
body.edit-mode .section-content {
  border: 2px dashed var(--accent-soft-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
  margin-bottom: 4px;
}
body.edit-mode .section-head h2 {
  outline: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 4px;
  border-radius: 4px;
}
body.edit-mode .section-content [contenteditable="true"] {
  outline: 1px dashed color-mix(in srgb, var(--accent) 25%, transparent);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
}
body.edit-mode .section-content [contenteditable="true"]:focus {
  outline: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 50%, transparent);
}
body.edit-mode .search-wrap input { opacity: 0.55; pointer-events: none; }

/* Responsive */
@media (max-width: 1366px) {
  .reader { padding: 24px 16px 72px; }
  .section-content { padding: 20px 22px; }
  .section-head h2 { font-size: 1.4rem; }
}

@media (max-width: 900px) {
  .layout-two-col,
  .layout-figure-left { grid-template-columns: 1fr; }
  .page-col-left {
    padding-right: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .layout-figure-left .page-col-left::after { display: none; }
  /* En colonne unique, les figures cessent de flotter pour rester lisibles */
  figure.illus-left,
  figure.illus-right {
    float: none;
    width: 100%;
    margin: 0.6rem 0 0.9rem;
  }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--bar-h) auto minmax(0, 1fr);
  }
  .sidebar {
    grid-row: 2;
    grid-column: 1;
    max-height: 240px;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: none;
  }
  .main {
    grid-row: 3;
    grid-column: 1;
    min-height: 0;
  }
  body.sidebar-collapsed .sidebar { max-height: 0; overflow: hidden; padding: 0; border: 0; }
  body.sidebar-collapsed .app { grid-template-rows: var(--bar-h) minmax(0, 1fr); }
  .search-wrap { max-width: none; flex-basis: 100%; order: 3; }
  .toolbar-sep { display: none; }
  .section-content { padding: 18px 16px; border-radius: var(--radius-sm); }
}

@media print {
  html, body { height: auto; overflow: visible; }
  .topbar, .sidebar, .footer-nav, .btn, .search-wrap, .banner { display: none !important; }
  .app { display: block; height: auto; overflow: visible; }
  .main { overflow: visible; background: #fff; }
  .reader { max-width: none; padding: 0; }
  .section { break-inside: avoid-page; }
  .section-content { box-shadow: none; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}

/* =========================================================================
   Phase 2a — rendu structuré fidèle (page_structure)
   Titres balisés, encadrés <aside class="encadre">, textes d'auteur.
   N'écrase pas les règles figures/encadrés existantes ; réutilise var(--…).
   ========================================================================= */

/* Titres de page (issus de l'analyse de structure) */
.page-main.prose h2.page-title {
  font-family: var(--font-d);
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--adaptia);
  margin: 0.2rem 0 1rem;
  padding-bottom: 6px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}
.page-main.prose h3.page-subtitle {
  font-family: var(--font-d);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 1.3rem 0 0.7rem;
}

/* Texte d'auteur (extrait cité) : corps serif, filet latéral discret.
   Les numéros de ligne du manuel sont EXCLUS du flux (non réaffichés) ;
   aucune marge dédiée n'est donc nécessaire ici. */
.texte-auteur {
  font-family: var(--font-d);
  color: var(--ink);
  margin: 0.9rem 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
}
.texte-auteur p { margin: 0 0 0.7rem; }
.texte-auteur p:last-child { margin-bottom: 0; }

/* Encadrés colorés du manuel → <aside class="encadre encadre-{kind}"> */
aside.encadre {
  margin: 1.2rem 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--white));
  color: var(--ink);
  font-size: 0.96em;
  box-shadow: var(--shadow-sm);
}
aside.encadre .encadre-titre {
  font-family: var(--font-b);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.82em;
  color: var(--accent);
  margin-bottom: 8px;
}
aside.encadre .encadre-corps p { margin: 0 0 0.6rem; }
aside.encadre .encadre-corps p:last-child { margin-bottom: 0; }
aside.encadre .encadre-source {
  margin: 8px 0 0;
  font-family: var(--font-b);
  font-size: 0.8em;
  font-style: italic;
  color: var(--ink-3);
}
aside.encadre .encadre-question {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-family: var(--font-b);
  font-weight: 600;
  color: var(--accent);
}

/* Variantes de rubriques (mêmes teintes que les encadrés inline existants) */
aside.encadre.encadre-dit-aussi { background: #faf6ed; }
aside.encadre.encadre-frontieres { background: #f0f4f8; }
aside.encadre.encadre-matiere { background: var(--warn-soft); }
aside.encadre.encadre-cine { background: #e8eaf6; }
aside.encadre.encadre-lexique { background: #f3eef8; }
aside.encadre.encadre-reperes {
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--white));
}
aside.encadre.encadre-vers-bac { background: #fcdc68; color: #1a1a1a; }
aside.encadre.encadre-arret-sur-image {
  background: color-mix(in srgb, var(--art) 8%, var(--white));
}
html[data-theme="dark"] aside.encadre.encadre-dit-aussi { background: #2e2418; }
html[data-theme="dark"] aside.encadre.encadre-frontieres { background: #1e2830; }
html[data-theme="dark"] aside.encadre.encadre-cine { background: #1a1f3a; }
html[data-theme="dark"] aside.encadre.encadre-lexique { background: #2a1f3a; }
html[data-theme="dark"] aside.encadre.encadre-vers-bac { background: #5c4a10; color: var(--ink); }

/* Marqueur « TEXTE XX » (sur-titre discret) + titre principal promu.
   Surcharge la règle .texte-titre (blanc sur dégradé) réservée au bandeau
   .texte-header, pour le titre de page rendu en prose. */
.page-main.prose .texte-marqueur {
  font-family: var(--font-b);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0.4rem 0 0.15rem;
}
.page-main.prose h2.texte-titre {
  font-family: var(--font-d);
  font-size: 1.55rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--adaptia);
  background: none;
  margin: 0.1rem 0 1rem;
  padding-bottom: 6px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}

/* Dialogues (théâtre / échanges avec locuteurs) : répliques distinctes. */
.dialogue-block {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dialogue-block p { margin: 0; }
.dialogue-block .replique {
  padding-left: 1.6em;
  text-indent: -1.6em;
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}
.dialogue-block .replique .locuteur {
  font-family: var(--font-b);
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-right: 0.4em;
}
.texte-auteur .dialogue-block .replique .locuteur,
.texte-corpus .dialogue-block .replique .locuteur { color: var(--accent); }

@media (max-width: 900px) {
  .page-main.prose h2.page-title { font-size: 1.35rem; }
  .page-main.prose h3.page-subtitle { font-size: 1.1rem; }
  .page-main.prose h2.texte-titre { font-size: 1.3rem; }
  .texte-auteur { padding-left: 12px; }
  aside.encadre { padding: 12px 14px; }
}
