/* Documentation de la plateforme READ : feuille de style du site (sans dépendance, thème clair et sombre). */
:root {
  --fond: #ffffff;
  --fond-doux: #f6f8fb;
  --fond-entete: #0b3d91;
  --texte: #1c2433;
  --texte-doux: #556072;
  --bordure: #dfe4ec;
  --primaire: #0d5bd7;
  --primaire-fond: #e8f0fd;
  --accent: #d9480f;
  --code-fond: #f1f4f9;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --remarque: #0d5bd7; --remarque-fond: #eef4ff;
  --conseil: #12805c; --conseil-fond: #ecf8f3;
  --important: #7a3fd1; --important-fond: #f4effc;
  --attention: #a15c00; --attention-fond: #fff6e5;
  --danger: #c0262d; --danger-fond: #fdeeee;
  --largeur-nav: 290px;
  --largeur-sommaire: 230px;
  --hauteur-entete: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f141c; --fond-doux: #151c27; --fond-entete: #0a1f45; --texte: #e4e9f1; --texte-doux: #9aa6b8;
    --bordure: #273244; --primaire: #6ea3ff; --primaire-fond: #16284a; --code-fond: #182132;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
    --remarque: #6ea3ff; --remarque-fond: #132443; --conseil: #45c495; --conseil-fond: #10291f;
    --important: #b48cff; --important-fond: #241a3a; --attention: #f0b14a; --attention-fond: #2e2210;
    --danger: #ff7b7f; --danger-fond: #331618;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--hauteur-entete) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primaire); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 8px; top: 8px; z-index: 100; background: var(--fond); padding: 8px 12px; }

/* En-tête */
.entete {
  position: sticky; top: 0; z-index: 30; height: var(--hauteur-entete);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: var(--fond-entete); color: #fff;
}
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 17px; white-space: nowrap; }
.marque-logo {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: #fff; color: var(--fond-entete); font-weight: 800;
}
.bouton-menu { display: none; background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
.bouton-menu svg { width: 24px; height: 24px; }
.recherche { position: relative; flex: 1; max-width: 560px; margin-left: auto; display: flex; align-items: center; }
.recherche > svg { position: absolute; left: 12px; color: #9fb4d8; pointer-events: none; }
.recherche input {
  width: 100%; height: 38px; padding: 0 12px 0 40px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 15px;
}
.recherche input::placeholder { color: #c3d1ea; }
.recherche input:focus { outline: 2px solid #fff; background: rgba(255, 255, 255, .2); }
.resultats {
  position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--fond); color: var(--texte); border: 1px solid var(--bordure); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}
.resultats a { display: block; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--bordure); }
.resultats a:hover, .resultats a.actif { background: var(--primaire-fond); }
.resultats strong { display: block; color: var(--primaire); }
.resultats small { display: block; color: var(--texte-doux); font-size: 12px; }
.resultats span { display: block; font-size: 13px; color: var(--texte-doux); }
.resultats mark { background: #ffe58a; color: inherit; border-radius: 2px; }
.resultats p { margin: 0; padding: 14px; color: var(--texte-doux); }
.bouton-plateforme {
  color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .5); border-radius: 8px; padding: 6px 12px; font-size: 14px; white-space: nowrap;
}
.bouton-plateforme:hover { background: rgba(255, 255, 255, .12); }

/* Cadre à trois colonnes */
.cadre { display: grid; grid-template-columns: var(--largeur-nav) minmax(0, 1fr) var(--largeur-sommaire); max-width: 1500px; margin: 0 auto; }
.navigation {
  position: sticky; top: var(--hauteur-entete); height: calc(100vh - var(--hauteur-entete)); overflow-y: auto;
  padding: 20px 12px 40px 20px; border-right: 1px solid var(--bordure); font-size: 14.5px;
}
.nav-volume { margin-bottom: 10px; }
.nav-volume summary {
  cursor: pointer; font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--texte-doux); padding: 6px 8px; border-radius: 6px; list-style-position: outside;
}
.nav-volume[open] summary { color: var(--texte); }
.navigation ol { list-style: none; margin: 4px 0 0; padding: 0; }
.navigation li a {
  display: flex; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--texte); text-decoration: none; line-height: 1.4;
}
.navigation li a:hover { background: var(--fond-doux); }
.navigation li a[aria-current="page"] { background: var(--primaire-fond); color: var(--primaire); font-weight: 600; }
.nav-numero { color: var(--texte-doux); min-width: 18px; font-variant-numeric: tabular-nums; }
.nav-sections { border-left: 2px solid var(--bordure); margin: 2px 0 6px 18px !important; }
.nav-sections a { font-size: 13.5px; color: var(--texte-doux) !important; padding: 3px 10px !important; }
.nav-sections a.visible { color: var(--primaire) !important; }

