/* ------------------ VARIABLES ------------------ */
:root {
    --transition-speed: 0.45s;
    --primary-blue: #2196F3;
    --white: #ffffff;
}


/* Chanement de couleur du header en fontion des pages */

body[data-page="app_public"] {
    --header-border-color: var(--couleur-blanc);
}

body[data-page="app_accueil"] {
    --header-border-color: var(--couleur-blanc);
}

body[data-page="app_atelier"] {
    --header-border-color: var(--couleur-bleue);
}

body[data-page="app_stage"] {
    --header-border-color: var(--couleur-jaune);
}

body[data-page="app_contact"] {
    --header-border-color: var(--couleur-vert);
}


/* -------------- MENU BURGER (MOBILE) -------------- */

#burger-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background: url("../../img/geek-decoratir-oCkEilL.svg") no-repeat center center;
    background-size: 40px; /* Laisse l'image respirer à l'intérieur du bouton */
    border: none;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    color: white;
    width: 50px; /* Plus carré, standard mobile */
    height: 50px; /* Plus carré, standard mobile */
    display: none; 
    align-items: center;
    justify-content: center;
    border-radius: 10px; /* Légèrement adouci proportionnellement à la nouvelle taille */
}

#close-icon {
    display: none;
    font-size: 30px;
    color: white;
}

#mobile-menu {
    position: fixed;
    top: -150%;
    left: 0;
    width: 100%;
    /* min-height: 50vh; */
    background-color: black;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: top 0.3s ease-in-out;
    z-index: 1001;
}

#mobile-menu.open {
    top: 0;
}

#mobile-menu.closing {
    top: -50%;
}

#mobile-menu ul {
    list-style: none;
    padding: 0;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    }

#mobile-menu li {
    margin: 10px 0;
    font-size: 2em;
}

#mobile-menu a {
    color: white;
    transition: color 0.3s ease;
}

#mobile-menu a:hover {
    color: var(--header-border-color);
}


#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 900;
}

#mobile-menu.open ~ #overlay {
    display: block;
}

.login-mobile {
    display: none;
}

@media screen and (min-width: 769px) {
    #mobile-menu.open{
        display: none;
    }
}


/* -------------- MENU DESKTOP -------------- */

.nav-bar {
    position: fixed; 
    right: 50px; 
    top: 65px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center; 
    padding: 10px;
    z-index: 1;
}

.nav-bar a {
    color: white;
    transition: color 0.3s ease;
}

.nav-bar a:hover {
    color: var(--header-border-color);
}

.logo-site {
    position: fixed;
    top: 30px;  
    left: 30px; 
    width: clamp(100px, 12vw, 180px); /* Taille min 100px, fluide 12vw, max 180px */
    height: auto;
    z-index: 1000; 
}

/* Menu en croix  */
.cross-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 570px;
    position: relative;
    transition: transform 0.4s ease-in-out;
    margin-top: 2rem;
}


/* Logo accueil à gauche des ul */
.cross-menu .row.right .menu-item {  /*logo home à gauche */
    position: absolute;
    right: -100px;
    top: 30px;
    transform: translateY(-50%);
    width: 100px;
}



/* Vecteurs haut avec hovers */
.row.top {
    position: relative;
}

.row.top::after {
    content: " ";
    border-bottom: solid var(--header-border-color) 1px;
    border-radius: 0 0 0 10px;
    height: 35px;
    width: 23%;
    border-left: solid var(--header-border-color) 1px;
    position: absolute;
    left: 392px;
    top: -30px;
}

.row.top::before {
    content: " ";
    border-top: solid var(--header-border-color) 1px;
    border-radius: 0 10px 0 0;
    height: 25px;
    width: 40%;
    border-right: solid var(--header-border-color) 1px;
    position: absolute;
    left: 164px;
    top: -50px;
}

/* Vecteurs bas avec hovers */
.row.bottom {
    position: relative;
}

.row.bottom::after {
    content: " ";
    border-bottom: solid var(--header-border-color) 1px;
    border-radius: 0 0 0 10px;
    height: 35px;
    width: 38%;
    border-left: solid var(--header-border-color) 1px;
    position: absolute;
    left: 159px;
    top: 60px;
}

.row.bottom::before {
    content: " ";
    border-top: solid var(--header-border-color) 1px;
    border-radius: 0 10px 0 0;
    height: 25px;
    width: 20%;
    border-right: solid var(--header-border-color) 1px;
    position: absolute;
    left: 45px;
    top: 40px;
}


/* Alignement des éléments de la navbar */
.row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.middle {
    display: flex;
    justify-content: space-between;
}

