/**
 * @file vve_hero_slider — slider de l'accueil en fondu enchaîné.
 * Couleurs surchargeables par le thème via les variables --vve-hero-*.
 */

.vve-hero {
  --vve-hero-night: 28, 53, 80;
  --vve-hero-sun: #f2c94c;
  --vve-hero-sun-hover: #e9bb2d;
  --vve-hero-sun-text: #2b2200;
  --vve-hero-fade: 1s;
  position: relative;
  overflow: hidden;
  background: rgb(var(--vve-hero-night));
  color: #fff;
}

/* ── Diapositives ─────────────────────────────────────── */
.vve-hero__slides {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 85vh;
}
.vve-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--vve-hero-fade) ease-in-out, visibility 0s linear var(--vve-hero-fade);
}
.vve-hero__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition: opacity var(--vve-hero-fade) ease-in-out, visibility 0s;
}
.vve-hero__slide picture,
.vve-hero__slide img {
  display: block;
  width: 100%;
  height: 100%;
}
.vve-hero__slide img {
  object-fit: cover;
}

/* Voile de lisibilité : du bas sur mobile. */
.vve-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(var(--vve-hero-night), .9) 0%, rgba(var(--vve-hero-night), .45) 45%, rgba(var(--vve-hero-night), 0) 75%);
}

/* ── Texte ────────────────────────────────────────────── */
.vve-hero__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4.5rem;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 16px;
}
.vve-hero__title {
  color: #fff;
  font-size: clamp(1.75rem, 4.5vw, 3.2rem);
  line-height: 1.2;
  max-width: 14em;
  margin: 0 0 .6rem;
}
.vve-hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 34em;
  color: #e7eef6;
  margin: 0 0 1.5rem;
}
.vve-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.vve-hero__btn {
  display: inline-block;
  padding: .75rem 1.3rem;
  border-radius: .5rem;
  border: 2px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, transform .15s;
}
.vve-hero__btn:hover,
.vve-hero__btn:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
}
.vve-hero__btn--primary {
  background: var(--vve-hero-sun);
  color: var(--vve-hero-sun-text);
}
.vve-hero__btn--primary:hover,
.vve-hero__btn--primary:focus-visible {
  background: var(--vve-hero-sun-hover);
  color: var(--vve-hero-sun-text);
}
.vve-hero__btn--ghost {
  border-color: rgba(255, 255, 255, .75);
  color: #fff;
}
.vve-hero__btn--ghost:hover,
.vve-hero__btn--ghost:focus-visible {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

/* ── Contrôles ────────────────────────────────────────── */
.vve-hero__controls {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .5rem;
  border-radius: 999px;
  background: rgba(var(--vve-hero-night), .55);
}
.vve-hero__controls button {
  cursor: pointer;
  border: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  line-height: 1;
}
.vve-hero__arrow,
.vve-hero__toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.vve-hero__toggle {
  font-size: .8rem;
}
.vve-hero__arrow:hover,
.vve-hero__toggle:hover {
  background: rgba(255, 255, 255, .15);
}
.vve-hero__icon-play,
.vve-hero.is-paused .vve-hero__icon-pause {
  display: none;
}
.vve-hero.is-paused .vve-hero__icon-play {
  display: inline;
}
.vve-hero__dots {
  display: flex;
  gap: .4rem;
}
.vve-hero__dot {
  width: .75rem;
  height: .75rem;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45) !important;
}
.vve-hero__dot.is-active {
  background: var(--vve-hero-sun) !important;
  transform: scale(1.2);
}
.vve-hero button:focus-visible,
.vve-hero__btn:focus-visible {
  outline: 3px solid var(--vve-hero-sun);
  outline-offset: 2px;
}

/* ── Tablette : 768 à 1199 px (12:7) ──────────────────── */
@media (min-width: 768px) {
  .vve-hero__slides {
    aspect-ratio: 12 / 7;
    max-height: none;
  }
  .vve-hero__overlay {
    background: linear-gradient(90deg, rgba(var(--vve-hero-night), .88) 0%, rgba(var(--vve-hero-night), .55) 45%, rgba(var(--vve-hero-night), 0) 80%);
  }
  .vve-hero__content {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .vve-hero__controls {
    left: auto;
    right: 1.5rem;
    transform: none;
  }
}

/* ── Ordinateur : 1200 px et plus (12:5) ─────────────── */
@media (min-width: 1200px) {
  .vve-hero__slides {
    aspect-ratio: 12 / 5;
    min-height: 460px;
  }
}

/* ── Animations réduites ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vve-hero {
    --vve-hero-fade: 0s;
  }
  .vve-hero__btn {
    transition: none;
  }
}
