/* ========================================
   VARIABLES GLOBALES DEFI — partagées entre
   navbar.css, footer.css et les CSS de pages.
   Définies ici une seule fois sur :root.
   ======================================== */
:root {
    --defi-sand:      #F5EFE4;
    --defi-cream:     #FBF7F1;
    --defi-terra:     #C05B3A;
    --defi-terra-d:   #8B3E25;
    --defi-terra-l:   #E07C5A;
    --defi-slate:     #2E4A5F;
    --defi-slate-l:   #4A7090;
    --defi-slate-ll:  #E8EFF5;
    --defi-warm-gray: #7A6F65;
    --defi-text:      #2A2218;
    --defi-text-s:    #6B5F55;
    --defi-white:     #FFFFFF;
    --defi-border:    #E8DDD0;
    --defi-radius:    12px;
    --defi-font-head: 'Lora', Georgia, serif;
    --defi-font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
    background-color: var(--defi-white);
    border-bottom: 1px solid var(--defi-border);
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 1px 8px rgba(42, 34, 24, 0.06);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo img {
    height: 44px;
    width: auto;
}

/* Hamburger (caché desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background-color: var(--defi-slate);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Contenu nav */
.navbar-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    text-decoration: none;
    color: var(--defi-text-s);
    font-family: var(--defi-font-body);
    font-weight: 400;
    font-size: 15px;
    padding: 7px 13px;
    border-radius: 7px;
    transition: background 0.15s, color 0.15s;
    display: block;
}

.navbar-menu a:hover {
    background-color: var(--defi-sand);
    color: var(--defi-text);
}

/* Dropdown */
.navbar-menu .dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex !important;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 11px;
    opacity: 0.6;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--defi-white);
    border: 1px solid var(--defi-border);
    border-radius: var(--defi-radius);
    box-shadow: 0 8px 24px rgba(42, 34, 24, 0.10);
    min-width: 260px;
    padding: 8px 0;
    z-index: 300;
    list-style: none;
    /* Pont invisible : comble le gap entre le lien et le menu */
    margin-top: 0;
}

/* Dropdown ouvert via JS (.active) — desktop et mobile */
.dropdown-menu.active {
    display: block;
    margin-top: 0;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 9px 18px;
    color: var(--defi-text-s) !important;
    font-size: 14px !important;
    border-radius: 0 !important;
}

.dropdown-menu a:hover {
    background-color: var(--defi-sand) !important;
    color: var(--defi-text) !important;
}

/* Séparateur entre lien nav et bouton CTA */
.navbar-content .navbar-menu {
    margin-right: 16px;
}

/* Bouton Devenir bénévole */
.btn-benevole {
    background-color: var(--defi-terra);
    color: var(--defi-white) !important;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--defi-font-body);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

.btn-benevole:hover {
    background-color: var(--defi-terra-d);
}

/* ========================================
   RESPONSIVE NAVBAR
   ======================================== */

@media (max-width: 1024px) {
    .navbar {
        padding: 0 24px;
        position: relative; /* On quitte sticky pour mobile : le menu sort du flux */
    }

    .hamburger {
        display: flex;
    }

    .navbar-content {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background-color: var(--defi-white);
        border-bottom: 1px solid var(--defi-border);
        box-shadow: 0 8px 24px rgba(42, 34, 24, 0.10);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 24px 20px;
        z-index: 199;
    }

    .navbar-content.active {
        display: flex;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-right: 0;
    }

    .navbar-menu li {
        width: 100%;
        border-bottom: 1px solid var(--defi-border);
    }

    .navbar-menu li:last-child {
        border-bottom: none;
    }

    .navbar-menu a {
        padding: 13px 8px;
        width: 100%;
        border-radius: 0;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0 16px;
        background-color: var(--defi-sand);
    }

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

    .btn-benevole {
        display: block;
        text-align: center;
        margin-top: 12px;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .navbar-logo img {
        height: 36px;
    }
}
