/* Resets utiles */
html, body { margin: 0; }

a, button {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent; /* iOS/Android */
}

a:focus, button:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* ===== Visibilité desktop-first ===== */
.mobile-navbar,
.mobile-menu,
.close-menu {
  display: none;
}

/* Cacher un éventuel bloc Navigation Gutenberg dans le header */
header.site-header .wp-block-navigation {
  display: none !important;
}


/* =================================================================================
   ======================================DESKTOP====================================
   ================================================================================= */

/*===================== MENU PRINCIPAL =====================*/
/*==========================================================*/

/* DECALAGE POUR SESSION ADMIN*/
body.admin-bar .site-header { 
  top: 6%!important; 
}

.site-header {
  width: 90%;
  height: 70px;

  position: fixed;
  transform: translate(-50%, 3%);
  top: 3%;
  left: 50%; right: 0;
  z-index: 9999;

  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

/* ===== Conteneur NAVBAR ===== */

.custom-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0 1rem;
  gap: clamp(0.5rem, 2vw, 2rem);
  width: 100%;
  min-width: 0;
}

/* Groupes menus */
.menu-left, .menu-right{ 
  display: flex; 
  align-items: center;
  padding: 0 1.5rem;

  background-color: var(--nav-bg_opacity);
  height:60px;
  backdrop-filter: blur(10px);
  border-radius: 50px;
  box-shadow: var(--shadow);

}

.menu-primary .menu-item:hover {
  background-color: unset;
  border-radius: unset;
  padding: 0;
  transition: none;
}

.menu-item a{
  font-size:0.9em;
}

/* Listes desktop */
.menu-desktop {
  display: flex;
  gap: clamp(0.5rem, 2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
/*------------------LOGO SITE-----------------*/


.wp-block-site-title{
  font-size:2em!important;
  color: var(--wp--preset--color--couleur-3)!important;
}

.site-branding{
  padding:0!important;
}

/* ============== ESPACE MEDECIN (menu droit) ============= */

/*==========GESTION TEXTE==========*/

.menu-desktop li { 
  position: relative; 
}

/* Liens (niveau principal) — base + effet background animé */
.menu-desktop a {
  text-decoration: none;
  color: var(--nav-text);
  font-weight: 500;
  display: inline-block;
  padding: .6rem .9rem;
  position: relative;
  z-index: 0;
}

/* Effet BACKGROUND au survol (déploiement depuis le centre) */
.menu-desktop > li > a::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 115%;
  height: 100%;
  transform: translate(-50%, -50%) scale(0);
  background: rgb(255, 255, 255);
  border-radius: 9999px;
  z-index: -1;
  opacity: 0;
  transition:
    transform 260ms cubic-bezier(.2,.6,.2,1),
    opacity   160ms ease-out;
  will-change: transform, opacity;
}

@media (hover: hover) {
  .menu-desktop > li > a:hover::before,
  .menu-desktop > li > a:focus-visible::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ===================== SOUS MENU ======================== */
/*==========================================================*/

.menu-desktop .submenu {
  position: absolute;
  top: 100%;
  left: 0;

  background-color: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--shadow);

  list-style: none;
  padding: 1rem 1rem;
  min-width: 200px;

  z-index: 1000;
  display: none;
}

.menu-desktop li:hover > .submenu { 
  display: block; 
}

.menu-desktop .submenu a {
  white-space: nowrap;
  display: block; 
  padding-right: 4rem; 
  padding: 1rem 1rem 1rem 1rem;
  border-bottom:1.5px solid rgb(145, 145, 145, 0.2)
}


/*==========DECALAGE BULLE==========*/

:root {
  --submenu-gap: 25px;
}

.menu-desktop .submenu {
  top: calc(100% + var(--submenu-gap));
}

/*==========GESTION HOVER==========*/

.menu-desktop .submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--submenu-gap));
  height: var(--submenu-gap);

  background: transparent;
  display: block;
}

/* ================ FLECHE "▾" DEROULEMENT SUBMENU ================ */

.menu-desktop > li.menu-item-has-children > a,
.menu-desktop > li.has-submenu > a {
    position: relative;
    padding-right: 1.75rem; /* espace pour la flèche */
}


/*====================== caractère • NAVBAR =======================*/

:root {
  --dot-bloom-dur: 380ms;
  --dot-bloom-ease: cubic-bezier(.2,.7,.2,1);
}

