/* ==========================================================================
   ASUNA PARFUMERIE — Composant Hero (carrousel 4 slides)
   Dépend de tokens.css. Comportement : assets/js/hero.js
   Desktop (>= 768px) : bandeau panoramique ~3,6:1, texte à gauche, flacon à droite
   Mobile  (<  768px) : bandeau compact horizontal, cadrage spécifique par slide
   Cadrage par slide : variables --hero-pos-d (desktop) et --hero-pos-m (mobile)
   ========================================================================== */

.hero {
  --hero-gutter: clamp(16px, 2.4vw, 34px);
  --hero-radius: 20px;
  --hero-ratio: 3.6;
  --hero-min-height: 340px;
  --hero-pad-x: clamp(72px, 8.3%, 132px);
  --hero-duration: 1000ms;
  --hero-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  padding: 6px var(--hero-gutter) 0;
}

.hero__viewport {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  aspect-ratio: var(--hero-ratio);
  min-height: var(--hero-min-height);
  overflow: hidden;
  border-radius: var(--hero-radius);
  background: var(--asuna-night);
  isolation: isolate;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

/* --------------------------------------------------------------------------
   Slides
   -------------------------------------------------------------------------- */
.hero__slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--hero-duration) var(--hero-ease),
    visibility 0s linear var(--hero-duration);
}

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

.hero__slide.is-leaving {
  z-index: 1;
  opacity: 0;
  visibility: visible;
}

/* Visuel : fondu + léger glissement + profondeur */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: 0;
  overflow: hidden;
}

.hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--hero-pos-d, 62% 40%);
  transform: translateX(calc(var(--hero-dir, 1) * 1.6%)) scale(1.045);
  transition: transform calc(var(--hero-duration) * 1.4) var(--hero-ease);
  will-change: transform;
}

.hero__slide.is-active .hero__media img {
  transform: translateX(0) scale(1);
}

.hero__slide.is-leaving .hero__media img {
  transform: translateX(calc(var(--hero-dir, 1) * -1%)) scale(1.01);
}

/* Lisibilité du texte : voile discret côté gauche, le flacon reste intact */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(28, 13, 5, 0.55) 0%,
    rgba(28, 13, 5, 0.32) 34%,
    rgba(28, 13, 5, 0) 56%
  );
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Contenu texte
   -------------------------------------------------------------------------- */
.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: calc(46% + var(--hero-pad-x));
  padding: 8px 24px 8px var(--hero-pad-x);
}

