/* ═══════════════════════════════════════════════════════
   HERO.CSS — chargé uniquement sur les pages d'accueil régionales
   (romandie/accueil.html, ticino/accueil.html, italienne/accueil.html)

   La vidéo reste fixée en fond d'écran pendant tout le scroll : le contenu
   qui suit (.page-content, opaque) glisse par-dessus et la recouvre
   entièrement. Le overflow:hidden de .page-content empêche toute marge
   d'enfant de "s'échapper" et de laisser un trou qui laisserait entrevoir
   la vidéo (bug historique, corrigé).
   ═══════════════════════════════════════════════════════ */

.intro-section {
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  z-index: -1;
}

.hero-spacer {
  height: 100vh;
  width: 100%;
  pointer-events: none; /* laisse passer les clics vers les contrôles vidéo en dessous */
}

.page-content {
  position: relative;
  z-index: 1;
  background: #fffcf3;
  overflow: hidden; /* évite qu'une marge d'un enfant "s'échappe" de ce bloc */
}

/* Conteneur et ajustement de la vidéo */
.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Recadre proprement la vidéo sans la déformer */
}

/* Boutons lecture/pause et son : indépendants du contexte d'empilement de la
   vidéo (position:fixed + z-index élevé), sinon ils restent piégés derrière
   le contenu et deviennent difficiles à cliquer (bug corrigé). */
.hero-controls {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1400;
  display: flex;
  gap: 12px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Masqués une fois la vidéo scrollée sous le contenu (n'ont alors plus lieu d'être) */
.hero-controls.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.hero-control-btn:hover,
.hero-control-btn:focus-visible {
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-2px);
}

.hero-control-btn svg {
  width: 20px;
  height: 20px;
}

.hero-control-btn .icon-play,
.hero-control-btn .icon-unmuted {
  display: none;
}

.hero-control-btn.is-paused .icon-pause {
  display: none;
}

.hero-control-btn.is-paused .icon-play {
  display: block;
}

.hero-control-btn.is-unmuted .icon-muted {
  display: none;
}

.hero-control-btn.is-unmuted .icon-unmuted {
  display: block;
}

@media (max-width: 700px) {
  .hero-controls {
    right: 16px;
    bottom: 16px;
    gap: 8px;
  }

  .hero-control-btn {
    width: 38px;
    height: 38px;
  }
}
