/* =============================================================
   HEADER EIA — header.css
   ============================================================= */
/* 
#wpadminbar {
  display: none !important;
} */
/* ---- Variables ---- */
:root {
  --header-height: 118px;
  --navy: #133273;
  --navy-hover: #162348;
  --white: #ffffff;
  --gray-border: #00000059;
  --black: #000;
  --font-main: "Source Sans 3", "Source Sans Pro", sans-serif;
  --mega-shadow: 0 8px 32px rgba(27, 43, 94, 0.1);
  --transition: 300ms ease;
}

/* ---- Reset partiel ---- */
.site-header *,
.mobile-menu * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
}

.ast-menu-toggle,
.ast-header-navigation-arrow {
  display: none !important;
}

.nav-link.nav-link--toggle,
.search-toggle,
.lang-btn {
  background-color: unset !important;
  border: none;
  color: var(--black);
  color: #000;
  font-family: Jost;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: none;
  padding: 0;
}

.nav-chevron {
  width: 15px;
  height: 15px;
  stroke-width: 3;
}

.nav-link.nav-link--toggle:hover,
.lang-btn:hover,
.search-toggle:hover {
  background-color: unset !important;
  color: var(--navy-hover);
}

/* ============================================================
   HEADER WRAPPER
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  /* Ombre légère par défaut quand le mega-menu est fermé */
  border-bottom: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-family: var(--font-main);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: box-shadow var(--transition);
}

/* Quand un mega-menu est ouvert : trait net à la place de l'ombre */
.site-header.menu-is-open {
  box-shadow: none;
  border-bottom: 1px solid var(--gray-border);
}

/* Compense la hauteur du header fixe.
   overflow: hidden évite que le margin-top de la hero
   ne s'additionne au padding-top (margin collapsing). */
body {
  padding-top: var(--header-real-height, var(--header-height));
  overflow-x: hidden;
}

.mega-menu,
.nav-overlay {
  top: var(--header-real-height, var(--header-height));
}

.search-modal {
  padding-top: var(--header-real-height, var(--header-height));
}

/* Si ta hero est le premier enfant du body ou de .site-content,
   assure-toi qu'elle n'a pas de margin-top supplémentaire */
.site-header + * {
  margin-top: 0 !important;
}

.header-inner {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  width: 100%;
  margin: 0 3.2rem;
}

/* ============================================================
   LOGO
   ============================================================ */

.site-branding {
  flex-shrink: 0;
}

.site-branding img,
.site-branding .custom-logo {
  height: 48px;
  width: auto;
  display: block;
}

.site-branding .site-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}

/* ============================================================
   NAVIGATION PRINCIPALE
   ============================================================ */

.main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Liste racine */
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.8rem;
  height: var(--header-height);
}

.nav-item {
  position: static; /* Le mega-menu se positionne par rapport au header */
  height: 100%;
  display: flex;
  align-items: center;
}

/* Lien / bouton de niveau 0 */
.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 100%;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition);
  font-family: var(--font-main);
}

.nav-link:hover,
.nav-item.is-active > .nav-link {
  color: var(--navy);
}

.nav-item {
  position: relative;
}

/* Chevron */
.nav-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.nav-link--toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

/* ============================================================
   MEGA-MENU
   ============================================================ */

.mega-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
  box-shadow: var(--mega-shadow);
  z-index: 999;
}

.mega-menu.is-open {
  display: flex;
  height: 370px;
}

.mega-inner {
  display: flex;
  max-width: 1280px;
  /* margin: 0 auto; */
  padding: 2rem 1rem;
  /*gap: 10rem;*/
  min-height: 200px;
  width: fit-content;
  align-items: center;
  margin-left: 18rem;
}

/* Colonne gauche : items niveau 1 */
.mega-col--primary {
  display: flex;
  align-items: center;
  width: 280px;
  flex-shrink: 0;
  padding-right: 32px;
  justify-content: center;
  gap: 1rem;
}

.mega-col--primary .nav-list,
.mega-col--primary ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: auto;
}

/* Items niveau 1 */
.mega-item {
  list-style: none;
}

