/* =====================================================
   HEADER CSS — Source unique des styles du header
   Toutes les règles du header (bandeau, navigation, logo,
   titres, responsive) sont centralisées ici.
   Ne pas dupliquer dans style.css ou main.css.
   ===================================================== */

/* Container principal du header */
.header-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

 .sticky-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2001;
 }

/* Bandeau supérieur */
.top-banner {
  background-color: var(--brand-beige, #EBE3D5);
  width: 100%;
  padding: 10px 0;
  transition: transform 0.3s ease, max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: relative;
}

.header-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 2fr) 1fr;
  align-items: center;
  column-gap: 24px;
  position: relative;
}

.header-lang-switch {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.header-lang-link {
  display: inline-flex;
  width: 34px;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.7);
  position: relative;
  will-change: transform;
  transform-origin: 50% 50%;
  animation: flag-float 3.4s ease-in-out infinite;
}

.header-lang-link svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 0% 50%;
  backface-visibility: hidden;
  animation: flag-wave 2.8s ease-in-out infinite;
}

 .header-lang-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.38) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-140%);
  animation: flag-shine 3.6s ease-in-out infinite;
  pointer-events: none;
 }

 @keyframes flag-wave {
  0% { transform: perspective(160px) rotateY(0deg) skewY(0deg) translateX(0); }
  25% { transform: perspective(160px) rotateY(-14deg) skewY(-1.6deg) translateX(-1px); }
  50% { transform: perspective(160px) rotateY(0deg) skewY(1.1deg) translateX(0); }
  75% { transform: perspective(160px) rotateY(14deg) skewY(-1.1deg) translateX(1px); }
  100% { transform: perspective(160px) rotateY(0deg) skewY(0deg) translateX(0); }
 }

 @keyframes flag-float {
  0% { transform: translateY(0) rotateZ(0deg); }
  35% { transform: translateY(-1px) rotateZ(-0.6deg); }
  70% { transform: translateY(1px) rotateZ(0.6deg); }
  100% { transform: translateY(0) rotateZ(0deg); }
 }

 @keyframes flag-shine {
  0% { transform: translateX(-140%); opacity: 0.0; }
  20% { opacity: 0.45; }
  50% { transform: translateX(140%); opacity: 0.0; }
  100% { transform: translateX(140%); opacity: 0.0; }
 }

 @media (prefers-reduced-motion: reduce) {
  .header-lang-link svg {
    animation: none;
  }
  .header-lang-link {
    animation: none;
  }
  .header-lang-link::before {
    animation: none;
  }
 }

 .lang-dropdown {
  position: relative;
 }

 .lang-dropdown summary {
  list-style: none;
  cursor: pointer;
 }

 .lang-dropdown summary::-webkit-details-marker {
  display: none;
 }

 .lang-dropdown .lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  z-index: 3000;
 }

 .lang-dropdown:not([open]) .lang-menu {
  display: none;
 }

 .lang-dropdown[open] .lang-current {
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
 }

 .lang-current {
  position: relative;
  overflow: visible;
 }

 .lang-current::after {
  content: "▾";
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  color: rgba(0,0,0,0.85);
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 8px;
  padding: 2px 5px;
 }