.contenu { min-width: 0; padding: 28px 48px 40px; }
.article, .titre-page, .liste-chapitres { max-width: 820px; }
.sommaire-page {
  position: sticky; top: var(--hauteur-entete); height: calc(100vh - var(--hauteur-entete)); overflow-y: auto;
  padding: 28px 20px; font-size: 13.5px;
}
.sommaire-page p { margin: 0 0 8px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux); }
.sommaire-page ul { list-style: none; margin: 0 0 20px; padding: 0; border-left: 1px solid var(--bordure); }
.sommaire-page li a { display: block; padding: 4px 12px; color: var(--texte-doux); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.sommaire-page li.niveau-3 a { padding-left: 24px; }
.sommaire-page li a:hover { color: var(--texte); }
.sommaire-page li a.visible { color: var(--primaire); border-left-color: var(--primaire); }
.sommaire-page .telechargements { flex-direction: column; align-items: stretch; }

/* Titres et texte */
.fil { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--texte-doux); margin-bottom: 18px; }
.fil a { color: var(--texte-doux); }
.surtitre { margin: 0 0 4px; color: var(--primaire); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 24px; line-height: 1.3; margin: 44px 0 12px; padding-top: 18px; border-top: 1px solid var(--bordure); }
h3 { font-size: 19px; margin: 30px 0 8px; }
h2 .ancre, h3 .ancre { margin-left: 8px; color: var(--texte-doux); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .ancre, h3:hover .ancre { opacity: 1; }
.chapeau { font-size: 18.5px; color: var(--texte-doux); margin: 0 0 14px; }
.public { color: var(--texte-doux); font-size: 14.5px; }
.roles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--texte-doux); }
.badge { background: var(--fond-doux); border: 1px solid var(--bordure); border-radius: 999px; padding: 1px 10px; color: var(--texte); }
.titre-page { padding-bottom: 8px; margin-bottom: 8px; }
p, li { max-width: 78ch; }
code { font: 0.88em/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--code-fond); padding: 1px 5px; border-radius: 4px; }
/* Code en ligne (chemins, commandes) : coupé au besoin, sinon la page déborde à 360 px. */
:not(pre) > code { overflow-wrap: anywhere; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--bordure); margin: 32px 0; }

/* Étapes numérotées */
ol.etapes { list-style: none; counter-reset: etape; padding-left: 0; }
ol.etapes > li { counter-increment: etape; position: relative; padding-left: 40px; margin: 10px 0; }
ol.etapes > li::before {
  content: counter(etape); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primaire-fond); color: var(--primaire); font-weight: 700; font-size: 14px; display: grid; place-items: center;
}

