/* =======================================================
   HEADER.CSS — Neve Child
   Desktop : inchangé
   Mobile  : sidebar depuis la droite, géré par JS
   ======================================================= */


/* Désactive le header Neve HFG */
.hfg, .header--row, .nv-nav-menu, [data-hfg-element],
.header-top, .header-menu-container, .neve-main-header {
  display: none !important;
}


/* ---------------------------------------------------------
   1) Header sticky
   --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Desktop */
.header-inner {
  max-width: 2000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between; /* au lieu de space-around */
  gap: 24px;
  padding: 12px 20px;
  min-height: 72px;
}

/* ---------------------------------------------------------
   Header sur section sombre
   --------------------------------------------------------- */
body.on-dark-section .site-header {
  background-color: rgba(15, 23, 42, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.on-dark-section .nav-menu a {
  color: #f9fafb;
}

body.on-dark-section .nav-menu a:hover,
body.on-dark-section .nav-menu .current-menu-item > a,
body.on-dark-section .nav-menu .current_page_item > a {
  color: var(--secondary);
}

body.on-dark-section .nav-toggle__bar {
  background: #f9fafb;
}


/* ---------------------------------------------------------
   2) Logo
   --------------------------------------------------------- */
.site-logo img,
.site-branding img {
  display: block;
  width: 220px;
  height: 60px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .site-logo img,
  .site-branding img {
    width: 190px;
    height: 52px;
  }
}

@media (max-width: 768px) {
  .site-logo img,
  .site-branding img {
    width: 160px;
    height: 44px;
  }
}



/* ---------------------------------------------------------
   3) Navigation desktop
   --------------------------------------------------------- */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-menu {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--dark);
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  color: var(--primary);
}

/* Sous-menus desktop */
.nav-menu li {
  position: relative;
}

.nav-menu .sub-menu {
  position: absolute;
  left: 0;
  top: 100%;
  display: none;
  z-index: 9999;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e8edf2;
  padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
  display: block;
}

.nav-menu .sub-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--dark);
  font-weight: 500;
}

.nav-menu .sub-menu a:hover {
  background: #f7f9fb;
  color: var(--primary);
}


/* ---------------------------------------------------------
   4) CTA header
   --------------------------------------------------------- */
.header-ctas {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-weight: 700;
  text-decoration: none;
  background: var(--secondary);
  color: var(--light);
  border: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.header-cta:hover {
  background: var(--primary);
  color: var(--secondary);
  transform: translateY(-1px);
}


/* ---------------------------------------------------------
   5) Burger button (mobile)
   --------------------------------------------------------- */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  z-index: 1200;
  position: relative;
}

.nav-toggle:hover {
  background: transparent!important ;
}


.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.nav-toggle__bar:hover {
  background: transparent ;
}

.nav-toggle.is-active {
  background: transparent!important;
}

/* Animation burger → croix */
.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* ---------------------------------------------------------
   6) Mobile navigation — Sidebar DROITE
   --------------------------------------------------------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 1100;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
.mobile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

/* Backdrop un peu plus doux */
.mobile-nav.is-open .mobile-backdrop {
  background: rgba(0, 0, 0, 0.45);
}


.mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  max-height: 100vh;
  width: 320px;
  max-width: 88vw;
  /* même rendu que le header */
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);

  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.mobile-nav.is-open .mobile-panel {
  transform: translateX(0);
}

/* Header du panel : plus dense */
.mobile-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: transparent;  /* on laisse voir le blur du panel */
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  color: var(--dark);
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.mobile-close:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: scale(1.03);
}

.mobile-close svg {
  width: 24px;
  height: 24px;
}

/* Panel content (scrollable) */
.mobile-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

/* Panel footer */
.mobile-panel__footer {
  padding: 0;
  border-top: none;
  flex-shrink: 0;
}

.mobile-cta {
  display: block;
  width: auto;
  margin-inline: 1.5rem;
  padding: 14px 20px;
  margin-top: 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  background: var(--secondary);
  color: var(--light);
  border-radius: 2px;
  border: none;
  transition: background-color 0.2s ease;
}

.mobile-cta:hover {
  background: var(--primary);
  color: var(--secondary);
}


/* ---------------------------------------------------------
   7) Mobile menu list — Design amélioré
   --------------------------------------------------------- */
.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Items principaux */
.mobile-menu-list > li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-menu-list > li:last-child {
  border-bottom: none;
}

/* Items de menu : un peu plus contrastés */
.mobile-menu-list > li > a {
  display: flex;
  align-items: center;
  padding: 15px 18px;
  color: #111827;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.mobile-menu-list > li > a:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--primary);
}

/* Item actif */
.mobile-menu-list .current-menu-item > a,
.mobile-menu-list .current_page_item > a {
  background: rgba(0, 0, 0, 0.02);
  color: var(--primary);
}

/* Items avec sous-menu */
.mobile-menu-list > li.menu-item-has-children {
  position: relative;
}

.mobile-menu-list > li.menu-item-has-children > a {
  padding-right: 52px;
}

/* Bouton toggle sous-menu (injecté par JS) */
.submenu-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  color: var(--dark);
  opacity: 0.5;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.submenu-toggle:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.03);
}

.submenu-toggle span {
  font-size: 2rem;
  transition: transform 0.3s ease;
}

.menu-item-has-children.is-open > .submenu-toggle span {
  transform: rotate(90deg);
}


/* ---------------------------------------------------------
   8) Sous-menus mobile — Style distinct
   --------------------------------------------------------- */
.mobile-menu-list .sub-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: none;
  background: rgba(0, 0, 0, 0.02);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-menu-list li.is-open > .sub-menu {
  display: block;
}

.mobile-menu-list .sub-menu li {
  border: none;
}

.mobile-menu-list .sub-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px 12px 36px;
  color: var(--dark);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.mobile-menu-list .sub-menu a::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1px;
  background: currentColor;
  margin-right: 12px;
  opacity: 0.4;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-list .sub-menu a:hover {
  opacity: 1;
  color: var(--primary);
  padding-left: 40px;
}

.mobile-menu-list .sub-menu a:hover::before {
  width: 10px;
  opacity: 0.8;
}

/* Sous-page active */
.mobile-menu-list .sub-menu .current-menu-item > a,
.mobile-menu-list .sub-menu .current_page_item > a {
  color: var(--primary);
  opacity: 1;
}


/* ---------------------------------------------------------
   9) Lock scroll
   --------------------------------------------------------- */
body.menu-open {
  overflow: hidden;
}

html.menu-open,
html.menu-open body {
  overflow: hidden;
  position: relative;
}


/* ---------------------------------------------------------
   10) Responsive ≤ 980px — Mode mobile
   --------------------------------------------------------- */
/* Desktop */
.header-inner {
  max-width: 2000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between; /* au lieu de space-around */
  gap: 24px;
  padding: 12px 20px;
  min-height: 72px;
}

/* Mode mobile ≤ 980px */
@media (max-width: 980px) {
  .primary-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .header-inner {
    padding: 10px 14px;      /* moins de marge horizontale */
    min-height: 64px;
    gap: 12px;
  }
}

/* Très mobile ≤ 768px */
@media (max-width: 768px) {
  .header-inner {
    padding: 8px 12px;       /* logo + burger plus proches des bords */
    min-height: 56px;
  }

  .nav-toggle__bar {
    width: 22px;
  }
}


/* ---------------------------------------------------------
   11) Admin bar offset
   --------------------------------------------------------- */
.admin-bar .site-header {
  top: 32px;
}

.admin-bar .mobile-nav {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }

  .admin-bar .mobile-nav {
    top: 46px;
  }
}