@keyframes dot-bloom {
  0%   { transform: translateY(-50%) scale(1);   }
  50%  { transform: translateY(-50%) scale(2); }
  80%  { transform: translateY(-50%) scale(1.7);}
  100% { transform: translateY(-50%) scale(1.8); }
}

.menu-desktop > li:is(.menu-item-has-children, .has-submenu) > a::after {
  content: "•";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%) scale(1);
  transform-origin: center;
  font-size: 1.5rem;
  color: var(--violet);
  opacity: 1;
  transition: color 220ms ease, opacity 220ms ease;
}

@media (hover: hover) {
  .menu-desktop > li > a:hover::after,
  .menu-desktop > li > a:focus-visible::after,
  .menu-desktop > li:where(:hover, :focus-within) > a::after {
    animation: dot-bloom var(--dot-bloom-dur) var(--dot-bloom-ease) forwards;
    color: var(--violet_hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-desktop > li:is(.menu-item-has-children, .has-submenu) > a::after {
    transition: none !important;
    animation: none !important;
  }
}

/*============================================*/




/* ================ FLECHE "➔" REDIRECTION SUBMENU ================ */

.menu-desktop .submenu > li > a {
  position: relative;
  padding-right: 4rem;
}

.menu-desktop .submenu > li > a::after {
  content: "➔";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--violet);
  opacity: 1;
  transition: transform .2s ease, opacity .2s ease, color .2s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .menu-desktop .submenu > li > a:hover::after,
  .menu-desktop .submenu > li > a:focus-visible::after {
    transform: translateY(-50%) translateX(4px);
    color: var(--violet_hover);
  }
}

.menu-desktop .submenu > li > a {
  position: relative;
  white-space: nowrap;
  border-bottom: none;
}

.menu-desktop .submenu > li > a::before {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0;
  height: 1.5px;
  background: rgba(145,145,145,0.2);
  transition: height .2s ease, background-color .2s ease;
}

@media (hover: hover) {
  .menu-desktop .submenu > li > a:hover::before,
  .menu-desktop .submenu > li > a:focus-visible::before {
    height: 2.5px;
    background: rgba(43, 43, 43, 0.2);
  }
}

/* =================================================================================
   =============================RESPONSIVE DESKTOP==================================
   ================================================================================= */

@media (max-width: 1400px) {
  .site-header {
    width:95%;
  }
  .menu-desktop { 
    gap: 0.1rem; 
  }
  .custom-navbar { 
    gap: 0.1rem; 
  }
  .site-branding{
    padding: 0 1rem 0 2rem;

  }
}

/* =================================================================================
   ======================================MOBILE=====================================
   ================================================================================= */

@media (max-width: 1200px) {

  .wp-site-blocks { 
    padding-top: 0 !important;
    max-width: 100vw;
    overflow-x: hidden;

  }

  .site-header {
    background-color: rgba(255, 255, 255, 0);
    height: auto;
    backdrop-filter: none;
    box-shadow: none;

    position: fixed;
    transform: none;
  }

  /* Masquer la navbar desktop en mobile */
  header.site-header .custom-navbar,
  header.site-header .menu-desktop {
    display: none !important;
  }
  .site-branding { display: none; }

  /* ======== GESTION ESPACE NAVBAR MOBILE ======== */
  .mobile-navbar,
  .mobile-menu,
  .close-menu { display: block; }

  .mobile-navbar {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;

    top: 0; 
    left: 0;
    width: 100%;
    z-index: 1000;
    margin: 0 !important;
    padding: 0 !important;
  }

  .mobile-bar {
    width: 75%;
    border-radius: 40px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    z-index: 1002;

    backdrop-filter: blur(10px);
    background: var(--nav-bg_opacity);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0.1rem 2rem;

    transition: all 0.2s;
  }

  /* Effet visuel quand le menu est ouvert */
  .mobile-navbar:has(.mobile-menu.open) .mobile-bar {
    height: 5vh;
    width: 100%;
    border-radius: 0;
    margin-top: 0rem;

    backdrop-filter: none;
    background: var(--nav-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0);
  }

  /* ======== CONTENU BARRE MOBILE ======== */
  .mobile-branding {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
  }

  .burger {
    margin-left: auto;
    font-size: 1.7rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-text);
    line-height: 1;
    padding: 0.25rem 0.5rem;
  }

  /* ======== ANIMATION / PANE MENU ======== */
  .mobile-menu {
    position: fixed;
    top: var(--mobile-bar-h);
    left: 50%;
    transform: translateX(-50%);

    width: 95vw;
    max-height: 0;
    margin-top: 1rem;

    transition: all 0.2s ease;

    pointer-events: none;

    background:var(--nav-bg_opacity);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    opacity: 0;

    padding-top: 0;
    z-index: 1001;
    overflow: hidden;
  }

  .mobile-menu.open { 
    width: 100vw;
    max-height: 100vh;
    opacity: 1;
    pointer-events: auto;
  }

  .close-menu { display: none !important; }

  /* ======== BACKGROUND PANELS ======== */
  .mobile-menu .panels {
    position: relative;
    height: 100%;
    width: 200%;
    display: flex;
    transform: translate3d(0, 0, 0);
    transition: transform 0.3s ease;
  }
  .mobile-menu .panels.show-sub { 
    transform: translate3d(-50%, 0, 0); 
  }

  .mobile-menu .panel {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-menu .panel-sub {
    height:auto;
    padding-top: 10vh;
  }

 /*============= COULEUR BACKGROUND SUBMENUS =============*/

.panel-sub.sous-menu-1 {
  background: var(--nav-gradient-custom);
}
.panel-sub.sous-menu-2 {
  background: var(--nav-gradient-custom);
}
.panel-sub.sous-menu-3 {
  background: var(--nav-gradient-custom);
}

  /* ======== TEXTE ======== */
  .menu-mobile { 
    margin: 7vh 0 0 0; 
    height:80vh;
    position:relative; /* peut-être en double*/ 
  }

  .menu-mobile-sub { 
    margin: 0; 
  }

  .menu-mobile,
  .menu-mobile-sub {
    list-style: none;
    padding: 0;
  }

  .menu-mobile > .from-primary ,
  .menu-mobile-sub > li {
    padding: 2rem 0.75rem;
    margin: 0 1rem;
    border-bottom: 1px solid #eee;
  }

  .menu-mobile a,
  .menu-mobile-sub a {
    display: block;
    text-decoration: none;
    font-size: 1.3rem;
  }

  .menu-mobile a { color: var(--nav-text); }
  .menu-mobile-sub a { color: white; }

/*------------------LOGO SITE-----------------*/

.wp-block-site-title{
  font-size:1em!important;
}

/*=========ESPACE MEDECIN=========*/

  .menu-mobile > .from-secondary {
    
    position: absolute;
    bottom: 0;
    left: 0;

    background-color:var(--violet);
    width: 100%;
    height:4rem;

    display:flex;
    align-items: center;
    justify-content: center;
    
  }

  .menu-mobile > .from-secondary > a{

    color:white;
    display: inline-block;
    border-radius: 50px;
    text-align: center; 

  }

/*================================*/

  /* ======== ÉLÉMENTS MENU PRIMAIRE ======== */
  .menu-mobile > li.has-submenu > a {
    position: relative;
    padding-right: 1.5rem;
  }
  .menu-mobile > li.has-submenu > a::after {
    content: "➔";
    position: absolute;
    right: .25rem; top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem; 
    color: var(--violet);;
  }

  /* ======== "← Retour" ======== */
  .submenu-header {
    display: flex; 
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;

    padding: .75rem 0;
    margin: 0 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: .75rem;
    position: sticky; 
    top: 0; 
    z-index: 1;

    background: transparent;
  }
  .submenu-header .back-btn {
    display: inline-flex; 
    align-items: center; 
    gap: .5rem;
    background: none; 
    border: none;
    color: white; 
    font-size: 1rem; 
    cursor: pointer;
    padding: .25rem .25rem;
  }
  .submenu-header .back-btn .arrow { 
    font-size: 1.5rem;
    transform: scaleX(-1); 
    line-height: 1; 
  }

  /* ======== TITLE MENU SECONDAIRE ======== */
  .submenu-title { 
    margin: 1.5rem 0 1.5rem 0;
    font-size: 1.7em!important; 
    font-weight: 500;
    color: white!important;
  }

  /* Sécurité : ne jamais montrer de sous-menu dans le root mobile */
  .menu-mobile .submenu { display: none !important; }

  /* Préférence utilisateur : réduire les animations */
  @media (prefers-reduced-motion: reduce) {
    .mobile-menu,
    .mobile-menu .panels { 
      transition: none !important; 
    }
  }
}

