/* ===========================================================
   Verisimilis — CSS dédié au lecteur (page de lecture du livre)
   Ce fichier complète style.css uniquement pour les pages /fr/livre/*
   
   Améliorations v2 (mai 2026) :
   - Théorie présentée en texte libre (flux principal)
   - Méthode et Baudelaire en blocs colorés discrets
   - Encadrés citations/exemples optionnels (.reader-exergue)
   - Sommaire plus contrasté
   - Espacements internes resserrés pour fluidité de lecture
   - Tailles de texte étendues : très petit à très grand
   - Poème épinglé déplaçable (drag and drop)
   - Barre de contrôles sticky avec bouton fermeture
   =========================================================== */

/* Variables supplémentaires pour le lecteur */
.reader-body {
  --reader-text-size: 1.05rem;
  --reader-line-height: 1.85;
  --reader-content-width: 42rem;
  --reader-toc-width: 18rem;
}

.reader-main-wrapper {
  min-height: calc(100vh - 80px);
}

/* ===========================================================
   Barre supérieure de navigation
   =========================================================== */

.reader-topbar {
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 72px;
  z-index: 40;
  backdrop-filter: blur(6px);
  background: rgba(243, 239, 231, 0.95);
}

.reader-topbar-inner {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.reader-back {
  font-family: var(--sans);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  border-bottom: none;
}

.reader-back:hover { color: var(--accent); }

.reader-position {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--sans);
  font-size: var(--text-sm);
}

.reader-position-label {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--text-xs);
}

.reader-position-current {
  color: var(--ink);
  font-weight: 500;
}

.reader-nav-arrows {
  display: flex;
  gap: var(--space-3);
  font-family: var(--serif);
  font-size: var(--text-lg);
}

.reader-nav-arrows a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: none;
}

.reader-nav-arrows a:hover { color: var(--accent); }

.reader-nav-disabled {
  color: var(--ink-faint);
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===========================================================
   Layout en deux colonnes : TOC + Contenu
   =========================================================== */

.reader-layout {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) var(--space-8);
  display: grid;
  grid-template-columns: var(--reader-toc-width) 1fr;
  gap: var(--space-7);
  align-items: start;
}

/* ===========================================================
   Table des matières latérale (fond plus contrasté)
   =========================================================== */

.reader-toc {
  position: sticky;
  top: 140px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: var(--space-4) var(--space-3) var(--space-4) var(--space-4);
  background: var(--paper-warm);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
}

.reader-toc-toggle { display: none; }

.reader-toc-title {
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
  border: none;
  padding: 0;
}

.reader-toc-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-faint);
  margin-bottom: var(--space-4);
}

.reader-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reader-toc-list li { margin: 0; }

.reader-toc-list a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-family: var(--serif);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  border-bottom: none;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.reader-toc-list a:hover {
  background: var(--paper);
  color: var(--ink);
  border-left-color: var(--line);
}

