/* ===================== */
/*  VARIABLES / GLOBAL   */
/* ===================== */
:root{
  --nav-h: 90px;
  --nav-bg: #4a8dcb;     /* bleu barre */
  --nav-text: #fff;
  --nav-hover: #ff7a21;  /* orange hover */
  --container: 1240px;
}

html, body { 
    margin:0;
 }


body{ 
    padding-top: var(--nav-h);
 }   


/* ===================== */
/*        TOPBAR         */
/* ===================== */
.topbar{
  position: fixed; 
  top:0; 
  left:0; 
  width:100%; 
  height:var(--nav-h);
  z-index: 9999;
  background: var(--nav-bg);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.topbar .topbar-content{
  position: relative;                /* référence pour le menu centré */
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;    /* logo à gauche / zone droite libre */
  height: var(--nav-h);
}

/* Logo + nom */
.topbar-brand{
  display:flex; 
  align-items:center; 
  gap:12px;
  text-decoration:none; 
  color: var(--nav-text);
}


.topbar-brand img{ 
    height:60px; 
    width:auto; 
}


.topbar-brand span{
     font-size:30px; 
     }

/* ===================== */
/*         MENU          */
/* ===================== */

.menu{
  position: absolute;                
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 56px;
  margin: 0; 
  padding: 0; 
  list-style: none;
}

.menu_li{
  position: relative;
  padding-bottom: 10px;            
}

.menu_bouton{
  position: relative;
  display: inline-block;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 30px;
  letter-spacing: .2px;
  padding: 10px 0;
  transition: color .2s ease;
}

/* Soulignement animé */
#mainMenu .menu_bouton::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: #ff7a21;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: opacity .2s ease, transform .2s ease;
}

/* au hover ou focus */
#mainMenu .menu_bouton:hover::after,
#mainMenu .menu_bouton:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
}

/* ===================== */
/*     SOUS-MENUS        */
/* ===================== */

.menu_sousMenu{
  position: absolute;
  top: 100%;                      
  left: 50%;
  transform: translateX(0) translateY(8px); /* centré + petit slide */
  margin: 0;
  padding: 10px 0;
  list-style: none;
  width: max-content;               
  min-width: 220px;                
  background: var(--nav-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10000;                   
}

.menu_li:hover .menu_sousMenu,
.menu_li:focus-within .menu_sousMenu,
.menu_sousMenu:hover{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.menu_sousMenu_li{ margin:0; }

.menu_sousMenu_bouton{
  display:block;
  padding: 10px 16px;
  color:#fff; 
  text-decoration:none;
  font-size: 20px; 
  white-space: nowrap;               /* pas de retour à la ligne */
  transition: background .2s ease, color .2s ease;
}
.menu_sousMenu_bouton:hover{
  background: rgba(255,255,255,.12);
  color:#fff;
}



/* ===================== */
/*   BOUTON BURGER BASE  */
/* ===================== */

.topbar-burger{
    display: none;                
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: auto;
    border: 1px solid #ff7a21;
    background: rgba(0,0,0,.10);    
    cursor: pointer;
}

/* lignes du burger */
.topbar-burger span {
    background: #fff;
    transition: transform .25s ease, opacity .25s ease;
    width: 22px;
    height: 2px; /* plus fin = plus design */
}


.topbar-burger span + span{
    margin-top: 5px;
}



/* ===================== */
/*      RESPONSIVE       */
/* ===================== */

@media (max-width: 1024px){

    :root{
        --nav-h: 70px; 
    }
    .topbar{
        box-shadow: 0 3px 12px rgba(0,0,0,.25);
    }
    .topbar-content{
        max-width: 100%;
        padding: 0 16px;
        justify-content: space-between;   /* logo à gauche, burger à droite */
    }
    .menu {
        display: none; /* cacher le menu horizontal */
    }


    .topbar-burger{
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
    }
    .topbar-brand img{
        height: 48px;
    }
    .topbar-brand span{
        font-size: 20px;
    }
    .menu_sousMenu {
    position: static;             
    transform: none;
    opacity: 1;
    pointer-events: auto;
    list-style: none;
    margin: 4px auto 8px;
    padding: 10px 14px;
    width: 100%;
    max-width: 320px;
    background: #4a8dcb;
    border-radius: 10px;
    box-shadow: none;
  }

  .menu_sousMenu_li {
    margin: 0;
  }

  .menu_sousMenu_bouton {
    display: block;
    padding: 6px 0;
    font-size: 25px;
    color: #ffffff;
    padding-left: 10px;
    border-radius: 10px;
    transition: background .25s ease, color .25s ease;
    background: rgba(255, 255, 255, 0); 
    border: 1px solid transparent;
  }

.menu_sousMenu_bouton:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid transparent; 
  text-decoration: underline;
}
  }

@media (max-width: 760px) {

  /* On cache le menu par défaut sur mobile */
  #mainMenu {
    position: absolute;
    top: 70px;       
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 14px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #00314c;
    box-shadow: 0 12px 24px rgba(0,0,0,.25);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
  }

  /* Quand on clique sur le burger : la classe .menu-open est ajoutée */
  #mainMenu.menu-open {
    max-height: 700px;        
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* style des liens dans le menu mobile */
  #mainMenu .menu_bouton {
        display: block;
        width: 100%;
        font-size: 25px;
        text-align: center;
        padding: 10px 0;
        color: var(--nav-text);
    }

       #mainMenu .menu_bouton::after {
        display: none;
    }

  #mainMenu .menu_sousMenu {
    margin: 8px auto 0;
    width: 90%;
    max-width: 320px;
}


#mainMenu .menu_sousMenu_bouton,
#mainMenu .menu_sousMenu_bouton:hover {
    display: block;
    box-sizing: border-box;
    padding: 8px 14px;        
    margin: 0;              
    border-radius: 8px;
    border: 1px solid transparent;  
    text-align: left;
}

#mainMenu .menu_sousMenu_bouton:hover {
    background: rgba(255,255,255,0.12);
}


  /* Désactiver le hover des sous-menus sur mobile */
    .menu_li:hover .menu_sousMenu,
    .menu_sousMenu:hover {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: pointer;
    }
  
  }