/* =========================
   Header
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.site-header .btn-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Réserve la largeur du texte le plus long */
.site-header .btn-cta:not(.member-cta)::before {
  content: "S'inscrire";
  visibility: hidden;
  white-space: nowrap;
  font-weight: 700;
}

.btn-fade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeText 6s infinite;
}

.btn-fade:first-child {
  animation-delay: 0s;
}

.btn-fade:last-child {
  animation-delay: 3s;
}

@keyframes fadeText {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo img {
  height: 60px;      
  width: auto;        
  object-fit: contain; 
}

.site-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

/* Navigation */

.main-nav {
  display: flex;
  gap: 24px;
  position: relative;
}

.main-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-weight: 400;
  color: rgb(209 213 219 / var(--tw-text-opacity, 1));
  text-decoration: none;
  transition: color 0.2s ease;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.4);
}

.main-nav a:hover {
  color: white;
}

.nav-link {
  position: relative;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.3s ease;
}

/* =========================
   Lien actif
========================= */
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: white;
  font-weight: 700;
}

.main-nav .current-menu-ancestor > a,
.main-nav .current_page_ancestor > a {
  color: #fbbf24;
}

/* =========================
   Sous-menu
========================= */
/* Assure que chaque li du menu principal est positionné relativement */
.main-nav li {
    position: relative;
}

/* Sous-menu */
.main-nav ul ul {
    position: absolute;
    top: 125%;   /* juste en dessous du parent */
    left: 0;     /* aligné avec le parent <li> */
    background: rgba(31, 41, 55, 0.95);
    padding: 8px 0;
    min-width: 180px;
    display: none;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 999;
}

.main-nav ul ul li {
  width: 100%;
}

.main-nav ul ul li a {
  padding: 8px 16px;
  display: block;
  color: rgb(209 213 219 / var(--tw-text-opacity, 1));
  font-weight: 400;
}

.main-nav ul ul li a:hover {
  color: white;
}

.main-nav li:hover > ul {
  display: flex;
  flex-direction: column;
}

.main-nav ul ul a::after {
  display: none; /* supprime l'underline animée pour sous-menu */
}

/* Actions */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =========================
   Responsive
========================= */

.menu-btn {
  display: none;
}

@media (max-width: 768px) {
  .main-nav,
  .search-btn,
  .cta-btn {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  /* Mobile sous-menu */
  .main-nav ul ul {
    position: static;
    box-shadow: none;
    background: none;
    display: none;
    padding: 0;
  }

  .main-nav li:hover > ul {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav ul li a {
    padding: 12px 16px;
  }
}

@media (max-width: 1024px) {

  .header-container {
    height: 80px;
  }

  .header-logo img {
    height: 48px;
  }

  .site-title {
    font-size: 20px;
  }

  .main-nav ul {
    gap: 18px;
  }

  .main-nav a {
    font-size: 15px;
  }

  .header-actions {
    gap: 8px;
  }

}

@media (max-width: 768px) {

  .header-container {
    height: 70px;
    padding: 0 12px;
  }

  .header-logo img {
    height: 40px;
  }

  .site-title {
    font-size: 18px;
  }

  .site-header .btn-cta {
    font-size: 13px;
    padding: 6px 10px;
  }

}

@media (max-width: 480px) {

  .header-container {
    height: 60px;
  }

  .header-logo img {
    height: 40px;
  }

  .site-title {
    font-size: 16px;
  }

  .site-header .btn-cta {
    font-size: 12px;
    padding: 5px 8px;
  }

}

/* =========================
   MOBILE MENU OVERLAY
========================= */

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 55, 0.98);
  backdrop-filter: blur(8px);
  z-index: 9999;

  transform: translateX(100%);
  transition: transform 0.35s ease;

  display: flex;
  flex-direction: column;
}

.mobile-menu-overlay.active {
  transform: translateX(0);
}

body.no-scroll {
  overflow: hidden;
}


/* =========================
   CONTENU INTERNE
========================= */

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 100px 24px 40px 24px;
}


/* =========================
   LISTE MENU
========================= */

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-list > li {
  margin-bottom: 24px;
}

.mobile-menu-list > li > a {
  font-size: 22px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  display: block;
  transition: opacity 0.2s ease;
}

.mobile-menu-list > li > a:hover {
  opacity: 0.8;
}


/* =========================
   SOUS-MENUS
========================= */

.mobile-menu-list ul {
  margin-top: 12px;
  padding-left: 18px;
  border-left: 2px solid rgba(255,255,255,0.1);
}

.mobile-menu-list ul li {
  margin-bottom: 12px;
}

.mobile-menu-list ul li a {
  font-size: 16px;
  font-weight: 400;
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-menu-list ul li a:hover {
  color: white;
}


/* =========================
   CTA EN BAS
========================= */

.mobile-menu-bottom {
  margin-top: auto;
  padding-top: 40px;
}

.mobile-cta,
.mobile-menu-bottom .btn-cta {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #0e1e37;
  font-weight: 700;
  text-decoration: none;
}


/* =========================
   RESPONSIVE HEADER
========================= */

@media (max-width: 768px) {

  .main-nav {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

}

@media (max-width: 768px) {

  .main-nav {
    display: none !important;
  }

  .header-actions .btn-cta {
    display: none !important;
  }

  .menu-btn {
    display: inline-flex !important;
  }

}

/* =========================
   MENU BUTTON FIX
========================= */

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
  color: white; /* important */
}

.menu-btn svg line {
  stroke: currentColor;
}

/* Affichage mobile */
@media (max-width: 768px) {

  .main-nav {
    display: none !important;
  }

  .header-actions .btn-cta {
    display: none !important;
  }

  .menu-btn {
    display: flex !important;
  }

}

/* =========================
   MOBILE CLOSE BUTTON
========================= */

.mobile-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;

  width: 44px;
  height: 44px;

  background: transparent;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-close-btn svg {
  width: 28px;
  height: 28px;
  color: white;
}

.mobile-close-btn svg line {
  stroke: currentColor;
}