/* ==========================================================================
   Hero Slider plein écran – MARIE SN
   Chaque slide : fondu enchaîné + zoom-out de l'image (scale 1.25 -> 1)
   ========================================================================== */

.hero-slider {
  --slide-duration: 7s;   /* durée d'affichage d'une slide (pilote l'autoplay) */
  --fade-duration: 1.2s;  /* durée du fondu entre deux slides */
  --zoom-duration: 8s;    /* durée du zoom-out */

  position: relative;
  width: 100%;
  height: clamp(560px, 88vh, 800px);
  overflow: hidden;
  background: #0c2b4a;
  color: #fff;
  isolation: isolate;
}

.hero-slider-track {
  position: absolute;
  inset: 0;
}

/* ---------- Slides ---------- */
.hero-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fade-duration) ease, visibility 0s linear var(--fade-duration);
}

.hero-slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--fade-duration) ease, visibility 0s;
}

/* ---------- Image + effet zoom-out ---------- */
.hero-slide-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-slide-bg img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.25);
  /* Réinitialisation du zoom uniquement une fois la slide invisible */
  transition: transform 0s linear var(--fade-duration);
  will-change: transform;
}

.hero-slide.is-active .hero-slide-bg img {
  transform: scale(1);
  transition: transform var(--zoom-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- Voile lumineux pour la lisibilité ---------- */
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 99, 169, 0.88) 0%, rgba(5, 99, 169, 0.65) 45%, rgba(12, 43, 74, 0.25) 100%),
    linear-gradient(0deg, rgba(5, 99, 169, 0.45) 0%, transparent 35%);
}

/* ---------- Contenu texte ---------- */
.hero-slide-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 60px;
}

.hero-slide-content > * {
  max-width: 660px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-slide.is-active .hero-slide-content > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-slide.is-active .hero-slide-content > *:nth-child(1) { transition-delay: 0.35s; }
.hero-slide.is-active .hero-slide-content > *:nth-child(2) { transition-delay: 0.5s; }
.hero-slide.is-active .hero-slide-content > *:nth-child(3) { transition-delay: 0.65s; }
.hero-slide.is-active .hero-slide-content > *:nth-child(4) { transition-delay: 0.8s; }

.hero-slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  margin-bottom: 22px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.40);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-slide-title {
  color: #fff;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  line-height: 1.12;
  margin-bottom: 20px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero-slide-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.15rem;
  margin-bottom: 34px;
}

.hero-slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---------- Flèches ---------- */
.hero-slider-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition, all 0.3s ease);
}

.hero-slider-arrow:hover,
.hero-slider-arrow:focus-visible {
  background: var(--primary, #0563a9);
  border-color: var(--primary, #0563a9);
  transform: translateY(-50%) scale(1.08);
  outline: none;
}

.hero-slider-prev { left: 24px; }
.hero-slider-next { right: 24px; }

/* ---------- Compteur + points ---------- */
.hero-slider-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 42px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
}

.hero-slider-counter {
  font-weight: 700;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.hero-slider-current {
  color: #38bdf8;
  font-size: 1.5rem;
  font-weight: 800;
}

.hero-slider-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-slider-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.4s ease, background 0.4s ease;
}

.hero-slider-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.hero-slider-dot.is-active {
  width: 36px;
  background: #38bdf8;
}

.hero-slider-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- Barre de progression (pilote l'autoplay via animationend) ---------- */
.hero-slider-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-slider-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary, #0563a9), #38bdf8);
  animation: heroSliderProgress var(--slide-duration) linear forwards;
}

.hero-slider.is-paused .hero-slider-progress span {
  animation-play-state: paused;
}

@keyframes heroSliderProgress {
  from { width: 0; }
  to   { width: 100%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .hero-slider {
    height: clamp(520px, 82vh, 680px);
  }

  .hero-slide-overlay {
    background:
      linear-gradient(0deg, rgba(5, 99, 169, 0.92) 0%, rgba(5, 99, 169, 0.65) 55%, rgba(12, 43, 74, 0.35) 100%);
  }

  .hero-slider-arrow {
    display: none;
  }
}

@media (max-width: 576px) {
  .hero-slide-content {
    justify-content: flex-end;
    padding-bottom: 100px;
  }

  .hero-slide-tag {
    font-size: 0.72rem;
    padding: 6px 14px;
  }

  .hero-slide-text {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .hero-slide-actions {
    width: 100%;
    flex-direction: column;
  }

  .hero-slide-actions .btn {
    width: 100%;
  }

  .hero-slider-footer {
    bottom: 28px;
  }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-slide-bg img,
  .hero-slide.is-active .hero-slide-bg img {
    transform: none;
    transition: none;
  }

  .hero-slide-content > *,
  .hero-slide.is-active .hero-slide-content > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
