/* Couleurs reprises de l'ancien site de documentation : en-tête bleu marine, accent orange,
   titres bleus, pied de page bleu. Le mode sombre ne s'applique qu'à l'écran (jamais au PDF). */
:root {
  --texte: #1c1e21;
  --texte-doux: #525860;
  --fond: #ffffff;
  --fond-barre: #f7f8fa;
  --bordure: #dadde1;
  --survol: rgba(0, 0, 0, .05);
  --accent: #ff8114;
  --lien: #c25700;
  --titre: #1753ae;
  --entete: #0e1f3b;
  --pied: #142d57;
  --code-fond: #f0f2f5;
  --champ-fond: #ffffff;
  --note: #1753ae;
  --note-fond: #eef4fc;
  --important: #b85600;
  --important-fond: #fff3e8;
  --attention: #b3261e;
  --attention-fond: #fdeeed;
  --config: #2b6e3a;
  --config-fond: #edf6ef;
  --police: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light;
}

@media screen {
  html[data-theme="dark"] {
    --texte: #e3e3e3;
    --texte-doux: #a9afb7;
    --fond: #1b1b1d;
    --fond-barre: #242526;
    --bordure: #3a3c3f;
    --survol: rgba(255, 255, 255, .07);
    --lien: #ff9a45;
    --titre: #82b1ff;
    --code-fond: rgba(255, 255, 255, .1);
    --champ-fond: #1b1b1d;
    --note: #82b1ff;
    --note-fond: #16243a;
    --important: #ffa45c;
    --important-fond: #3a2614;
    --attention: #ff8a80;
    --attention-fond: #3d1a18;
    --config: #7fd18f;
    --config-fond: #17301d;
    color-scheme: dark;
  }
}
@media screen and (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --texte: #e3e3e3;
    --texte-doux: #a9afb7;
    --fond: #1b1b1d;
    --fond-barre: #242526;
    --bordure: #3a3c3f;
    --survol: rgba(255, 255, 255, .07);
    --lien: #ff9a45;
    --titre: #82b1ff;
    --code-fond: rgba(255, 255, 255, .1);
    --champ-fond: #1b1b1d;
    --note: #82b1ff;
    --note-fond: #16243a;
    --important: #ffa45c;
    --important-fond: #3a2614;
    --attention: #ff8a80;
    --attention-fond: #3d1a18;
    --config: #7fd18f;
    --config-fond: #17301d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.65;
  color: var(--texte);
  background: var(--fond);
}

a { color: var(--lien); text-decoration: none; }
a:hover { text-decoration: underline; }

/* En-tête */
.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  padding: 0 20px;
  background: var(--entete);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.entete a { color: #fff; text-decoration: none; }
.marque { font-weight: 800; font-size: 18px; color: var(--accent) !important; letter-spacing: -.01em; }
.marque span { font-weight: 500; color: #c9d1dc; margin-left: 8px; }
.lien-pdf {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
}
.lien-pdf:hover { background: #ea6b00; text-decoration: none; }
.theme-bouton, .menu-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  cursor: pointer;
}
.theme-bouton { width: 36px; height: 36px; padding: 0; }
.theme-bouton:hover, .menu-bouton:hover { background: rgba(255, 255, 255, .12); }
.icone-soleil { display: none; }
html[data-theme="dark"] .icone-soleil { display: block; }
html[data-theme="dark"] .icone-lune { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icone-soleil { display: block; }
  html:not([data-theme="light"]) .icone-lune { display: none; }
}
.menu-bouton { display: none; padding: 5px 12px; }

/* Mise en page */
.cadre { display: flex; min-height: calc(100vh - 60px); }

.barre {
  flex: 0 0 300px;
  background: var(--fond-barre);
  border-right: 1px solid var(--bordure);
  padding: 18px 14px 40px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.recherche {
  width: 100%;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--texte);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: var(--champ-fond);
}
.recherche:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.resultats { list-style: none; margin: 8px 0 16px; padding: 0; }
.resultats li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--texte); font-size: 14px; }
.resultats li a:hover { background: var(--survol); text-decoration: none; }
.resultats li small { display: block; color: var(--texte-doux); font-size: 12px; }
.resultats .vide { padding: 6px 10px; color: var(--texte-doux); font-size: 14px; }

