/* ===== HEADER PRINCIPAL (TRANSPARENT + STICKY) ===== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  transition: background-color .22s ease,
              box-shadow .22s ease,
              border-bottom-color .22s ease,
              backdrop-filter .22s ease;
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(0px);
}

/* Conteneur du header : 5 colonnes (logo / menu / langues / réseaux / login) */
#header .container {
  max-width: 1320px;
  height: 72px;
  margin: auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  column-gap: 18px;
  align-items: center;
}

/* Chaque cellule (segment) */
.header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 52px;
}

/* Logo */
#header .logo img {
  height: 56px;
  transition: filter .18s ease, transform .18s ease;
}

/* --- ÉTAT TRANSPARENT (SUR HERO / SLIDE) --- */
#header.header-transparent {
  background: linear-gradient(to bottom,
                              rgba(15,23,42,0.86),
                              rgba(15,23,42,0.4),
                              transparent);
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: blur(4px);
}

/* Liens du menu en transparent */
#header.header-transparent .menu-desktop a {
  color: #e5e7eb;
}
#header.header-transparent .menu-desktop a:hover {
  color: #ffffff;
}
#header.header-transparent .burger div {
  background: #f9fafb;
}

/* Sous-menu : garder le style classique même en transparent */
#header.header-transparent .menu-desktop .submenu a {
  color: #2b3a50;
}
#header.header-transparent .menu-desktop .submenu a:hover {
  color: #194274;
}

/* --- ÉTAT SOLIDE (APRÈS SCROLL) --- */
/* le header reste transparent, ce sont les blocs qui deviennent blancs */
#header.header-solid {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: blur(0);
}

/* Chaque bloc devient un "pavé" blanc avec des espaces transparents entre eux */
#header.header-solid .header-cell {
  background: #ffffff;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.12);
  padding-inline: 12px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menu en mode solide */
#header.header-solid .menu-desktop a {
  color: #4b5563;
}
#header.header-solid .menu-desktop a:hover {
  color: #1f2937;
}
#header.header-solid .burger div {
  background: #374151;
}

/* ========== MENU DESKTOP ========== */
#header .menu-desktop {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}
#header .menu-desktop > div {
  position: relative;
  margin: 0 10px;
}
#header .menu-desktop a {
  font-size: 14px;
  text-decoration: none;
  padding: 8px 10px;
  transition: color 0.18s;
}

/* Sous-menus desktop */
#header .menu-desktop .has-submenu {
  position: relative;
}
#header .menu-desktop .has-submenu .submenu {
  display: none;
  position: absolute;
  top: 115%;
  left: 0;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid #e7eaf2;
  border-radius: 7px;
  box-shadow: 0 8px 26px rgba(15,23,42,0.12);
  z-index: 920;
  padding: 6px 0;
}
#header .menu-desktop .has-submenu:hover .submenu,
#header .menu-desktop .has-submenu:focus-within .submenu {
  display: block;
}
#header .menu-desktop .submenu a {
  display: block;
  padding: 8px 22px 8px 18px;
  color: #2b3a50;
  background: none;
  border: none;
  text-align: left;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background .13s, color .13s, padding .12s;
  margin: 0;
  letter-spacing: 0.02em;
}
#header .menu-desktop .submenu a:hover,
#header .menu-desktop .submenu a:focus {
  background: #f2f6fc;
  color: #194274;
  padding-left: 25px;
}

/* ===== Sidebar mobile (menu burger) ===== */
.msidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  padding: 20px 0;
  box-shadow: 2px 0 10px rgba(0,0,0,0.12);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 950;
  font-family: "Segoe UI", Arial, sans-serif;
}
.msidebar.active {
  transform: translateX(0);
}

.msidebar a {
  display: block;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #2b3a50;
  text-decoration: none;
  border-bottom: 1px solid #f1f3f6;
  transition: background 0.2s, color 0.2s;
}
.msidebar a:hover {
  background: #f2f6fc;
  color: #194274;
}

.msidebar .submenu {
  display: none;
  padding-left: 15px;
  background: #fafbfc;
}
.msidebar .has-submenu.active > .submenu {
  display: block;
}
.msidebar .submenu a {
  font-size: 14px;
  font-weight: 400;
  color: #4a627d;
  padding: 10px 20px;
  border-bottom: none;
}
.msidebar .submenu a:hover {
  background: #eef3f9;
  color: #163860;
}

.msidebar .has-submenu > a::after {
  content: "▸";
  float: right;
  font-size: 12px;
  transition: transform 0.2s;
}
.msidebar .has-submenu.active > a::after {
  transform: rotate(90deg);
}

.msidebar::-webkit-scrollbar { width: 6px; }
.msidebar::-webkit-scrollbar-thumb {
  background: #c1c7d0;
  border-radius: 4px;
}

/* Burger menu (mobile) */
#header .burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 905;
}
#header .burger div {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  transition: background .18s ease;
}

/* ========== HEADER RIGHT (LANGUES + RESEAUX + LOGIN) ========== */
.header-langs,
.header-social,
.header-login {
  justify-content: flex-end;
}

/* LANGUES */
.languages-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.languages-inline a {
  text-decoration: none;
  padding: 0;
  transition: color .2s ease, opacity .2s ease;
  opacity: .85;
}

/* transparent (sur slide) */
#header.header-transparent .languages-inline a {
  color: #f1f5f9; /* blanc crème */
}

/* solid (scroll) */
#header.header-solid .languages-inline a {
  color: #334155; /* gris institutionnel */
}

.languages-inline a:hover {
  opacity: 1;
}

.languages-inline a.active {
  font-weight: 700;
  opacity: 1;
}

/* RESEAUX SOCIAUX */
.social-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: 8px;
}

.social-inline a {
  font-size: 18px;
  display: inline-block;
  transition: opacity .2s ease, transform .2s ease;
  opacity: .85;
}

/* transparent → icônes blanches */
#header.header-transparent .social-inline a {
  color: #f8fafc;
}

/* solide → icônes gris foncé */
#header.header-solid .social-inline a {
  color: #475569;
}

.social-inline a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* LOGIN ICON */
.header-login .header-account i {
  font-size: 18px;
  color: #f8fafc;
  transition: color .2s ease, transform .2s ease, opacity .2s ease;
  opacity: .9;
}

/* état solide par défaut (non connecté) */
#header.header-solid .header-login .header-account i {
  color: #475569;
}

/* ÉTAT CONNECTÉ : lien avec .account-link.logged-in */
.header-login .account-link.logged-in i {
  color: #0ea5e9 !important; /* bleu accent quand connecté */
  opacity: 1;
}

.header-login .header-account i:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  #header .menu-desktop {
    display: none;
  }
  #header .burger {
    display: flex;
  }

  /* sur mobile, on enlève les pavés blancs pour éviter la surcharge */
  #header.header-solid .header-cell {
    background: transparent;
    box-shadow: none;
    padding-inline: 0;
    height: auto;
  }

  .languages-inline {
    display: none; /* langues masquées sur mobile, comme avant */
  }

  #header .container {
    grid-template-columns: auto 1fr auto; /* logo / espace / réseaux+burger */
  }

  .header-langs,
  .header-login {
    display: none; /* on cache langues et login sur mobile */
  }
}

@media (min-width: 993px) {
  .msidebar {
    display: none;
  }
}