/* Figures */
.figure { margin: 22px 0 26px; width: var(--largeur, 100%); max-width: 100%; }
.figure-telephone { width: min(var(--largeur), 300px); }
.figure .zoom { display: block; padding: 0; border: 1px solid var(--bordure); border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; box-shadow: var(--ombre); width: 100%; }
.figure-telephone .zoom { border-radius: 22px; border: 8px solid #1d2330; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 8px; font-size: 14px; color: var(--texte-doux); }
.figure-numero { font-weight: 700; color: var(--texte); margin-right: 4px; }

/* Repères : légende des pastilles */
ol.reperes { list-style: none; padding: 12px 16px; margin: -10px 0 24px; counter-reset: repere; background: var(--fond-doux); border-radius: 10px; border: 1px solid var(--bordure); }
ol.reperes > li { counter-increment: repere; position: relative; padding-left: 34px; margin: 6px 0; font-size: 15px; }
ol.reperes > li::before {
  content: counter(repere); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 12.5px; display: grid; place-items: center;
}

/* Encadrés */
.encadre { margin: 20px 0; padding: 12px 16px; border-left: 4px solid var(--c); background: var(--f); border-radius: 0 8px 8px 0; }
.encadre > :last-child { margin-bottom: 0; }
.encadre-titre { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: 700; color: var(--c); }
.encadre-remarque { --c: var(--remarque); --f: var(--remarque-fond); }
.encadre-conseil { --c: var(--conseil); --f: var(--conseil-fond); }
.encadre-important { --c: var(--important); --f: var(--important-fond); }
.encadre-attention { --c: var(--attention); --f: var(--attention-fond); }
.encadre-danger { --c: var(--danger); --f: var(--danger-fond); }

/* Tableaux et code */
.tableau { overflow-x: auto; margin: 18px 0; border: 1px solid var(--bordure); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--bordure); }
th { background: var(--fond-doux); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.code { position: relative; margin: 16px 0; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; background: var(--code-fond); border: 1px solid var(--bordure); border-radius: 8px; }
.code pre code { background: none; padding: 0; font-size: 13.5px; }
.copier {
  position: absolute; top: 8px; right: 8px; font: 12px system-ui, sans-serif; padding: 3px 8px; cursor: pointer;
  border: 1px solid var(--bordure); border-radius: 6px; background: var(--fond); color: var(--texte-doux);
}

/* Suite, pied, téléchargements */
.suite { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.suite a { display: block; padding: 14px 16px; border: 1px solid var(--bordure); border-radius: 10px; text-decoration: none; color: var(--texte); font-weight: 600; }
.suite a:hover { border-color: var(--primaire); }
.suite span { display: block; font-size: 13px; color: var(--texte-doux); font-weight: 400; }
.suite .suivant { grid-column: 2; text-align: right; }
.pied { max-width: 820px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--bordure); font-size: 13px; color: var(--texte-doux); }
.telechargements { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.telechargement, .bouton {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--bordure); color: var(--texte); background: var(--fond);
}
.telechargement svg { width: 16px; height: 16px; }
.telechargement:hover { border-color: var(--primaire); color: var(--primaire); }
.bouton { background: var(--primaire); border-color: var(--primaire); color: #fff; }

/* Accueil et sommaire de volume */
.accueil { max-width: 820px; padding: 24px 0 12px; }
.accueil h1 { font-size: 40px; }
.volumes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 16px; }
.carte-volume { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--bordure); border-radius: 14px; box-shadow: var(--ombre); }
.carte-volume h2 { border: 0; margin: 10px 0 6px; padding: 0; font-size: 21px; }
.carte-volume h2 a { color: var(--texte); text-decoration: none; }
.carte-volume p { margin: 0 0 10px; color: var(--texte-doux); font-size: 15px; }
.carte-icone { width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: var(--primaire-fond); color: var(--primaire); }
.carte-chapitres { padding-left: 18px; margin: 4px 0 16px; font-size: 14.5px; flex: 1; }
.carte-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.carte-pied .telechargements { margin: 0; }
.liste-chapitres { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.liste-chapitres a { display: block; padding: 14px 18px; border: 1px solid var(--bordure); border-radius: 10px; text-decoration: none; color: var(--texte); }
.liste-chapitres a:hover { border-color: var(--primaire); }
.liste-chapitres .numero { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primaire); }
.liste-chapitres strong { display: block; font-size: 17px; }
.liste-chapitres a > span:last-child { display: block; color: var(--texte-doux); font-size: 14.5px; }

/* Visionneuse */
.visionneuse { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; border-radius: 10px; background: var(--fond); overflow: auto; }
.visionneuse::backdrop { background: rgba(5, 10, 20, .8); }
.visionneuse img { display: block; max-width: 94vw; height: auto; }
.visionneuse p { margin: 0; padding: 10px 14px; font-size: 14px; color: var(--texte-doux); }
.visionneuse .fermer { position: sticky; top: 8px; float: right; margin: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 22px; cursor: pointer; }
.voile { position: fixed; inset: var(--hauteur-entete) 0 0; background: rgba(0, 0, 0, .4); z-index: 19; }

/* Écrans moyens : sommaire de page masqué */
@media (max-width: 1200px) {
  .cadre { grid-template-columns: var(--largeur-nav) minmax(0, 1fr); }
  .sommaire-page { display: none; }
}
/* Téléphone et tablette : navigation en tiroir */
@media (max-width: 860px) {
  .cadre { grid-template-columns: minmax(0, 1fr); }
  .bouton-menu { display: block; }
  .navigation {
    position: fixed; z-index: 20; top: var(--hauteur-entete); left: 0; width: min(320px, 86vw); background: var(--fond);
    transform: translateX(-100%); transition: transform .2s; visibility: hidden;
  }
  .navigation.ouverte { transform: none; visibility: visible; box-shadow: 0 0 24px rgba(0, 0, 0, .25); }
  .contenu { padding: 20px 16px 32px; }
  .entete { gap: 10px; padding: 0 10px; }
  .marque span:last-child, .bouton-plateforme { display: none; }
  .recherche { max-width: none; }
  h1, .accueil h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .chapeau { font-size: 16.5px; }
  .suite { grid-template-columns: 1fr; }
  .suite .suivant { grid-column: 1; }
  .figure { width: 100%; }
  .figure-telephone { width: min(100%, 280px); }
}

@media print {
  .entete, .navigation, .sommaire-page, .suite, .copier, .telechargements, .fil { display: none !important; }
  .cadre { display: block; }
  .contenu { padding: 0; }
  h2 { break-after: avoid; }
  .figure { break-inside: avoid; }
}