.header-hero-logo {
  height: clamp(110px, 12vw, 170px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.header-hero-logo--left {
  justify-self: start;
}

.header-hero-logo--right {
  justify-self: end;
}

.header-hero-center {
  text-align: center;
}

.top-banner.hidden {
  transform: translateY(-100%);
  max-height: 0;
  opacity: 0;
  visibility: hidden;
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.banner-left {
  display: flex;
  align-items: center;
  justify-content: center; /* centre le bloc (logos + titre) */
  gap: 15px;
  flex: 1; /* permet de prendre l'espace pour centrer */
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Logo dans le bandeau */
.logo-img {
  height: 50px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Logo à droite du titre: petit espacement additionnel si nécessaire */
.logo-img-right {
  margin-left: 8px;
}

.logo-title {
  display: flex;
  flex-direction: column;
  align-items: center; /* centre le texte O'France */
  text-align: center;
}

.logo-main {
  font-family: 'Anton', 'Bebas Neue', sans-serif;
  font-size: 3.2rem;
  font-weight: bold;
  color: var(--forest-green);
  letter-spacing: 1px;
  line-height: 1.1;
}

/* Sélecteur de langue */
.lang-select {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  font-size: 0.9rem;
}

.social-icon {
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.social-icon:hover {
  transform: scale(1.1);
}

/* Séparateur avec balises */
.banner-separator {
  width: 100%;
  height: 40px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(90deg, var(--brand-beige, #EBE3D5) 0%, #f3eadb 50%, var(--brand-beige, #EBE3D5) 100%);
}

.balises-frise {
  display: flex;
  animation: scroll-balises 20s linear infinite;
  height: 100%;
  align-items: center;
}

.balise-repeat {
  height: 30px;
  width: auto;
  margin: 0 20px;
  opacity: 0.7;
}

@keyframes scroll-balises {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Informations de l'événement */
.event-infos {
  text-align: center;
  padding: 15px 0;
  background: linear-gradient(135deg, var(--brand-beige, #EBE3D5) 0%, #f3eadb 100%);
}

.event-type {
  font-weight: bold;
  color: var(--forest-green);
  font-size: clamp(0.75rem, 2.2vw, 1.1rem);
  margin-bottom: 5px;
  white-space: nowrap;
  line-height: 1.1;
}

.event-dates {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent-orange);
  margin-bottom: 5px;
}

.event-slogan {
  font-style: italic;
  color: #D4006C;
  font-size: 1rem;
}

/* ===== NAVIGATION STICKY ===== */
.sticky-nav {
  position: relative;
  z-index: 2000; /* au-dessus des calques Leaflet (tiles/markers/popups/controls) */
  width: 100%;
  background-color: var(--forest-green);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

/* Logo dans la navigation */
.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 40px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 2px 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Menu de navigation */
.menu.nav {
  display: flex;
  gap: 0.5rem;
  background: transparent;
  align-items: center;
  flex: 1;
  justify-content: center;
  max-width: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  color: var(--pure-white);
  text-decoration: none;
  padding: 0.8rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Raleway', Arial, sans-serif;
  transition: all 0.3s ease;
  border: none;
  display: inline-block;
  border-radius: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  white-space: nowrap;
  margin: 0;
}

.nav-item:hover {
  background: var(--brand-pink);
  transform: translateY(-2px);
  color: var(--pure-white);
  box-shadow: 0 4px 12px rgba(212, 0, 108, 0.25);
  border-radius: 8px;
}

.nav-item.active {
  color: var(--pure-white);
  background: var(--brand-pink);
  box-shadow: 0 4px 12px rgba(212, 0, 108, 0.25);
  border-radius: 8px;
  transform: translateY(-1px);
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown > .nav-item::after {
  content: "▾";
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.9em;
  opacity: 0.9;
  transform: translateY(-1px);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 0.55rem;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  z-index: 3000;

  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-family: 'Raleway', Arial, sans-serif;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: rgba(212, 0, 108, 0.12);
  color: var(--brand-pink);
}

.menu.nav a[href$="boutique.html"] {
  display: none !important;
}

/* Menu hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  padding: 10px;
  z-index: 200;
}

.hamburger span {
  height: 3px;
  width: 25px;
  background: var(--pure-white);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animation du hamburger quand actif */
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .banner-content {
    padding: 0 15px;
  }
  .banner-left {
    flex: 1;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  /* Hide menu by default on mobile; it opens when .active is toggled */
  .menu.nav {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  
  .menu.nav.active {
    display: flex;
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-item {
    width: 100%;
    text-align: center;
    margin: 0;
    border-radius: 0;
  }

  .nav-dropdown {
    width: 100%;
    display: block;
  }

  .nav-dropdown-menu {
    display: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    position: static;
    box-shadow: none;
    background: transparent;
    border: none;
    backdrop-filter: none;
    padding: 0;
    margin: 0;
    min-width: 0;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-item {
    width: 100%;
    text-align: center;
    color: var(--pure-white);
    padding: 0.6rem 1rem;
  }

  .nav-dropdown-item:hover {
    background: var(--brand-pink);
    color: var(--pure-white);
  }
}

@media (max-width: 600px) {
  .banner-left {
    gap: 10px;
  }
  
  .logo-img {
    height: 40px;
  }

  .header-lang-switch {
    top: 6px;
    right: 8px;
    gap: 8px;
  }

  .header-lang-link {
    width: 30px;
    height: 20px;
  }

  .logo-main {
    font-size: 1.8rem;
  }
  
  .event-dates {
    font-size: 1.1rem;
  }
  
  .sticky-nav {
    padding: 0.8rem 1rem;
  }

  .header-hero {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 10px;
  }

  .header-hero-logo {
    display: block;
    height: clamp(56px, 18vw, 90px);
  }
}
