/* LAYOUT.CSS - Source: index.css.bak (Massive Restore) */
/* Layout - Sidebar + Content */
.main-wrapper {
    display: flex;
    max-width: var(--max-width);
    margin: 0 auto;
    gap: 4rem;
    padding: 0 5%;
}

/* Sidebar styles moved to consolidated section at line 530 */




.main-footer {
    padding: 6rem 5%;
    background: var(--brand-neutral);
    color: var(--white);
    text-align: center;
}


/* Header & Navigation */
.main-header {
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--brand-neutral);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Nav Overlay & Panel */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100%;
    background: var(--white);
    z-index: 2001;
    padding: 2.5rem 2rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-nav.open {
    right: 0;
}

.menu-close {
    align-self: flex-end;
    font-size: 2.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 1rem;
}

/* Menu Mobile - Plan de l'Encyclopédie (Cloné) */
.mobile-nav .mobile-ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}

/* Titres des Pôles (I, II, III...), Titres d'Annexes & En-têtes Manuels - LES PATRONS VISUELS */
.mobile-nav .sidebar-heading,
.mobile-nav .sidebar-title,
.mobile-nav .mobile-nav-heading {
    color: #1a56db !important; /* Bleu vif pour l'autorité */
    font-size: 1.15rem !important; /* Plus grand */
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 0.02rem;
    margin: 2.5rem 0 0.75rem 0 !important;
    padding: 0 !important;
    text-align: left !important;
    display: block !important;
    border: none !important;
}

/* Sections & Liens (Les subordonnés) - On gère l'indentation globale */
.mobile-nav li:not(.sidebar-heading):not(.sidebar-title):not(.mobile-nav-heading),
.mobile-nav .mobile-entry {
    padding-left: 2rem !important; /* Décalage marqué vers la droite (32px) */
    list-style: none !important;
    margin-bottom: 0.25rem;
}

/* Style des liens dans le menu mobile */
.mobile-nav .mobile-nav-link {
    display: block;
    padding: 0.5rem 0;
    font-size: 1rem !important; /* On garde une taille lisible */
    font-weight: 500 !important; /* Moins gras par défaut */
    color: #1e293b;
    text-decoration: none;
    border: none !important;
    transition: all 0.2s;
    line-height: 1.4;
}

.mobile-nav .mobile-nav-link.active {
    color: #1e293b !important; /* On force le noir/gris des autres liens */
    font-weight: 500 !important; /* On force le poids normal des autres liens */
    padding-left: 0 !important; /* Le décalage est déjà géré par le parent LI */
}

/* On s'assure que rien ne dépasse à gauche sauf les titres bleus */
.mobile-nav .mobile-ul li {
    text-align: left !important;
}



/* Base Design System Badges */
.cat-v2-badge {
    background: rgba(26, 86, 219, 0.1);
    color: var(--brand-primary);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    border: 1px solid rgba(26, 86, 219, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.ademe-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.2);
}


.sidebar-link-mapping {
    font-weight: 700 !important;
    color: var(--accent-blue) !important;
}



.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 10001;
    flex-direction: column;
    gap: 6px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--brand-neutral);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: var(--brand-primary);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--brand-primary);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    padding: 2.5rem 2rem 5rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    contain: layout style;
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-list {
    list-style: none;
}

.mobile-nav-item {
    margin-bottom: 0.5rem;
}

.mobile-nav-link {
    display: block;
    padding: 1.1rem 0;
    /* Aération tactile pour éviter les miss-clicks */
    text-decoration: none;
    color: var(--brand-neutral);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: color 0.2s;
}

.mobile-nav-link:hover {
    color: var(--brand-neutral); /* Hover discret */
}


.mobile-nav-heading {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--brand-primary-accessible);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mobile-nav-heading:first-child {
    margin-top: 0;
}

.menu-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--brand-neutral);
    padding: 0.5rem;
    z-index: 10001;
    transition: color 0.2s;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.menu-close:hover {
    color: var(--brand-primary);
    background: rgba(26, 86, 219, 0.05);
}


