/* ============================================================
   DOCUMENTATION DE SUPPORT (/documentation, /documentation/<section>)
   Navigation reprise de RapidoImmo (porteur, 10/10/2026) : liste des sections à gauche (icône +
   titre), sous-parties en ancres sous la section courante, mises en évidence par le ScrollSpy
   Bootstrap (data-attributes dans documentation/page.php, aucun JavaScript propre). Langage noir,
   blanc et or des pages publiques (docs/UI_CONVENTIONS.md). Fichier déclaré par cssFiles.
   ============================================================ */

/* style.css pose `html, body { overflow-x: hidden }` : la paire overflow calculée rend <body>
   conteneur de défilement et casse `position: sticky` de la navigation. Même correctif que toc.css :
   on rend <body> à `visible` (jamais <html>, qui garde le garde-fou anti-débordement horizontal). */
body {
    overflow: visible;
}

/* Icône Bootstrap Icons inlinée : hérite de la couleur du texte (currentColor). */
.doc-icone {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.doc-icone svg {
    width: 1em;
    height: 1em;
}

/* ------------------------------------------------------------------
   Navigation latérale
   ------------------------------------------------------------------ */
.doc-nav {
    font-family: 'Manrope', 'Nunito', sans-serif;
    border-left: 1px solid var(--line);
    padding-left: .25rem;
}

@media (min-width: 992px) {
    .doc-nav {
        position: sticky;
        top: calc(var(--header-h, 86px) + 1.25rem);
        max-height: calc(100vh - var(--header-h, 86px) - 2.5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--line) transparent;
    }
}

.doc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-nav__accueil,
.doc-nav__section {
    display: flex;
    gap: .65rem;
    align-items: center;
    padding: .5rem .75rem;
    margin-left: -1px;
    border-left: 3px solid transparent;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.3;
    transition: color .2s ease, border-color .2s ease;
}

.doc-nav__accueil {
    font-size: .9rem;
    color: var(--ink-soft);
}

.doc-nav__accueil .doc-icone,
.doc-nav__section .doc-icone {
    font-size: 1.15rem;
    color: var(--gold-deep);
}

.doc-nav__accueil:hover,
.doc-nav__section:hover,
.doc-nav__accueil:focus-visible,
.doc-nav__section:focus-visible {
    color: var(--gold-deep);
}

.doc-nav__accueil.is-active,
.doc-nav__section.is-active {
    border-left-color: var(--gold);
    font-weight: 800;
    color: var(--ink);
}

/* Sous-parties de la section courante : ancres, plus petites, en retrait. */
.doc-nav__ancres {
    margin: .15rem 0 .6rem 0;
    padding-left: 2.35rem !important;
}

.doc-nav__ancre {
    display: block;
    padding: .22rem 0;
    font-family: 'Nunito', sans-serif;
    font-size: .88rem;
    line-height: 1.35;
    color: var(--ink-soft);
    text-decoration: none;
}

.doc-nav__ancre:hover,
.doc-nav__ancre:focus-visible {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--gold);
}

/* Ancre de la sous-partie en cours de lecture (classe posée par le ScrollSpy Bootstrap). */
.doc-nav__ancre.active {
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Sur petit écran, la navigation précède le contenu : on n'y garde que les sections, les
   ancres de la section courante allongeraient la page avant même le premier paragraphe. */
@media (max-width: 991.98px) {
    .doc-nav__ancres {
        display: none;
    }
}

/* ------------------------------------------------------------------
   Contenu
   ------------------------------------------------------------------ */
.doc-content {
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--dark-text);
}

.doc-section-title {
    display: flex;
    gap: .7rem;
    align-items: center;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    color: var(--ink);
    margin: 0 0 1rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--gold);
}

.doc-section-lead {
    font-size: 1.12rem;
    color: var(--ink-soft);
    max-width: 70ch;
    margin-bottom: 2rem;
}

.doc-section-title .doc-icone {
    color: var(--gold-deep);
}

/* Une sous-partie = une <section id> : l'ancre tombe sous le header fixe, pas dessous. */
.doc-sous-partie {
    scroll-margin-top: calc(var(--header-h, 86px) + 1rem);
    padding-top: .5rem;
    margin-bottom: 2.5rem;
}

