/*
 * Feuille de style du site de documentation.
 *
 * Volontairement indépendante de public/assets/style.css : la documentation
 * doit se lire comme un site distinct de l'application (colonne de sommaire,
 * typographie de lecture, palette propre), tout en restant sur le même
 * domaine, au chemin /docs/.
 */

:root {
    --doc-bg: #ffffff;
    --doc-sidebar: #10141f;
    --doc-sidebar-text: #a9b2c7;
    --doc-sidebar-active: #ffffff;
    --doc-text: #1a1f2b;
    --doc-muted: #5f6b7f;
    --doc-border: #e4e7ee;
    --doc-accent: #0f9b8e;
    --doc-accent-dark: #0b7a70;
    --doc-code-bg: #0d1117;
    --doc-code-text: #e6edf3;
    --doc-inline-bg: #f1f3f7;
    --doc-info: #0f9b8e;
    --doc-info-bg: #e9f7f5;
    --doc-warn: #b4690e;
    --doc-warn-bg: #fdf3e3;
    --doc-plan: #6b40d8;
    --doc-plan-bg: #f0ebfd;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--doc-bg);
    color: var(--doc-text);
    font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus {
    left: 8px;
    top: 8px;
    background: #fff;
    padding: 8px 12px;
    z-index: 10;
}

/* --- Barre supérieure ---------------------------------------------------- */

.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    background: var(--doc-sidebar);
    color: #fff;
}

.docs-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}
.docs-brand-name { font-weight: 700; letter-spacing: -0.01em; }
.docs-brand-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--doc-accent);
    border: 1px solid var(--doc-accent);
    border-radius: 999px;
    padding: 1px 8px;
}
.docs-back {
    margin-left: auto;
    color: var(--doc-sidebar-text);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}
.docs-back:hover { color: #fff; }

.nav-burger {
    display: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

/* --- Structure ----------------------------------------------------------- */

.docs-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
}

.docs-nav {
    position: sticky;
    top: 49px;
    align-self: start;
    height: calc(100vh - 49px);
    overflow-y: auto;
    padding: 26px 18px 60px;
    background: var(--doc-sidebar);
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

.docs-nav-title {
    margin: 22px 0 8px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #6d778f;
}
.docs-nav-title:first-child { margin-top: 0; }

.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li { margin: 0; }
.docs-nav a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--doc-sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.35;
}
.docs-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.docs-nav a.active {
    background: var(--doc-accent);
    color: #fff;
    font-weight: 600;
}

.docs-main { min-width: 0; }
.docs-article {
    max-width: 780px;
    margin: 0 auto;
    padding: 44px 28px 20px;
}

/* --- Typographie --------------------------------------------------------- */

h1, h2, h3 {
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    letter-spacing: -0.015em;
    line-height: 1.25;
}
h1 { font-size: 2.1rem; margin: 0 0 12px; }
h2 {
    font-size: 1.4rem;
    margin: 46px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--doc-border);
}
h3 { font-size: 1.08rem; margin: 28px 0 8px; }

.lead {
    font-size: 1.12rem;
    color: var(--doc-muted);
    margin: 0 0 28px;
}

p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 6px; }

a { color: var(--doc-accent-dark); }
a:hover { color: var(--doc-accent); }

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: var(--doc-inline-bg);
    padding: 2px 6px;
    border-radius: 5px;
}

/* --- Blocs de code ------------------------------------------------------- */

.code {
    margin: 0 0 22px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--doc-code-bg);
    border: 1px solid #21262d;
}
.code-head {
    padding: 7px 14px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8b949e;
    border-bottom: 1px solid #21262d;
}
.code pre {
    margin: 0;
    padding: 15px 16px;
    overflow-x: auto;
}
.code code {
    background: none;
    padding: 0;
    color: var(--doc-code-text);
    font-size: 0.82rem;
    line-height: 1.6;
}

/* --- Tableaux ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; margin-bottom: 22px; }
table {
    width: 100%;
    border-collapse: collapse;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: 0.88rem;
}
th, td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--doc-border);
    vertical-align: top;
}
th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--doc-muted);
}
td code { white-space: nowrap; }

/* --- Encadrés ------------------------------------------------------------ */

.callout {
    margin: 0 0 22px;
    padding: 14px 18px;
    border-left: 3px solid var(--doc-info);
    border-radius: 0 8px 8px 0;
    background: var(--doc-info-bg);
    font-size: 0.95rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
    margin: 0 0 4px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--doc-info);
}
.callout-warn { border-color: var(--doc-warn); background: var(--doc-warn-bg); }
.callout-warn .callout-title { color: var(--doc-warn); }
.callout-plan { border-color: var(--doc-plan); background: var(--doc-plan-bg); }
.callout-plan .callout-title { color: var(--doc-plan); }

/* --- Cartes de sommaire (page d'accueil) --------------------------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.card-link {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: #fff;
}
.card-link:hover { border-color: var(--doc-accent); }
.card-link strong {
    display: block;
    font-family: ui-sans-serif, system-ui, sans-serif;
    margin-bottom: 4px;
}
.card-link span { color: var(--doc-muted); font-size: 0.9rem; }

/* --- Pied de page / page suivante ---------------------------------------- */

.docs-next {
    margin: 46px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--doc-border);
}
.docs-next a {
    display: inline-block;
    text-decoration: none;
    font-family: ui-sans-serif, system-ui, sans-serif;
}
.docs-next span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--doc-muted);
}
.docs-next strong { font-size: 1.05rem; }

.docs-footer {
    max-width: 780px;
    margin: 0 auto;
    padding: 26px 28px 70px;
    color: var(--doc-muted);
    font-size: 0.9rem;
}

.nav-toggle { display: none; }

/* --- Mobile -------------------------------------------------------------- */

@media (max-width: 860px) {
    .docs-shell { grid-template-columns: minmax(0, 1fr); }
    .nav-burger { display: inline-block; }
    .docs-nav {
        display: none;
        position: static;
        height: auto;
        padding: 18px 20px 26px;
    }
    .nav-toggle:checked ~ .docs-shell .docs-nav { display: block; }
    .docs-article { padding: 30px 20px 10px; }
    h1 { font-size: 1.7rem; }
}

/* --- Thème sombre -------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
    :root {
        --doc-bg: #0f1219;
        --doc-text: #e7eaf0;
        --doc-muted: #99a2b5;
        --doc-border: #262c39;
        --doc-inline-bg: #1b2130;
        --doc-accent-dark: #2ec4b4;
        --doc-info-bg: #12261f;
        --doc-warn-bg: #2a2114;
        --doc-plan-bg: #1e1a33;
    }
    .card-link { background: #151a24; }
}
