/* Styles pour la bannière vidéo de la page d'accueil */

.page-banner {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Fond de secours seulement si la vidéo ne se charge pas */
  background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
}

.page-banner__bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.page-banner video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1 !important;
  opacity: 0.9 !important;
  display: block !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-banner {
    min-height: 70vh;
  }
}

@media (max-width: 480px) {
  .page-banner {
    min-height: 60vh;
  }
}

/* Gestion des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  .page-banner video {
    opacity: 0.4 !important;
  }
}

/* Amélioration du texte sur la vidéo */
.page-banner__content h1,
.page-banner__content h2,
.page-banner__content h3 {
  margin-bottom: 1rem;
  animation: slideUp 1s ease-out 0.5s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation échelonnée pour les titres */
.page-banner__content h1 {
  animation-delay: 0.5s;
}

.page-banner__content h2 {
  animation-delay: 0.7s;
}

.page-banner__content h3 {
  animation-delay: 0.9s;
}

/* Responsive pour mobile - pause la vidéo sur petit écran pour économiser la bande passante */
@media (max-width: 768px) {
  .page-banner {
    min-height: 50vh;
  }

  .page-banner video {
    opacity: 0.5; /* Réduire l'opacité sur mobile */
  }

  /* Option pour masquer complètement la vidéo sur très petit écran */
  @media (max-width: 480px) {
    .page-banner video {
      display: none;
    }
  }
}

/* Amélioration de l'accessibilité - permettre aux utilisateurs de désactiver l'autoplay */
@media (prefers-reduced-motion: reduce) {
  .page-banner video {
    animation: none;
  }

  .page-banner__content h1,
  .page-banner__content h2,
  .page-banner__content h3 {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Style pour quand la vidéo ne se charge pas */
.page-banner video:not([src]) {
  display: none;
}

/* Masquer le fond de secours quand la vidéo est présente */
.page-banner:has(video) {
  background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
}

/* Fallback pour navigateurs qui ne supportent pas :has() */
.page-banner.video-loaded {
  background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
}
