/* ============================================================
   Carrousel de mini-vidéos du salon.

   Défilement horizontal natif (scroll-snap) : pas de librairie, le
   geste de balayage est celui du système. Le bloc réserve sa hauteur
   par `aspect-ratio` pour ne provoquer aucun décalage au chargement.
   ============================================================ */

.hero-media {
  margin-top: 20px;
  max-width: 100%;
}

.carousel {
  position: relative;
  max-width: 100%;
  /* Clipping strict : sans lui, la piste élargit la page au premier
     rendu (et le fond animé se fige alors sur cette largeur). */
  overflow: hidden;
}

.carousel__track {
  display: flex;
  gap: 10px;
  /* `min-width: 0` autorise la piste à devenir plus étroite que son
     contenu — sans quoi elle pousse la mise en page. */
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 4px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.vslide {
  flex: 0 0 78%; /* la vidéo suivante dépasse : affordance de balayage */
  scroll-snap-align: center;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  /* Hauteur réservée avant même le chargement (CLS = 0). */
  aspect-ratio: 9 / 16;
  max-height: 300px;
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease);
  opacity: 0.7;
}

.vslide.is-active {
  opacity: 1;
}

.vslide__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

/* ---------- Points de navigation ---------- */

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.carousel__dot {
  /* Cible tactile de 44 px, pastille visuelle de 8 px au centre. */
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition:
    background 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.carousel__dot[aria-selected="true"]::before {
  background: var(--accent);
  transform: scale(1.35);
}

/* ---------- Bouton Pause (obligatoire : boucle infinie) ---------- */

.carousel__pause {
  position: absolute;
  right: 10px;
  bottom: 62px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--frost);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

/* Icônes dessinées en CSS : pas d'emoji, pas de fichier à charger. */
.carousel__pause-icone {
  width: 10px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.carousel__pause.is-paused .carousel__pause-icone {
  width: 0;
  height: 0;
  border-left: 10px solid currentColor;
  border-right: none;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* ---------- Trois points clés ---------- */

.hero-points {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  list-style: none;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-point svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--success);
}

/* ---------- Indice de défilement ---------- */

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.8rem;
}

.scroll-hint__fleche {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: hint-descend 1.8s var(--ease) infinite;
}

@keyframes hint-descend {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.5;
  }
  50% {
    transform: rotate(45deg) translate(3px, 3px);
    opacity: 1;
  }
}

/* ---------- Desktop : les trois vidéos côte à côte ---------- */

@media (min-width: 768px) {
  .carousel__track {
    overflow-x: visible;
    gap: 12px;
  }

  .vslide {
    flex: 1 1 0; /* les trois côte à côte, à parts égales */
    opacity: 1;
    max-height: 340px;
  }

  .vslide:hover {
    transform: translateY(-2px);
  }

  .carousel__dots {
    display: none; /* tout est visible : les points n'ont plus d'objet */
  }

  .carousel__pause {
    bottom: 10px;
  }
}

/* ---------- Accessibilité : mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  .scroll-hint__fleche {
    animation: none;
  }

  .vslide {
    opacity: 1;
  }
}

/* ---------- Impression ---------- */

@media print {
  .hero-media,
  .scroll-hint {
    display: none !important;
  }
}
