/*
    ==========================================================
    PROJECT : SITE-GENERIQUE
    FILE    : css/header-burger.css
    AUTH    : Renaud
    CREATED : 07 décembre 2025
    UPDATED : 22 février 2026
    ==========================================================
*/

/**
*   @project        SITE-GENERIQUE
*   @description    Bouton burger et menu mobile déroulant.
*                   Gère l'affichage responsive et l'animation croix.
*
*   @file           css/header-burger.css
*
*   @see            includes/header-burger.php (JS + HTML)
*   @see            css/header-nav.css (Layout)
*   @see            css/buttons-nav.css (Style liens)
*   @see            css/buttons-cta.css (Style CTA)
*   @see            css/color-semantic.css (Variables couleurs)
*/


/* --- BLOCK : Header Burger --- */
.header-burger {
    /* PLACEMENT */
    display: none;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: space-around;
    z-index: 1002;

    /* VISUEL */
    background: none;
    border: none;

    /* EFFET */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}


/* --- ELEMENT : Bar --- */
.header-burger__bar {
    /* PLACEMENT */
    width: 100%;
    height: 3px;

    /* VISUEL */
    background-color: var(--color-headings);
    border-radius: 2px;

    /* EFFET */
    transition: all 0.3s ease;
}


/* ==========================================================================
   RESPONSIVE (Tablette < 1150px)
   ========================================================================== */

@media (max-width: 1150px) {

    /* --- Afficher le bouton burger --- */
    .header-burger {
        display: flex;
    }


    /* --- Surcharge : Nav en menu déroulant --- */
    .header-nav {
        /* PLACEMENT */
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 70px);
        padding: 0;
        z-index: 999;
        overflow-y: auto;

        /* VISUEL */
        background-color: var(--color-background-mobile-menu);
        border-top: 1px solid var(--color-border-mobile-menu);
        box-shadow: 0 50px 100px rgba(0, 0, 0, 0.2);
    }


    /* --- État ouvert (classe ajoutée par JS) --- */
    .header-nav.is-open {
        display: block;
        animation: slideDown 0.3s ease-out;
    }


    /* --- Liste mobile (colonne) --- */
    .header-nav__list {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin: 0;
        padding: 0;
    }


    /* --- Items mobile --- */
    .header-nav__item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid var(--color-border-mobile-menu);
        text-align: center;
    }


    /* --- Liens mobile (surcharge buttons-nav) --- */
    .header-nav__item .buttons-nav {
        /* PLACEMENT */
        display: block;
        width: 100%;
        padding: 1rem 0;

        /* VISUEL */
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;

        /* TEXTE */
        font-size: 1.1rem;
        color: var(--color-nav-text-default);
    }

    .header-nav__item .buttons-nav:hover,
    .header-nav__item .buttons-nav:focus {
        background-color: transparent;
        box-shadow: none;
        color: var(--color-nav-text-hover);
    }

    .header-nav__item .buttons-nav:active {
        background-color: var(--color-background-block);
        color: var(--color-nav-text-active);
        transform: none;
    }


    /* --- CTA mobile --- */
    .header-nav__item--cta {
        padding: 2rem;
        margin-left: 0;
        background-color: var(--color-background-block);
        border-bottom: none;
    }

    .header-nav__item--cta .buttons-cta {
        /* PLACEMENT */
        display: inline-flex;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }


    /* --- Animation croix (burger ouvert) --- */
    .header-burger.is-open .header-burger__bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
        background-color: var(--color-red-120);
    }

    .header-burger.is-open .header-burger__bar:nth-child(2) {
        opacity: 0;
    }

    .header-burger.is-open .header-burger__bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
        background-color: var(--color-red-120);
    }
}


/* --- RESPONSIVE (Mobile < 768px) --- */
@media (max-width: 768px) {
    .header-nav {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
}


/* --- KEYFRAMES --- */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 
   ==========================================================================
   DEBUG (À retirer en production)
   ========================================================================== 
*/

/*
.header-burger { border: 2px dashed red; }
*/