header {
    position: sticky;
    top: 20px;
    z-index: 999;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    pointer-events: none;
}

header .container {
    width: fit-content;
    pointer-events: all;
}

header .menu {
    padding: 14px 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition:
        background .3s ease,
        border-color .3s ease,
        transform .3s ease;

        display: flex;
        align-items: center;
        gap: 28px;
        list-style: none;
        
        li {
            list-style: none;
        }
}

header .menu a {
    position: relative;
    text-decoration: none;
    font-family: var(--main-font);
    font-size: 15px;
    font-weight: 500;
    transition: color .25s ease;
}

header .menu li:not(.hero-button) a {
    color: var(--white);
}

header .menu li.hero-button a {
    color: var(--dark);
}

header .menu li:not(.hero-button) a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width .25s ease;
}

header .menu li:not(.hero-button) a:hover {
    color: var(--primary-color);
}

header .menu li:not(.hero-button) a:hover::after {
    width: 100%;
}

header.scrolled .menu {
    background: rgba(3, 7, 30, 0.65);
    border-color: rgba(255, 255, 255, 0.12);
}

.wp-admin #poststuff #post-body .acf-field .acf-input .acf-taxonomy-field .acf-actions a,
.wp-admin #poststuff #post-body .acf-field .acf-input .acf-taxonomy-field .acf-actions a:hover,
.acf-field-taxonomy .acf-icon.-plus.small,
.acf-field-taxonomy .acf-icon.-plus.small:hover {
    background: blue !important;
    color: white !important;
}

/* --- Burger (caché en desktop) --- */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: none;
    cursor: pointer;
    pointer-events: all;
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
}

/* --- Responsive < 992px --- */
@media (max-width: 991px) {

    header .container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        position: relative;
    }

    /* Le burger prend l'aspect "pilule" verre dépoli */
    .burger {
        display: flex;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

    /* Le menu devient un panneau déroulant */
    header .menu_main {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        min-width: 220px;
    }

    header .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border-radius: 18px;
        max-height: 0;
        padding: 0 26px;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: max-height .35s ease, opacity .3s ease,
                    transform .3s ease, padding .3s ease;
    }

    header.menu-open .menu {
        max-height: 80vh;
        padding: 18px 26px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }

    header .menu li {
        width: 100%;
    }

    header .menu a {
        display: block;
        padding: 8px 0;
        font-size: 16px;
    }

    /* Le soulignement animé n'a pas de sens en vertical */
    header .menu li:not(.hero-button) a::after {
        display: none;
    }

    /* Animation burger -> croix */
    header.menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    header.menu-open .burger span:nth-child(2) { opacity: 0; }
    header.menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Case à cocher + burger masqués en desktop */
.menu-toggle,
.burger {
    display: none;
}

@media (max-width: 991px) {

    header .container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        position: relative;
    }

    /* Le burger : pilule verre dépoli avec icône ☰ */
    .burger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        border-radius: 999px;
        font-size: 22px;
        color: var(--white);
        cursor: pointer;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

    .burger::before { content: "\2630"; }                        /* ☰ */
    #menu-toggle:checked ~ .burger::before { content: "\2715"; } /* ✕ */

    /* Le menu devient un panneau déroulant */
    header .menu_main {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        min-width: 220px;
    }

    header .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border-radius: 18px;
        max-height: 0;
        padding: 0 26px;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: max-height .35s ease, opacity .3s ease,
                    transform .3s ease, padding .3s ease;
    }

    header .menu .hero-button {
        padding: 5px !important;
    }

    /* État ouvert */
    #menu-toggle:checked ~ .menu_main .menu {
        max-height: 80vh;
        padding: 18px 26px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }

    header .menu li { width: 100%; }
    header .menu a  { display: block; padding: 8px 0; font-size: 16px; }
    header .menu li:not(.hero-button) a::after { display: none; }
}