/* ==========================================================================
   VitePress Light Theme - Complete CSS for Symfony Docs
   ========================================================================== */

/* --- Variables Globales --- */
:root {
    --vp-c-bg: #ffffff;
    --vp-c-bg-soft: #f6f6f7;
    --vp-c-bg-mute: #f1f1f4;
    --vp-c-border: rgba(60, 60, 67, 0.12);
    --vp-c-divider: rgba(60, 60, 67, 0.08);
    --vp-c-text-1: #213547;
    --vp-c-text-2: rgba(60, 60, 67, 0.78);
    --vp-c-text-3: rgba(60, 60, 67, 0.56);
    --vp-c-brand: #2563eb;
    --vp-c-brand-light: #3b82f6;
    --vp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --vp-font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --vp-nav-height: 64px;
    --vp-sidebar-width: 280px;
    --vp-toc-width: 224px;
}

/* --- Base & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body.vp-doc-body {
    max-width: 100%;
    overflow-x: hidden;
}

body.vp-doc-body {
    margin: 0;
    font-family: var(--vp-font);
    color: var(--vp-c-text-1);
    background-color: var(--vp-c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Forcer la prise en charge adaptative des médias et images */
.vp-doc img, 
.vp-doc svg {
    max-width: 115%;
    height: auto;
    display: block;
    margin: auto;
}

/* Empêcher le code long de déformer la largeur de la page */
.vp-doc pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Ajustements réactifs pour mobiles et tablettes */
@media (max-width: 960px) {
    .vp-nav {
        padding: 0 16px;
    }

    .vp-nav-container {
        width: 100%;
        max-width: 100%;
    }

    .vp-content {
        width: 100%;
        max-width: 100%;
        padding: 24px 16px;
        box-sizing: border-box;
    }

    .vp-doc-container {
        width: 100%;
        max-width: 100%;
    }
}

/* --- Navigation Supérieure (Header/Navbar) --- */
.vp-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--vp-nav-height);
    background: var(--vp-c-bg);
    border-bottom: 1px solid var(--vp-c-border);
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 32px;
}

.vp-nav-container {
    width: 100%;
    max-width: 1376px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vp-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vp-c-text-1);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.vp-nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vp-nav-link {
    color: var(--vp-c-text-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.vp-nav-link:hover {
    color: var(--vp-c-brand);
}

.vp-badge {
    background: var(--vp-c-bg-mute);
    color: var(--vp-c-text-2);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* --- Structure Principale (Layout 3 colonnes) --- */
.vp-layout {
    display: flex;
    padding-top: var(--vp-nav-height);
    min-height: 100vh;
    max-width: 1376px;
    margin: 0 auto;
}

/* --- Barre Latérale Gauche (Sidebar Nav) --- */
.vp-sidebar {
    position: fixed;
    top: var(--vp-nav-height);
    bottom: 0;
    width: var(--vp-sidebar-width);
    background: var(--vp-c-bg-soft);
    border-right: 1px solid var(--vp-c-border);
    overflow-y: auto;
    padding: 24px 32px;
    z-index: 40;
}

.vp-sidebar-group {
    margin-bottom: 24px;
}

.vp-sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--vp-c-text-3);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.vp-sidebar-link {
    display: block;
    padding: 6px 0;
    color: var(--vp-c-text-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.vp-sidebar-link:hover {
    color: var(--vp-c-brand);
}

.vp-sidebar-link.active {
    color: var(--vp-c-brand);
    font-weight: 600;
}

/* --- Zone de Contenu Central --- */
.vp-content {
    /* margin-left: var(--vp-sidebar-width); */
    flex: 1;
    padding: 32px 48px 64px 48px;
    display: flex;
    justify-content: center;
}

.vp-doc-container {
    flex: 1;
    max-width: 688px;
    width: 100%;
}

/*
** Docs
*/
.post-image-container {
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.02);
    border: 0px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0.5rem;
}

.post-image-container img {
    max-height: 350px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.post-image-container:hover img {
    transform: scale(1.02);
}



/* --- Typographie de la Documentation (`.vp-doc`) --- */
.vp-doc h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--vp-c-divider);
    padding-bottom: 12px;
    color: var(--vp-c-text-1);
}

.vp-doc h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--vp-c-divider);
    padding-bottom: 8px;
    color: var(--vp-c-text-1);
    scroll-margin-top: 80px; /* Offset pour le scroll auto vers les ancres */
}