.reader-toc-list a.active {
  background: var(--paper);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.reader-toc-num {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  margin-right: var(--space-2);
}

.reader-toc-list a.active .reader-toc-num { color: var(--accent); }

.reader-toc-preview {
  display: block;
  font-size: 0.88em;
  color: var(--ink-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Petit indicateur de signet dans la TOC */
.reader-toc-bookmark {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: var(--space-1);
  vertical-align: middle;
}

/* ===========================================================
   Contenu principal de lecture
   =========================================================== */

.reader-content {
  max-width: var(--reader-content-width);
  width: 100%;
}

.reader-header {
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.reader-eyebrow {
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: var(--space-4);
}

.reader-title {
  font-family: var(--serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: var(--space-5);
  border: none;
  padding: 0;
}

.reader-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: var(--space-6);
}

.reader-legend {
  background: var(--paper-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line-soft);
  font-size: var(--text-sm);
}

.reader-legend-title {
  font-family: var(--sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.reader-legend-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.reader-legend-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  color: var(--ink-soft);
}

.reader-legend-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.reader-legend-theorie {
  background: transparent;
  border: 1px dashed var(--ink-faint);
}
.reader-legend-methode { background: var(--accent); }
.reader-legend-baudelaire { background: #a6843c; }

/* ===========================================================
   Barre de contrôles sticky avec fermeture
   =========================================================== */

.reader-controls-wrapper {
  position: sticky;
  top: 130px;
  z-index: 30;
  margin: var(--space-5) 0 var(--space-6);
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  transition: all 0.2s ease;
}

.reader-controls-wrapper.collapsed .reader-controls {
  display: none;
}

.reader-controls-wrapper.collapsed {
  background: transparent;
  border-color: transparent;
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 36px var(--space-2) var(--space-3);
  flex-wrap: nowrap;
  overflow: hidden;
}

.reader-controls-close {
  position: absolute;
  top: 50%;
  right: var(--space-2);
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: var(--text-base);
  padding: var(--space-1) var(--space-2);
  line-height: 1;
  border-radius: var(--radius-sm);
}

.reader-controls-close:hover {
  color: var(--accent);
  background: var(--paper-soft);
}

.reader-controls-reopen {
  display: none;
  position: sticky;
  top: 130px;
  z-index: 30;
  margin: var(--space-3) 0;
  align-self: flex-start;
  padding: var(--space-2) var(--space-3);
  background: var(--paper-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  cursor: pointer;
}

.reader-controls-reopen:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.reader-controls-wrapper.collapsed + .reader-controls-reopen {
  display: inline-block;
}

.reader-control-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.reader-control-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.reader-control-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.reader-control-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-control-btn.active,
.reader-control-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.reader-control-text { font-size: 0.82rem; }

/* ===========================================================
   Paragraphes : la Théorie en flux libre, M et B en blocs
   =========================================================== */

.reader-paragraphs {
  font-size: var(--reader-text-size);
  line-height: var(--reader-line-height);
}

.reader-paragraph {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);  /* encore réduit */
  scroll-margin-top: 200px;
  position: relative;
}

.reader-paragraph-num {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: none;
  padding-top: 0.25rem;
  text-align: right;
  font-weight: 500;
  position: sticky;
  top: 200px;
  align-self: start;
  height: fit-content;
  transition: color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}

.reader-paragraph-num:hover { color: var(--accent); }

.reader-paragraph:target .reader-paragraph-num {
  color: var(--accent);
  font-weight: 600;
}

/* Bouton de signet attaché au numéro — TRÈS discret par défaut */
.reader-bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9em;
  color: var(--ink-faint);
  padding: 2px 4px;
  line-height: 1;
  border-radius: var(--radius-sm);
  opacity: 0.22;  /* très atténué */
  transition: all 0.18s ease;
}

.reader-bookmark-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.reader-paragraph:hover .reader-bookmark-btn {
  opacity: 0.6;  /* un peu plus visible au survol du paragraphe */
}

.reader-bookmark-btn.active {
  opacity: 0.85;
  color: var(--accent);
}

.reader-bookmark-btn.active:hover {
  opacity: 1;
}

.reader-paragraph-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;  /* très resserré pour la fluidité */
}

/* THÉORIE — texte libre, sans cadre, c'est le flux principal */
.reader-block-theorie {
  padding: 0;
  background: transparent;
  border: none;
  margin: 0;
}

.reader-block-theorie .reader-block-label {
  display: none;  /* on n'affiche pas le label pour la théorie */
}

.reader-block-theorie p {
  margin: 0;
  font-size: var(--reader-text-size);
  line-height: var(--reader-line-height);
  color: var(--ink);
  padding: 4px 0;
}

/* MÉTHODE — bloc bordeaux discret, en marge du flux */
.reader-block-methode {
  position: relative;
  padding: 8px var(--space-3) 8px var(--space-4);
  background: rgba(107, 31, 26, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.reader-block-methode .reader-block-label {
  font-family: var(--sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-1);
}

/* BAUDELAIRE — bloc doré discret */
.reader-block-baudelaire {
  position: relative;
  padding: 8px var(--space-3) 8px var(--space-4);
  background: rgba(166, 132, 60, 0.06);
  border-left: 3px solid #a6843c;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.reader-block-baudelaire .reader-block-label {
  font-family: var(--sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: #8a6730;
  margin-bottom: var(--space-1);
}

.reader-block p {
  margin: 0;
  font-size: var(--reader-text-size);
  line-height: var(--reader-line-height);
  color: var(--ink);
}

.reader-block p:not(:last-child) {
  margin-bottom: var(--space-3);
}

/* Surbrillance temporaire quand on saute à un paragraphe */
.reader-paragraph:target {
  animation: highlight-paragraph 2.5s ease;
}

@keyframes highlight-paragraph {
  0% { background: rgba(166, 132, 60, 0.12); border-radius: var(--radius-md); }
  100% { background: transparent; border-radius: var(--radius-md); }
}

/* ===========================================================
   Encadrés "exergue" pour citations et exemples
   (utilisables dans les pages méthode, auteur, etc.)
   =========================================================== */

.reader-exergue,
.prose .exergue {
  background: var(--paper-warm);
  border-left: 2px solid var(--line);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95em;
  color: var(--ink-soft);
}

.reader-exergue p:last-child,
.prose .exergue p:last-child {
  margin-bottom: 0;
}

.exergue-label {
  display: block;
  font-family: var(--sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* ===========================================================
   Pied de page navigation suite
   =========================================================== */

.reader-footer-nav {
  margin-top: var(--space-9);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.reader-footer-next,
.reader-footer-prev {
  padding: var(--space-4) var(--space-5);
  background: var(--paper-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
}

.reader-footer-next { text-align: right; }

.reader-footer-label {
  display: block;
  font-family: var(--sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}

.reader-footer-title {
  display: block;
  font-family: var(--serif);
  font-size: var(--text-base);
  color: var(--ink);
  font-style: italic;
}

/* ===========================================================
   Panneau de signets et notes
   =========================================================== */

.reader-side-tools {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.reader-side-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.reader-side-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-bookmarks-panel {
  position: fixed;
  top: 200px;  /* sous la barre de contrôles sticky */
  right: var(--space-6);
  z-index: 70;
  width: 24rem;
  max-width: calc(100vw - 2rem);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: var(--space-4);
  display: none;
}

.reader-bookmarks-panel.open {
  display: block;
  animation: panel-enter 0.2s ease;
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reader-bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.reader-bookmarks-title {
  font-family: var(--sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  font-weight: 600;
}

.reader-bookmarks-export {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--accent);
  text-decoration: underline;
}

.reader-bookmarks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-bottom: var(--space-3);
}

.reader-bookmarks-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.reader-bookmarks-list a {
  font-family: var(--serif);
  font-size: var(--text-sm);
  color: var(--ink);
  border-bottom: none;
  flex: 1;
}

.reader-bookmark-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: var(--text-sm);
  padding: 2px var(--space-1);
}

.reader-bookmark-delete:hover { color: var(--accent); }

.reader-bookmarks-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-faint);
  text-align: center;
  padding: var(--space-3) 0;
}

.reader-note-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--serif);
  font-size: var(--text-sm);
  color: var(--ink);
  resize: vertical;
  min-height: 4rem;
  font-style: italic;
}

.reader-note-display {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9em;
  color: var(--accent);
  padding: 4px 8px;
  background: rgba(107, 31, 26, 0.05);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

/* ===========================================================
   Poème épinglé déplaçable
   =========================================================== */

.poem-pinned {
  position: fixed;
  top: 150px;
  right: var(--space-5);
  z-index: 80;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  animation: poem-pinned-enter 0.3s ease;
}

@keyframes poem-pinned-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.poem-pinned[hidden] { display: none; }

.poem-pinned-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-soft);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  cursor: move;
  user-select: none;
}

.poem-pinned-header:active {
  cursor: grabbing;
}

.poem-pinned-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.poem-pinned-drag-hint {
  font-size: var(--text-xs);
  color: var(--ink-faint);
  margin-right: var(--space-2);
}

.poem-pinned-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-base);
  color: var(--ink-faint);
  padding: var(--space-1) var(--space-2);
  line-height: 1;
  border-radius: var(--radius-sm);
}

.poem-pinned-close:hover {
  color: var(--accent);
  background: var(--paper-warm);
}

.poem-pinned-body {
  padding: var(--space-4) var(--space-5);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-sm);
  line-height: 1.55;
  text-align: center;
}

.poem-pinned-stanza { margin-bottom: var(--space-3); }
.poem-pinned-stanza:last-child { margin-bottom: 0; }

body.poem-is-pinned .poem-button { display: none; }

/* ===========================================================
   Bouton flottant "Reprendre la lecture" (sur les autres pages)
   =========================================================== */

.resume-reading-button {
  position: fixed;
  bottom: var(--space-5);
  left: var(--space-5);
  z-index: 50;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  border-bottom: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.resume-reading-button:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.resume-reading-button[hidden] { display: none; }

/* ===========================================================
   Mode sombre
   =========================================================== */

body.reader-dark {
  --paper: #1c1a17;
  --paper-soft: #252320;
  --paper-warm: #2c2924;
  --ink: #ece6da;
  --ink-soft: #b8b0a0;
  --ink-faint: #7a7368;
  --line: #3a352e;
  --line-soft: #2e2a25;
  --accent: #d4877a;
  --accent-soft: #e5a499;
}

body.reader-dark .reader-block-methode {
  background: rgba(212, 135, 122, 0.08);
}

body.reader-dark .reader-block-baudelaire {
  background: rgba(166, 132, 60, 0.1);
}

body.reader-dark .reader-topbar { background: rgba(28, 26, 23, 0.95); }
body.reader-dark .site-header { background: rgba(28, 26, 23, 0.95); }

body.reader-dark .reader-exergue,
body.reader-dark .prose .exergue {
  background: var(--paper-soft);
  border-left-color: var(--line);
}

/* ===========================================================
   Tailles de texte ajustables (7 niveaux : très petit à très grand)
   =========================================================== */

body.text-size-0 { --reader-text-size: 0.85rem; }   /* très petit */
body.text-size-1 { --reader-text-size: 0.95rem; }
body.text-size-2 { --reader-text-size: 1.05rem; }   /* défaut */
body.text-size-3 { --reader-text-size: 1.15rem; }
body.text-size-4 { --reader-text-size: 1.3rem; }
body.text-size-5 { --reader-text-size: 1.5rem; }
body.text-size-6 { --reader-text-size: 1.75rem; }   /* très grand */

/* ===========================================================
   Responsive — Tablette
   =========================================================== */

@media (max-width: 1024px) {
  .reader-layout {
    grid-template-columns: 14rem 1fr;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-4);
  }
  
  .reader-toc {
    top: 130px;
    max-height: calc(100vh - 150px);
  }
  
  .reader-paragraph {
    grid-template-columns: 2.5rem 1fr;
    gap: var(--space-2);
  }
  
  .poem-pinned {
    width: 18rem;
  }
}

/* ===========================================================
   Responsive — Mobile
   =========================================================== */

@media (max-width: 768px) {
  .reader-topbar {
    top: 60px;
  }
  
  .reader-topbar-inner {
    padding: var(--space-2) var(--space-4);
    gap: var(--space-2);
  }
  
  .reader-back,
  .reader-position { font-size: var(--text-xs); }
  
  .reader-layout {
    grid-template-columns: 1fr;
    padding: var(--space-4);
    gap: var(--space-4);
  }
  
  .reader-toc {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    background: var(--paper-soft);
    padding: var(--space-3);
  }
  
  .reader-toc-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: var(--space-3) var(--space-4);
    font-family: var(--sans);
    font-size: var(--text-sm);
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: left;
    font-weight: 500;
  }
  
  .reader-toc-content {
    display: none;
    margin-top: var(--space-3);
    max-height: 18rem;
    overflow-y: auto;
    background: var(--paper);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
  }
  
  .reader-toc.open .reader-toc-content { display: block; }
  
  .reader-toc-title {
    font-size: var(--text-base);
    font-family: var(--serif);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink);
  }
  
  .reader-paragraph {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .reader-paragraph-num {
    position: static;
    text-align: left;
    padding-top: 0;
    margin-bottom: var(--space-1);
    flex-direction: row;
  }
  
  .reader-block {
    padding: var(--space-3);
  }
  
  .reader-controls-wrapper {
    top: 110px;
  }
  
  .reader-controls {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  
  .reader-control-text { display: none; }
  
  .reader-footer-nav { grid-template-columns: 1fr; }
  
  .poem-pinned {
    width: calc(100vw - 2rem);
    top: auto;
    bottom: var(--space-3);
    right: var(--space-3);
    max-height: 40vh;
  }
  
  .reader-bookmarks-panel {
    width: calc(100vw - 2rem);
    right: var(--space-3);
  }
}

/* Préférence "mouvement réduit" */
@media (prefers-reduced-motion: reduce) {
  .reader-paragraph:target { animation: none; }
  .poem-pinned, .reader-bookmarks-panel { animation: none; }
}

/* ===========================================================
   Dialog de signet (choix des blocs + note)
   =========================================================== */

.reader-bookmark-dialog {
  position: absolute;
  z-index: 90;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: var(--space-3) var(--space-4);
  font-family: var(--sans);
  font-size: var(--text-sm);
  color: var(--ink);
}

.reader-bookmark-dialog-title {
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: var(--space-3);
}

.reader-bookmark-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  cursor: pointer;
  font-family: var(--serif);
  font-size: var(--text-sm);
  color: var(--ink);
}

.reader-bookmark-check input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.reader-bookmark-dialog-note {
  margin-top: var(--space-3);
}

.reader-bookmark-dialog-note label {
  display: block;
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: var(--space-1);
}

.reader-bookmark-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.reader-bookmark-dialog-actions button {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font-family: var(--sans);
  font-size: var(--text-sm);
  cursor: pointer;
  color: var(--ink-soft);
}

.reader-bookmark-dialog-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-bookmark-dialog-save {
  background: var(--ink) !important;
  color: var(--paper) !important;
  border-color: var(--ink) !important;
}

.reader-bookmark-dialog-save:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.reader-bookmark-dialog-remove {
  color: var(--accent) !important;
  margin-right: auto;
}

/* ===========================================================
   Pastilles de blocs dans le panneau signets
   =========================================================== */

.reader-bookmark-tags {
  display: inline-flex;
  gap: 4px;
  margin-left: var(--space-2);
}

.reader-bookmark-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--paper-warm);
  color: var(--ink-soft);
}

.reader-bookmark-tag-T { background: rgba(138, 132, 122, 0.18); color: var(--ink-soft); }
.reader-bookmark-tag-M { background: rgba(107, 31, 26, 0.15); color: var(--accent); }
.reader-bookmark-tag-B { background: rgba(166, 132, 60, 0.20); color: #8a6730; }

body.reader-dark .reader-bookmark-tag-T { background: rgba(255,255,255,0.08); color: var(--ink-soft); }
body.reader-dark .reader-bookmark-tag-M { background: rgba(212, 135, 122, 0.18); color: var(--accent); }
body.reader-dark .reader-bookmark-tag-B { background: rgba(166, 132, 60, 0.22); color: #d4a866; }

/* Petite icône crayon dans la note */
.reader-note-icon {
  color: var(--accent);
  font-style: normal;
  margin-right: 4px;
}

/* ===========================================================
   Bouton "Épingler" dans le modal du poème
   =========================================================== */

.poem-modal-actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.poem-modal-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.poem-modal-pin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.poem-modal-pin-text { display: inline; }

@media (max-width: 480px) {
  .poem-modal-pin-text { display: none; }
}