/* Sommaire */
.sommaire { margin-top: 14px; }
.nav-partie summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--texte);
}
.nav-partie summary:hover { background: var(--survol); }
.nav-partie ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 10px; }
.nav-partie li a {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--texte-doux);
  border-radius: 8px;
}
.nav-partie li a:hover { color: var(--texte); background: var(--survol); text-decoration: none; }
.nav-partie li a.actif { color: var(--accent); background: var(--survol); font-weight: 600; }

/* Contenu */
.contenu {
  flex: 1;
  min-width: 0;
  max-width: 920px;
  padding: 28px 48px 60px;
}

.ariane ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: 14px;
}
.ariane li { display: flex; align-items: center; margin: 0; }
.ariane li + li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 10px 0 6px;
  border-right: 2px solid var(--texte-doux);
  border-bottom: 2px solid var(--texte-doux);
  transform: rotate(-45deg);
}
.ariane a, .ariane span { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; color: var(--texte); }
.ariane a:hover { background: var(--survol); text-decoration: none; }
.ariane span[aria-current] { background: var(--survol); color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--titre); letter-spacing: -.02em; }
h1 { font-size: 32px; font-weight: 800; margin: 8px 0 18px; }
h2 { font-size: 22px; font-weight: 700; margin: 34px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--bordure); }
h3 { font-size: 18px; font-weight: 700; margin: 26px 0 8px; }
h4 { font-size: 15px; font-weight: 700; margin: 18px 0 6px; }

p, ul, ol { margin: 0 0 12px; }
li { margin-bottom: 4px; }

code {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  background: var(--code-fond);
  padding: 1px 5px;
  border-radius: 4px;
}

kbd {
  font-family: var(--police);
  font-size: 13px;
  border: 1px solid var(--bordure);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  background: var(--fond-barre);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  font-size: 14px;
}
th, td { border: 1px solid var(--bordure); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--fond-barre); font-weight: 600; }

/* Encadrés */
.encadre {
  margin: 16px 0 20px;
  padding: 12px 16px;
  border-left: 5px solid var(--note);
  background: var(--note-fond);
  border-radius: 0 8px 8px 0;
}
.encadre p:last-child { margin-bottom: 0; }
.encadre-titre { font-weight: 700; margin-bottom: 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--note); }
.encadre-important, .encadre-tip { border-left-color: var(--important); background: var(--important-fond); }
.encadre-important .encadre-titre, .encadre-tip .encadre-titre { color: var(--important); }
.encadre-warning { border-left-color: var(--attention); background: var(--attention-fond); }
.encadre-warning .encadre-titre { color: var(--attention); }
.encadre-config { border-left-color: var(--config); background: var(--config-fond); }
.encadre-config .encadre-titre { color: var(--config); }

blockquote { margin: 14px 0; padding: 4px 14px; border-left: 3px solid var(--bordure); color: var(--texte-doux); }

.capture { margin: 16px 0 22px; }
.capture img { max-width: 100%; border: 1px solid var(--bordure); border-radius: 6px; }
.capture figcaption { font-size: 13px; color: var(--texte-doux); margin-top: 6px; }
.capture-absente div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  border: 1px dashed var(--bordure);
  border-radius: 6px;
  color: var(--texte-doux);
  background: var(--fond-barre);
  font-size: 14px;
}

.edition { color: var(--texte-doux); }
.accueil-partie { scroll-margin-top: 76px; }
.accueil-partie h2 { margin-top: 30px; }

.pied-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--bordure);
}
.pied-nav a {
  display: block;
  max-width: 48%;
  padding: 10px 14px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  color: var(--titre);
  font-weight: 600;
}
.pied-nav a:hover { border-color: var(--accent); text-decoration: none; }
.pied-nav a span { display: block; font-size: 12px; font-weight: 400; color: var(--texte-doux); }
.pied-nav .suiv { text-align: right; margin-left: auto; }

/* Pied de page */
.pied-page {
  padding: 22px 20px;
  text-align: center;
  font-size: 14px;
  color: #c9d1dc;
  background: var(--pied);
}

@media (max-width: 860px) {
  .menu-bouton { display: inline-flex; }
  .marque span { display: none; }
  .lien-pdf { padding: 5px 10px; font-size: 13px; }
  .barre {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 9;
    height: calc(100vh - 60px);
    border-right: 0;
  }
  body.sommaire-ouvert .barre { display: block; }
  .contenu { padding: 18px 16px 48px; }
  h1 { font-size: 26px; }
  table { display: block; overflow-x: auto; }
}