.mega-link {
  display: block;
  background-color: unset !important;
  padding: 8px 25px !important;
  font-size: 1.25rem !important;
  font-weight: 500 !important;
  color: var(--black);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition:
    background var(--transition),
    color var(--transition);
  font-family: var(--font-main);
  width: max-content;
}

/* --- Neutralise tout ce qu'Astra peut injecter sur les items actifs --- */
.mega-col--primary .current-menu-item > a,
.mega-col--primary .current-menu-item > button,
.mega-col--primary .current-menu-ancestor > a,
.mega-col--primary .current-menu-ancestor > button,
.mega-link--toggle.is-active,
.mega-link.is-active {
  background: none !important;
  box-shadow: none !important;
}

/* Point bleu — uniquement au hover ET quand le mega-menu est ouvert,
   jamais en permanence à cause des classes WordPress current-menu-* */
.mega-link {
  position: relative;
  padding-left: 20px;
}

.mega-link::before {
  content: "";
  position: absolute;
  left: 0px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  opacity: 0;
  transition: opacity var(--transition);
}

/* Le point apparaît uniquement au hover direct sur le bouton */
.mega-link:hover::before {
  opacity: 1;
}

.mega-link:hover {
  color: var(--black);
}

/* Quand l'item est actif VIA JS (is-active ajouté par notre code),
   pas via les classes WordPress automatiques */
.mega-link--toggle[data-js-active="true"]::before {
  opacity: 1;
}

/* Neutralise toute coloration Astra sur current-menu-* dans le mega-menu */
.mega-col--primary .current-menu-item > *,
.mega-col--primary .current-menu-ancestor > *,
.mega-col--primary .current-menu-parent > * {
  color: var(--black) !important;
  background: none !important;
  font-weight: 500 !important;
}

.mega-col--secondary {
  display: flex;
  justify-content: center;
  align-items: center;
  height: fit-content;
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: calc(10rem + 40px);
  position: relative;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

/* Le trait est un pseudo-élément positionné à 10rem du bord gauche */
.mega-col--secondary::before {
  content: "";
  position: absolute;
  left: 10rem;
  top: 1rem;
  bottom: 1rem;
  width: 1.5px;
  background: var(--navy);
  opacity: 0; /* caché par défaut comme le contenu */
  transition: opacity 200ms ease;
}

/* pointer-events actif dès l'ouverture du menu */
.mega-menu.is-open .mega-col--secondary {
  pointer-events: auto;
}

/* opacity visible seulement quand un item L1 est survolé */
.mega-menu.has-active-sub .mega-col--secondary {
  opacity: 1;
}

/* Le trait apparaît en même temps que le contenu */
.mega-menu.has-active-sub .mega-col--secondary::before {
  opacity: 1;
}

.mega-sub-list {
  list-style: none;
  display: table;
  margin: 0 auto;
  gap: 0;
}

/* Items niveau 2 — masqués par défaut, affichés selon l'item actif */
.mega-sub-item {
  display: none;
}

.mega-sub-item.is-visible {
  display: list-item;
}

.mega-sub-link {
  display: block;
  padding: 7px 0;
  font-size: 0.95rem;
  color: var(--black);
  text-decoration: none;
  transition: color var(--transition);
  border-bottom: 1px solid transparent;
}

.mega-sub-link:hover {
  color: var(--navy);
}

/* Overlay fond sombre derrière le mega-menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.25);
  z-index: 998;
}

.nav-overlay.is-visible {
  display: block;
}

/* ============================================================
   ACTIONS DROITE (recherche, langue, ENT, burger)
   ============================================================ */

.header-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-shrink: 0;
  margin-left: auto;
}

.header-actions button {
  padding: 0 !important;
}

/* Bouton recherche */
.search-toggle {
  position: relative;
  padding-left: 24px;
  margin-left: 8px;
  color: var(--black) !important;
}

.search-toggle svg {
  stroke: var(--navy) !important;
  stroke-width: 3px;
  width: 25px;
  height: 25px !important;
}

/* Sélecteur de langue */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  padding: 6px 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-main);
}

.lang-btn div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
}

.lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-code {
  font-size: 1rem;
}

.lang-switcher svg {
  width: 20px;
  height: 20px;
  stroke-width: 3.5px;
}