.logo-link {
    text-decoration: none;
    color: var(--brand-neutral);
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.9;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    align-items: center;
}

.logo-accent {
    color: var(--brand-primary);
}

.nav-menu {
    font-weight: 600;
    display: flex;
    gap: 2rem;
}

.nav-item {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--brand-primary);
}



.main-footer {
    background: var(--dark-bg);
    color: var(--text-light-dim);
    padding: 3.5rem 2rem;
    margin-top: 4rem;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand {
    font-size: 0.85rem;
    max-width: 300px;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 0.5rem;
    display: block;
}


.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--border-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--brand-primary);
}

.footer-credits {
    font-size: 0.8rem;
    color: var(--text-light-dim);
}



/* ============================================================
   STLYES EXTRAITS DE INDEX.HTML (MIGRATION ZÉRO INLINE)
   ============================================================ */

.logo-accent {
    color: var(--brand-primary);
}

/* Sidebar Navigation (Expert Hierarchy - Consolidated & Synchronized with Scope 3) */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0; /* Empêche l'écrasement de la barre latérale sur petits écrans/tables larges */
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border);
    text-align: left !important;
}

.sidebar-title {
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    padding-left: 0 !important;
}

.sidebar nav ul.sidebar-list {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.sidebar-heading {
    margin-top: 1.25rem; /* Exact Scope 3 spacing */
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--text-muted); /* #475569 = style Scope 3 */
    padding: 0 !important;
}

.sidebar-list li {
    margin-bottom: 0.75rem; /* Exact Scope 3 gap */
}

.sidebar-list li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem !important; /* Exact Scope 3 sizing */
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    padding: 0 0 0 1.25rem !important; /* No Y padding, exact Scope 3 indentation */
    line-height: 1.4;
    border-left: none !important;
}

.sidebar-list li a:hover {
    color: var(--brand-primary);
    font-weight: 700;
    transform: translateX(4px); /* Sensation interactive Scope 3 */
}

@media (min-width: 1025px) {
    .sidebar-list li a.active {
        color: var(--brand-primary) !important;
        font-weight: 800 !important;
        border-left: none !important;
        background: transparent !important;
    }
}


/* Custom Scrollbar (Stealth Design) */
.sidebar::-webkit-scrollbar {
    width: 3px !important;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent !important;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--brand-primary) !important;
    border-radius: 10px !important;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary-hover) !important;
}




.main-footer {
    background: var(--surface-1);
    border-top: 1px solid var(--border);
    padding: 5rem 5% 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes strictement égales */
    align-items: start;
    gap: 3rem; /* Espacement harmonisé */
    text-align: left;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.footer-brand .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 280px;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(26, 86, 219, 0.05);
    color: var(--brand-primary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(26, 86, 219, 0.1);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--brand-primary);
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
}

.badge-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0.4;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.4; }
    70% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.footer-nav, .footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligne les liens à gauche */
    text-align: left;
    gap: 0.85rem;
}

.footer-nav-title {
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-neutral);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px; /* Espace fixe entre icône et texte */
}

.footer-nav-title svg {
    color: var(--brand-primary);
    flex-shrink: 0;
}

.footer-nav a, .footer-link {
    text-decoration: none;
    color: var(--text-light-dim);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease;
    padding-left: 0; /* Anti-décalage initial */
}

.footer-nav a:hover, .footer-link:hover {
    color: var(--brand-primary);
    padding-left: 5px;
}

.footer-top-link {
    margin-top: 1rem;
    color: var(--brand-primary) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.7rem !important;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 4rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--surface-2);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3.5rem;
    }
    
    .footer-brand .logo-link, .footer-nav-title, .footer-nav, .footer-links {
        justify-content: center;
        align-items: center;
    }
    
    .footer-tagline {
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-nav a:hover, .footer-link:hover {
        padding-left: 0;
        transform: translateY(-2px);
    }
}