.doc-sous-partie + .doc-sous-partie {
    border-top: 1px solid var(--line);
    padding-top: 2rem;
}

.doc-sous-partie h3 {
    display: flex;
    gap: .6rem;
    align-items: center;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: .9rem;
}

.doc-sous-partie h3 .doc-icone {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--paper-2);
    color: var(--gold-deep);
    font-size: 1.1rem;
}

.doc-sous-partie h4 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    margin: 1.4rem 0 .5rem;
}

.doc-sous-partie p {
    max-width: 75ch;
}

.doc-sous-partie ul,
.doc-sous-partie ol {
    max-width: 75ch;
    padding-left: 1.25rem;
}

.doc-sous-partie li {
    margin-bottom: .35rem;
}

.doc-sous-partie a,
.doc-intro a,
.doc-principes a {
    color: var(--ink);
    text-decoration-color: var(--gold);
    text-underline-offset: 3px;
}

.doc-sous-partie a:hover {
    color: var(--gold-deep);
}

/* Chemin dans l'interface (« Familles → Régie de recettes ») : repère visuel discret. */
.doc-chemin {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: .92em;
    color: var(--ink);
    background: var(--paper-2);
    border-radius: 4px;
    padding: .05rem .4rem;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* ------------------------------------------------------------------
   Captures d'écran réelles (couleur : ce sont des écrans, pas des photos d'illustration)
   ------------------------------------------------------------------ */
.doc-capture {
    margin: 1.25rem 0 1.5rem;
}

.doc-capture img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-bottom: 3px solid var(--gold);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(17, 17, 17, .08);
    background: var(--paper);
}

.doc-capture figcaption {
    margin-top: .55rem;
    font-size: .9rem;
    font-style: italic;
    color: var(--ink-soft);
}

/* ------------------------------------------------------------------
   Encadrés : note neutre et limite honnête (fonction annoncée, connecteur à valider…)
   ------------------------------------------------------------------ */
.doc-note,
.doc-limite {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    max-width: 75ch;
    margin: 1rem 0 1.25rem;
    padding: .85rem 1rem;
    border-radius: 8px;
    font-size: .95rem;
    line-height: 1.55;
}

.doc-note {
    background: var(--paper-2);
    color: var(--ink);
}

.doc-limite {
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    color: var(--ink);
}

.doc-note .doc-icone,
.doc-limite .doc-icone {
    font-size: 1.15rem;
    color: var(--gold-deep);
    margin-top: .15rem;
}

/* ------------------------------------------------------------------
   Sections voisines (bas de page)
   ------------------------------------------------------------------ */
.doc-suite {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gold);
}

.doc-suite__lien {
    display: inline-flex;
    gap: .6rem;
    align-items: center;
    padding: .65rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    transition: border-color .2s ease, color .2s ease;
}

.doc-suite__lien small {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: .78rem;
    color: var(--ink-soft);
}

.doc-suite__lien:hover,
.doc-suite__lien:focus-visible {
    border-color: var(--gold);
    color: var(--gold-deep);
}

.doc-suite__lien--suivante {
    margin-left: auto;
    text-align: right;
}

/* ------------------------------------------------------------------
   Accueil de la documentation
   ------------------------------------------------------------------ */
.doc-intro {
    font-size: 1.12rem;
    color: var(--ink-soft);
    max-width: 70ch;
    margin-bottom: 2rem;
}

.doc-accueil {
    list-style: none;
    margin: 0 0 2.5rem;
    padding: 0;
    border-top: 1px solid var(--line);
}

.doc-accueil__lien {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem .25rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.doc-accueil__lien > .doc-icone {
    font-size: 1.5rem;
    color: var(--gold-deep);
    margin-top: .1rem;
}

.doc-accueil__texte strong {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 1.12rem;
}

.doc-accueil__texte span {
    color: var(--ink-soft);
}

.doc-accueil__lien:hover strong,
.doc-accueil__lien:focus-visible strong {
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 3px;
}

.doc-accueil__titre {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--ink);
    margin-bottom: 1rem;
}

.doc-principes {
    max-width: 75ch;
    padding-left: 1.25rem;
}

.doc-principes li {
    margin-bottom: .6rem;
}

.doc-principes li::marker {
    color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
    .doc-nav__accueil,
    .doc-nav__section,
    .doc-suite__lien {
        transition: none;
    }
}