.hero__eyebrow,
.hero__title,
.hero__text,
.hero__cta {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.hero__slide.is-active .hero__eyebrow,
.hero__slide.is-active .hero__title,
.hero__slide.is-active .hero__text,
.hero__slide.is-active .hero__cta {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 750ms var(--hero-ease),
    transform 900ms var(--hero-ease);
}

.hero__slide.is-active .hero__eyebrow { transition-delay: 280ms; }
.hero__slide.is-active .hero__title { transition-delay: 380ms; }
.hero__slide.is-active .hero__text { transition-delay: 480ms; }
.hero__slide.is-active .hero__cta { transition-delay: 580ms; }

.hero__eyebrow {
  margin: 0 0 18px;
  color: var(--asuna-eyebrow);
  font-family: var(--asuna-font-ui);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero__title {
  max-width: 9.6em;
  margin: 0;
  color: var(--asuna-on-dark);
  font-family: var(--asuna-font-display);
  font-size: clamp(38px, 4.05vw, 62px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero__text {
  max-width: 380px;
  margin: 22px 0 0;
  color: var(--asuna-on-dark-soft);
  font-family: var(--asuna-font-ui);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 41px;
  margin-top: 26px;
  padding: 0 22px 0 24px;
  border-radius: var(--asuna-radius-pill);
  background: var(--asuna-caramel);
  color: var(--asuna-on-dark);
  font-family: var(--asuna-font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.hero__cta svg {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.3s var(--asuna-ease);
}

.hero__cta:hover {
  background: var(--asuna-caramel-hover);
}

.hero__cta:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Flèches
   -------------------------------------------------------------------------- */
.hero__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--asuna-white);
  color: var(--asuna-brown);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.25s var(--asuna-ease), background-color 0.2s ease;
}

.hero__arrow:hover {
  background: var(--asuna-ivory-light);
  transform: translateY(-50%) scale(1.06);
}

.hero__arrow svg {
  width: 14px;
  height: 14px;
}

.hero__arrow--prev { left: 21px; }
.hero__arrow--next { right: 21px; }

.hero__arrow-icon--mobile { display: none; }

/* --------------------------------------------------------------------------
   Indicateurs
   -------------------------------------------------------------------------- */
.hero__dots {
  position: absolute;
  right: 30px;
  bottom: 15px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__dot {
  position: relative;
  display: block;
  width: 15px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: width 0.5s var(--hero-ease);
}

.hero__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: var(--asuna-radius-pill);
  background: var(--asuna-white);
  opacity: 0.85;
  transform: translate(-50%, -50%);
  transition: width 0.5s var(--hero-ease), height 0.5s var(--hero-ease), opacity 0.3s ease;
}

.hero__dot[aria-current="true"] {
  width: 38px;
}

.hero__dot[aria-current="true"]::before {
  width: 28px;
  height: 3.5px;
  opacity: 1;
}

.hero__dot:hover::before { opacity: 1; }

/* --------------------------------------------------------------------------
   Focus clavier
   -------------------------------------------------------------------------- */
.hero__cta:focus-visible,
.hero__arrow:focus-visible,
.hero__dot:focus-visible {
  outline: 2px solid var(--asuna-champagne);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Mobile : < 768px
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .hero {
    --hero-gutter: 16px;
    --hero-radius: 20px;
    --hero-pad-x: 20px;
    padding-top: 2px;
  }

  .hero__viewport {
    aspect-ratio: auto;
    height: clamp(296px, 78vw, 360px);
    min-height: 0;
  }

  .hero__media img {
    object-position: var(--hero-pos-m, 73% 50%);
  }

  /* Le visuel est recadré sur le flacon : la zone de texte passe sur les arches, voile plus présent */
  .hero__media::after {
    background: linear-gradient(
      90deg,
      rgba(28, 13, 5, 0.94) 0%,
      rgba(28, 13, 5, 0.82) 36%,
      rgba(28, 13, 5, 0.35) 54%,
      rgba(28, 13, 5, 0) 66%
    );
  }

  .hero__content {
    max-width: 52%;
    padding: 6px 0 22px var(--hero-pad-x);
  }

  .hero__eyebrow {
    margin-bottom: 10px;
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .hero__title {
    max-width: none;
    font-size: clamp(21px, 6.2vw, 28px);
    line-height: 1.02;
  }

  .hero__text {
    max-width: none;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
  }

  .hero__cta {
    gap: 8px;
    height: 36px;
    margin-top: 16px;
    padding: 0 14px 0 16px;
    font-size: 11.5px;
  }

  .hero__cta svg {
    width: 12px;
    height: 12px;
  }

  .hero__arrow--prev { display: none; }

  .hero__arrow--next {
    right: 12px;
    width: 34px;
    height: 34px;
  }

  .hero__arrow-icon--desktop { display: none; }
  .hero__arrow-icon--mobile { display: block; }

  .hero__dots {
    right: 12px;
    bottom: 8px;
    gap: 2px;
  }

  .hero__dot {
    width: 12px;
    height: 22px;
  }

  .hero__dot::before {
    width: 4.5px;
    height: 4.5px;
  }

  .hero__dot[aria-current="true"] {
    width: 30px;
  }

  .hero__dot[aria-current="true"]::before {
    width: 22px;
    height: 3px;
  }
}

@media (max-width: 359.98px) {
  .hero {
    --hero-gutter: 12px;
    --hero-pad-x: 16px;
  }

  .hero__viewport { height: 276px; }
  .hero__content { max-width: 53%; }
  .hero__eyebrow { margin-bottom: 8px; font-size: 8.5px; }
  .hero__title { font-size: 20px; }
  .hero__text { font-size: 11px; }
  .hero__arrow--next { right: 8px; width: 30px; height: 30px; }
  .hero__cta { padding: 0 14px; font-size: 11px; }
  .hero__cta svg { display: none; }
}

/* --------------------------------------------------------------------------
   Mouvement réduit : fondu simple, pas de glissement
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero {
    --hero-duration: 1ms;
  }

  .hero__media img,
  .hero__slide.is-active .hero__media img,
  .hero__slide.is-leaving .hero__media img {
    transform: none;
    transition: none;
  }

  .hero__eyebrow,
  .hero__title,
  .hero__text,
  .hero__cta,
  .hero__slide.is-active .hero__eyebrow,
  .hero__slide.is-active .hero__title,
  .hero__slide.is-active .hero__text,
  .hero__slide.is-active .hero__cta {
    transform: none;
    transition: none;
  }
}
