/**
 * Styles pour le header du site Esperanza
 * Version refactorisée avec accessibilité améliorée
 */

/* Import des variables (si nécessaire) */
@import url('../utils/variables.css');

/* Styles du header */
#navbar {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Header au scroll - fond blanc et textes noirs */
#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Textes noirs lors du scroll */
#navbar.scrolled a {
    color: #333333 !important;
}

#navbar.scrolled .nav-link {
    color: #333333 !important;
}

#navbar.scrolled .menu-toggle {
    color: #333333 !important;
}

/* Container du header */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
}

.site-logo img {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.scrolled .site-logo img {
    max-height: 40px;
}

/* Navigation principale */
.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: var(--sage);
}

/* Effet de soulignement au hover */
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--sage);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

/* Bouton menu mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: white;
    font-size: 1.5rem;
}

.menu-toggle:focus {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

/* Navigation mobile */
@media (max-width: 1023px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background-color: white;
        padding: 2rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: var(--z-modal);
        overflow-y: auto;
    }

    .main-navigation.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        margin-top: 3rem;
    }

    .close-menu {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--charcoal);
    }

    /* Overlay pour le menu mobile */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-modal) - 1);
    }

    .menu-overlay.active {
        display: block;
    }

    /* Empêcher le scroll du body quand le menu est ouvert */
    body.menu-open {
        overflow: hidden;
    }
}