/* Polylang — styles si plugin actif */
.lang-switcher .lang-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-switcher .lang-item a {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 6px 10px;
}

/* Bouton ENT */
.btn-ent {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.05em;
  transition: background var(--transition);
  font-family: var(--font-main);
  white-space: nowrap;
}

.btn-ent:hover {
  background: var(--navy-hover);
  color: var(--white);
}

/* Burger — masqué sur desktop */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 25px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  background-color: unset !important;
}

.burger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition:
    transform var(--transition),
    opacity var(--transition);
  transform-origin: center;
}

.burger-btn.is-open .burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.burger-btn.is-open .burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   MENU MOBILE
   ============================================================ */

.mobile-menu {
  display: none; /* Affiché via JS */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 90vw);
  background: var(--white);
  z-index: 1100;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 300ms ease;
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.12);
}

.mobile-menu button {
  background-color: unset !important;
  color: var(--navy) !important;
}

.mobile-menu .menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #0000001a;
}

.mobile-menu.is-open {
  display: block;
  transform: translateX(0);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1099;
}

.mobile-overlay.is-visible {
  display: block;
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  border-bottom: 1px solid var(--gray-border);
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  padding: 0 !important;
}

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

/* Liste mobile */
.mobile-nav-list,
.mobile-nav-list ul {
  list-style: none;
}

.mobile-nav-list {
  padding: 8px 0 24px;
}

.mobile-nav-list .menu-item > a,
.mobile-nav-list .menu-item > span {
  display: block;
  padding: 24px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}

.mobile-nav-list .sub-menu .menu-item > a {
  /* padding: 10px 24px 10px 40px; */
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--black);
}

.mobile-nav-list .sub-menu .sub-menu .menu-item > a {
  padding-left: 56px;
  font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .burger-btn {
    display: flex;
  }

  .search-toggle,
  .lang-switcher,
  .btn-ent {
    /* On garde ces éléments visibles sur tablette */
    display: block;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .lang-switcher {
    display: none; /* Masqué sur mobile, accessible dans le menu */
  }
}

/* ============================================================
   MODALE DE RECHERCHE
   Centrée, fond semi-transparent, formulaire en pleine largeur.
   La recherche WP fonctionne via GET ?s=terme → page search.php
   ============================================================ */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start; /* panneau en haut de page, sous la barre */
  justify-content: center;
  padding-top: var(--header-height);
}

.search-modal[hidden] {
  display: none;
}

/* Fond sombre cliquable pour fermer */
.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

/* Panneau blanc */
.search-modal-content {
  position: relative;
  display: flex;
  height: 260px;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 1rem;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  background: var(--white);
  border-radius: 0.5rem;
  padding: 28px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Formulaire */
.search-modal-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
  border-radius: 6px;
  padding: 0 16px;
  justify-content: center;
}

.search-modal-form div {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 1rem;
  width: 90%;
}

.search-modal-icon {
  flex-shrink: 0;
  color: var(--navy);
  opacity: 0.5;
}

.search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 1rem;
  font-family: var(--font-main);
  color: var(--navy);
  outline: none;
  height: auto;
  width: 100% !important;
}

.search-modal-input::placeholder {
  color: #aaa;
}

/* Supprime le bouton natif du navigateur dans les champs type=search */
.search-modal-input::-webkit-search-cancel-button {
  display: none;
}

.search-modal-submit {
  padding: 20px 30px 20px 30px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background var(--transition);
  white-space: nowrap;
}

.search-modal-submit:hover {
  background: var(--navy-hover);
}

.search-modal-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.search-modal-info p {
  font-size: 1.2rem;
}

/* Bouton fermer (croix) */
.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--black);
  border-radius: 50%;
  transition: background var(--transition);
  width: fit-content !important;
  height: fit-content !important;
  padding: 0;
  box-shadow: none;
  background-color: unset !important;
}

.search-modal-close svg {
  width: 25px;
  height: 25px;
  stroke-width: 2.5px;
}

.search-modal-close:hover {
  color: var(--black);
}

@media (max-width: 640px) {
  .search-modal-content {
    border-radius: 0;
    padding: 16px;
    flex-wrap: wrap;
  }

  .search-modal-submit {
    width: 100%;
    justify-content: center;
  }
}
