:root {
  --fond: #f2f6fb;
  --papier: #fbfdff;
  --encre: #14213d;
  --doux: #55688a;
  --trait: #d3deec;
  --accent: #1f4e8c;
  --accent-texte: #fbfdff;
  --alerte: #a3322a;
  /* Même police que le PDF (Georgia) */
  --serif: Georgia, "Times New Roman", serif;
  --sans: var(--serif);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0d1524;
    --papier: #142036;
    --encre: #e2e9f5;
    --doux: #98aac6;
    --trait: #26375a;
    --accent: #82b1ee;
    --accent-texte: #0d1524;
    --alerte: #f08a7e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}
a { color: var(--accent); }
h1, h2, h3 { font-weight: 400; line-height: 1.25; }

/* ---------- bandeau et pied ---------- */
.bandeau {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--trait);
  font-family: var(--sans); font-size: 0.95rem;
}
.marque { color: var(--encre); text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.actions { display: flex; gap: 1.1rem; align-items: center; }
.actions a, .lien-bouton {
  color: var(--accent); text-decoration: none; font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
}
.pied {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem;
  padding: 2rem 1rem; color: var(--doux);
  font-family: var(--sans); font-size: 0.85rem;
  border-top: 1px solid var(--trait);
}
.pied a { color: var(--doux); }
.pied { align-items: flex-start; }
.pied-colonne { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }

/* ---------- accueil ---------- */
main { padding: 0 16px; }
.couverture { max-width: 40rem; margin: 0 auto; padding: 0.75rem 0 1rem; text-align: center; }
.surtitre { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--doux); margin: 0; }
.couverture h1 { font-size: clamp(1.75rem, 5.5vw, 2.7rem); letter-spacing: 0.06em; text-transform: uppercase; margin: 0.6rem 0 1rem; }
.couverture .livre {
  display: block; width: min(16rem, 70vw); height: auto; margin: 0 auto 2.5rem;
  border-radius: 2px 6px 6px 2px;
  box-shadow: -6px 0 0 -3px rgba(0, 0, 0, 0.25) inset, 0 18px 40px -12px rgba(13, 30, 60, 0.55), 0 4px 10px rgba(13, 30, 60, 0.2);
}
.presentation .description { text-align: left; hyphens: manual; font-size: 1.2rem; font-style: italic; line-height: 1.65; color: var(--encre); margin: 1rem 0 0; }
.epigraphe { margin: 0 auto; max-width: 30rem; font-style: italic; color: var(--doux); }
.epigraphe p { margin: 0 0 0.4rem; }
.epigraphe footer { font-style: normal; font-size: 0.9rem; }

.presentation, .achat, .page-simple { max-width: 38rem; margin: 0 auto; }
.presentation h2, .achat h2 { font-size: 1.5rem; margin: 2.5rem 0 0.8rem; }
.presentation p { text-align: justify; hyphens: auto; }
.sommaire { padding-left: 1.8rem; color: var(--doux); }
.sommaire li { padding: 0.15rem 0; }
.sommaire li::marker { font-variant: small-caps; }
.sommaire { list-style: upper-roman; }

.achat {
  background: var(--papier); border: 1px solid var(--trait); border-radius: 10px;
  padding: 1.6rem 1.6rem 1.8rem; margin-top: 3rem; margin-bottom: 4rem;
}
.achat h2 { margin-top: 0; }
.prix { font-size: 2.4rem; margin: 0.2rem 0 0.6rem; }
.prix span { font-size: 1rem; color: var(--doux); font-family: var(--sans); }
.inclus { padding-left: 1.2rem; margin: 0 0 1.4rem; }
.inclus li { margin: 0.2rem 0; }
.case { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0 0 0.9rem; font-family: var(--sans); font-size: 0.9rem; line-height: 1.45; }
.case input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--accent); }
.note { font-family: var(--sans); font-size: 0.8rem; color: var(--doux); margin: 0.8rem 0 0; }
.alerte {
  font-family: var(--sans); font-size: 0.9rem; color: var(--alerte);
  border-left: 3px solid var(--alerte); padding: 0.3rem 0 0.3rem 0.8rem; margin: 0 0 1rem;
}

