/* ── Barre compacte sticky qui apparaît quand le menu original a quitté
   le viewport. Desktop uniquement (≥769px). ─────────────────────────── */

.topbar_compact { display: none; }

@media (min-width: 769px) {

    .topbar_compact {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: var(--topbar-bg);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--topbar-bd);
        box-shadow: var(--topbar-shadow);
        visibility: hidden;             /* cachée par défaut, pas de slide */
    }

    body.scrolled .topbar_compact {
        visibility: visible;
    }

    .topbar_compact_inner {
        display: flex;
        align-items: center;
        max-width: 1000px;
        margin: 0 auto;
        /* 24px = 8px (padding body) + 8px (marge .cps_contenu) + 8px (padding
           .cps_contenu) : aligne le bord gauche de la barre sur le contenu. */
        padding: 0 24px;
    }

    /* Mini-header "KS" à gauche */
    .header_titre_compact {
        font-family: 'Digital Desolation', Helvetica, sans-serif;
        font-size: 130%;
        padding: 0 14px;
        line-height: 53px;
        color: var(--fg);
        flex: 0 0 auto;
        border-right: 1px solid var(--topbar-bd);
    }
    .header_titre_compact::first-letter { color: var(--red); }

    /* Menu de la barre compacte */
    .topbar_compact_menu {
        list-style: none;
        margin: 0;
        padding: 0;
        font-family: Azonix, sans-serif;
        font-size: 130%;
        display: flex;
        flex: 1;
        justify-content: center;
        align-items: center;
        min-height: 53px;
        background: transparent;
    }
    .topbar_compact_menu li { float: none; }
    .topbar_compact_menu li a {
        display: block;
        padding: 12px 14px;
        color: var(--accent-text);
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
        transition: color .3s ease;
    }
    .topbar_compact_menu li a:hover { color: var(--red); }

    /* Quand la barre compacte (fixe, ~54px) est visible, décaler les
       sidebars sticky (docs + posts) pour ne pas passer dessous.
       .docs_sidebar : top 10px → 64px, et on réduit la max-height d'autant. */
    body.scrolled .docs_sidebar {
        top: 64px;
        max-height: calc(100vh - 74px);
    }
}