.menu-item {
    width: 203px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

/* Animation au scroll */

.cross-menu .menu-item {
    position: absolute;
    transition: transform 0.6s ease-in-out, opacity 0.4s ease-in-out;
}

/* Par défaut (vue croix) */
.cross-menu .home {
    transform: translate(315px, 0);  /*logo home à droite */ 
}
.cross-menu .ateliers {
    transform: translate(0, -50px);
}
.cross-menu .accueil {
    transform: translate(0px, 0);
}
.cross-menu .contact {
    transform: translate(350px, 0);
}
.cross-menu .stages {
    transform: translate(0, 50px);
    z-index: 2;
}

/* Quand on scroll */
.cross-menu.scrolled {
    /* border: solid 1px yellow; */
    width: 80%;
    .menu-item {
        opacity: 1;
        left: 5vw;
        width: auto;
        margin: 0;
        top: -25px;
    }
}

.cross-menu.scrolled .ateliers {
    transform: translate(20vw, 0);
}
.cross-menu.scrolled .accueil {
    transform: translate(0, 0);
}
.cross-menu.scrolled .contact {
    transform: translate(60vw, 0);
}
.cross-menu.scrolled .stages {
    transform: translate(40vw, 0);
}

/* Cacher le logo du site quand le menu est scrolled
   NOTE : le logo ayant été sorti de .nav-bar dans le Twig, il n'est plus
   descendant de .cross-menu — ce sélecteur ne correspond donc plus à rien.
   Voir la variante :has() plus bas si le comportement doit être rétabli. */
.cross-menu.scrolled  .logo-site {
    display: none;
}

/* Cacher les vectors ::before et ::after  */
.cross-menu.scrolled .row.top::before,
.cross-menu.scrolled .row.top::after,
.cross-menu.scrolled .row.bottom::before,
.cross-menu.scrolled .row.bottom::after {
    display: none;
    content: none;
}

nav a {
    padding: 0;
}

/* la navbar horizontale remonte au scroll */
.nav-bar.scrolled {
    /* border: solid 1px green; */
    box-sizing: border-box;
    top: 0px;
    left: 0;
    z-index: 5;
    background-color: var(--couleur-noir);
    height: 80px;
    width: 100%;
    padding: 12px 20px;
    /* transition: top 0.3s ease, background-color 0.3s ease; */

   /*  .row {
        border: solid 1px red;
    } */
}

/* la navbar horizontale reste lisible sans background */
body.with-navbar-offset {
    padding-top: 80px; 
    transition: padding-top 0.3s ease;
}

  

/* Liens actifs */
.nav-link.active {
    font-weight: bold;
}

/*Page Accueil */
body[data-page="app_public"] .ateliers-link:hover {
    color: var(--couleur-bleue);
}

body[data-page="app_public"] .stages-link:hover {
    color: var(--couleur-jaune);
}

body[data-page="app_public"] .contact-link:hover {
    color: var(--couleur-vert);
}

 /* Page Atelier et Stage */
body[data-page="app_atelier"] a.ateliers-link {
    color: var(--header-border-color);
}

body[data-page="app_stage"] a.stages-link {
    color: var(--header-border-color);
}

.accueil-link.active {
    color: var(--couleur-rose);
}

body[data-page="app_contact"] a.contact-link {
    color: var(--header-border-color);
}

#scrollToTop {
    position: fixed;
    top: 20px;
    left: 3vw;
    width: 45px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#scrollToTop img {
    width: 100%;
    height: auto;
    display: block;
}

#scrollToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

.login-item {
    width: 45px; /* On conserve cette excellente taille */
    box-sizing: border-box;
    padding: 0;
    height: auto;
    position: fixed;
    right: 25px;
}

/* Ajout : sécurité pour Lighthouse et le rendu mobile */
.login-item img {
    width: 100%;
    height: auto;
    display: block;
}


/* =========================================================================
   MOBILE (max-width: 768px)
   Bloc placé EN FIN DE FICHIER : à spécificité égale, c'est la dernière
   règle du fichier qui gagne. Placé plus haut, il était écrasé par la
   règle .logo-site du bloc DESKTOP
   ========================================================================= */
@media screen and (max-width: 768px) {

    .logo-site {
        top: 12px;
        left: 12px;
        width: clamp(80px, 25vw, 120px);
    }

    .login-mobile {
        display: block;
        margin-top: 1rem;
        margin-left: 1rem;
        width: 40px;
        height: auto;
    }

    #burger-btn {
        display: flex;
        background: var(--couleur-noir);
    }

    body.with-navbar-offset #burger-btn {
        display: none;
    }

    .nav-bar,
    .nav-bar.scrolled,
    .nav-bar.horizontal-menu {
        display: none;
    }
}