.bouton {
  display: inline-block; padding: 0.8rem 1.4rem; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-texte); text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 1rem; font-weight: 500;
}
.bouton:hover { filter: brightness(1.08); }
.bouton.secondaire { background: transparent; color: var(--accent); }
form .bouton { width: 100%; margin-top: 0.4rem; }
.boutons { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.5rem 0 3rem; }
.achat .boutons { margin-bottom: 0; }

/* ---------- pages simples ---------- */
.page-simple { padding: 3rem 0 2rem; }
.page-simple h1 { font-size: 2rem; }
.encadre { background: var(--papier); border: 1px solid var(--trait); border-radius: 10px; padding: 1.2rem 1.4rem; margin: 1.5rem 0; }
.encadre h2 { margin-top: 0; font-size: 1.3rem; }
.lien-acces { display: flex; gap: 0.5rem; }
.lien-acces input, .table-lien input {
  flex: 1; min-width: 0; padding: 0.6rem; border: 1px solid var(--trait); border-radius: 6px;
  background: var(--fond); color: var(--encre); font-family: var(--sans); font-size: 0.85rem;
}
.contact-email { font-size: 1.3rem; margin: 1.5rem 0; }
.juridique h2 { font-size: 1.25rem; margin-top: 1.8rem; }
.juridique p { text-align: justify; }

/* ---------- liseuse ---------- */
.liseuse main { padding: 0; }
.liseuse .bandeau { position: sticky; top: 0; z-index: 10; background: var(--fond); }
.lecture { display: grid; grid-template-columns: 17rem minmax(0, 1fr); max-width: 72rem; margin: 0 auto; }
.table {
  position: sticky; top: 3.2rem; align-self: start; max-height: calc(100vh - 3.2rem); overflow-y: auto;
  padding: 2rem 1.2rem 2rem 1.25rem; font-family: var(--sans); font-size: 0.85rem; border-right: 1px solid var(--trait);
}
.table h2 { font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--doux); margin: 0 0 0.8rem; }
.table ol { list-style: none; padding: 0; margin: 0; }
.table li { margin: 0 0 0.55rem; line-height: 1.35; }
.table li.niv2 { padding-left: 0.9rem; font-size: 0.8rem; }
.table a { color: var(--encre); text-decoration: none; }
.table a:hover { color: var(--accent); }
.table-lien { margin-top: 2rem; color: var(--doux); }
.table-lien input { width: 100%; }
.lien-bouton { display: none; }

.texte { padding: 3rem clamp(16px, 5vw, 4rem) 5rem; max-width: 44rem; margin: 0 auto; width: 100%; }
.texte p { text-align: justify; hyphens: auto; text-indent: 1.5em; margin: 0 0 0.7em; }
.texte .livre-titre { text-align: center; padding: 3rem 0 2rem; }
.texte .livre-titre h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: 0.06em; }
.texte h2 { font-size: 1.55rem; text-align: center; letter-spacing: 0.05em; margin: 5rem 0 1.5rem; scroll-margin-top: 4.5rem; }
.texte h3 { font-size: 1.2rem; font-style: italic; text-align: center; margin: 2.8rem 1rem 1.2rem; scroll-margin-top: 4.5rem; }
.table-fin ol { list-style: none; padding: 0; margin: 0; }
.table-fin li { margin: 0 0 0.7rem; line-height: 1.4; }
.table-fin li.niv2 { padding-left: 1.5rem; font-size: 0.95em; }
.table-fin a { color: var(--encre); text-decoration: none; border-bottom: 1px dotted var(--trait); }
.table-fin a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.texte .epigraphe { margin: 0 0 2.5rem auto; text-align: right; max-width: 26rem; }
.texte .epigraphe p { text-indent: 0; text-align: right; }

@media (max-width: 800px) {
  .lecture { display: block; }
  .lien-bouton { display: inline; }
  .table {
    display: none; position: fixed; top: 3.2rem; left: 0; right: 0; bottom: 0; max-height: none;
    background: var(--fond); border-right: 0; z-index: 9; padding: 1.5rem 16px;
  }
  .table.ouverte { display: block; }
  body { font-size: 1.05rem; }
  .achat { padding: 1.3rem 1.1rem 1.5rem; }
}