.vp-doc h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--vp-c-text-1);
    scroll-margin-top: 80px;
}

.vp-doc p, .vp-doc li {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--vp-c-text-2);
}

.vp-doc p.lead {
    font-size: 1.15rem;
    color: var(--vp-c-text-2);
    line-height: 1.6;
}

.vp-doc ul, .vp-doc ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.vp-doc li {
    margin-bottom: 6px;
}

.vp-doc a {
    color: var(--vp-c-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vp-doc a:hover {
    color: var(--vp-c-brand-light);
}

/* --- Callouts / Blocs d'Avertissement (VitePress Custom Blocks) --- */
.custom-block {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 24px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.custom-block .custom-block-title {
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.custom-block.info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.custom-block.tip {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.custom-block.warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.custom-block.danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* --- Blocs de Code & Code en Ligne --- */
.vp-doc code {
    font-family: var(--vp-font-code);
    background: var(--vp-c-bg-mute);
    color: var(--vp-c-text-1);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.88rem;
}

.vp-doc pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 18px 22px;
    border-radius: 8px;
    font-family: var(--vp-font-code);
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 20px 0;
}

.vp-doc pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* --- Sommaire de Droite (Table of Contents / On this page) --- */
.vp-toc {
    width: var(--vp-toc-width);
    margin-left: 48px;
    position: fixed;
    right: 0;
    top: calc(var(--vp-nav-height) + 32px);
    height: calc(100vh - var(--vp-nav-height) - 64px);
    overflow-y: auto;
    display: none; /* Masqué sur petit écran */
}

@media (min-width: 1280px) {
    .vp-toc {
        display: block; /* Affiché sur écran large */
    }
}

.vp-toc-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 12px;
    color: var(--vp-c-text-1);
    letter-spacing: 0.4px;
}

.vp-toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--vp-c-divider);
}

.vp-toc-nav li {
    padding-left: 16px;
    margin: 8px 0;
}

/* Gestion des niveaux d'indentation dans le sommaire de droite (TOC) */
.vp-toc-nav li.level-2 {
    padding-left: 16px;
}

.vp-toc-nav li.level-3 {
    padding-left: 26px; /* Décalage pour les H3 */
}

.vp-toc-nav li.level-4 {
    padding-left: 36px; /* Décalage pour les H4 */
}

.vp-toc-nav li.level-5 {
    padding-left: 46px; /* Décalage pour les H5 */
}

.vp-toc-nav a {
    font-size: 0.85rem;
    color: var(--vp-c-text-2);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vp-toc-nav a:hover {
    color: var(--vp-c-brand);
}

/* Lien d'ancre actif détecté lors du scroll */
.vp-toc-nav a.active {
    color: var(--vp-c-brand);
    font-weight: 600;
}

/* --- Bouton Menu Mobile & Backdrop --- */
.vp-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--vp-c-text-1);
    cursor: pointer;
    padding: 0;
    margin-right: 12px;
}

.vp-backdrop {
    display: none;
    position: fixed;
    top: var(--vp-nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35; /* Juste en dessous de la sidebar */
    backdrop-filter: blur(2px); /* Effet flou stylé (optionnel) */
}

/* --- Adaptations Responsives (Tablettes et Mobiles) --- */
@media (max-width: 960px) {
    .vp-menu-toggle {
        display: flex; /* Affiche le bouton sur mobile */
        align-items: center;
    }

    .vp-sidebar {
        /* On ne masque plus avec display:none, on décale hors de l'écran */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 40;
    }

    /* Classe ajoutée par Javascript pour ouvrir le menu */
    .vp-sidebar.open {
        transform: translateX(0);
    }

    /* Classe ajoutée par Javascript pour afficher le voile */
    .vp-backdrop.open {
        display: block;
    }
    
    .vp-content {
        margin-left: 0;
        padding: 24px 20px;
    }
}
