/* ==========================================================================
   HERO SLIDER — loaded by common/home only when there is more than 1 banner.
   Base hero styles live in home.css; this file adds slide stacking,
   transitions and the stripe pager (same look as .blog__dots).
   Images: crossfade + soft settle-in zoom. Texts: fade + vertical shift,
   staggered per line.
   ========================================================================== */
.hero--slider {
  --hero-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-fade: 900ms;
  --hero-text: 650ms;
}

/* ----- Texts: all slides share one grid cell → height of the tallest ----- */
.hero--slider .hero__texts {
  flex: 1 1 0;
  max-width: 496px;
  display: grid;
  align-items: center;
}
.hero--slider .hero__content {
  grid-area: 1 / 1;
  max-width: none;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear var(--hero-text);
}
.hero--slider .hero__content > * {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity calc(var(--hero-text) * 0.6) ease,
    transform var(--hero-text) var(--hero-ease);
}
/* Leaving slide drifts up and out quickly */
.hero--slider .hero__content.is-leaving > * {
  transform: translate3d(0, -16px, 0);
  transition-duration: 320ms, 420ms;
  transition-timing-function: ease, ease-in;
}
.hero--slider .hero__content.is-active {
  visibility: visible;
  pointer-events: auto;
  transition: none;
}
.hero--slider .hero__content.is-active > * {
  opacity: 1;
  transform: none;
}
/* Stagger: tag → title → subtitle → button, after the old text has left */
.hero--slider .hero__content.is-active > :nth-child(1) { transition-delay: 220ms; }
.hero--slider .hero__content.is-active > :nth-child(2) { transition-delay: 300ms; }
.hero--slider .hero__content.is-active > :nth-child(3) { transition-delay: 380ms; }
.hero--slider .hero__content.is-active > :nth-child(4) { transition-delay: 460ms; }

/* ----- Media: one framed card, slides crossfade inside it ----- */
.hero__aside {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero--slider .hero__media-frame {
  display: grid;
  position: relative;
  isolation: isolate;
}
.hero__slide {
  grid-area: 1 / 1;
  display: block;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--hero-fade) ease,
    visibility 0s linear var(--hero-fade);
}
.hero__slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--hero-fade) ease, visibility 0s;
}
.hero__slide picture,
.hero__slide img {
  width: 100%;
  height: 100%;
  display: block;
}
.hero__slide img {
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  transition: transform 1600ms var(--hero-ease);
}
.hero__slide.is-active img {
  transform: none;
}

/* ----- Stripe pager (mirrors .blog__dot) with autoplay progress ----- */
.hero__dots {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}
.hero__dot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 8px;
  padding: 0;
  border: 1px solid #2C2B39;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 200ms ease;
}
/* Bigger tap target without changing the visual height */
.hero__dot::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}
.hero__dot:hover { border-color: #46455A; }
.hero__dot:focus-visible {
  outline: 2px solid #0F9C4D;
  outline-offset: 2px;
}
.hero__dot-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #2C2B39;
  transform: scaleX(0);
  transform-origin: left center;
}
.hero__dot.is-active .hero__dot-fill {
  transform: scaleX(1);
}
/* While autoplay runs the active stripe fills up over the interval */
.hero--slider.is-autoplay .hero__dot.is-active .hero__dot-fill {
  transform: scaleX(0);
  animation: hero-dot-progress var(--hero-interval, 6500ms) linear forwards;
}
.hero--slider.is-paused .hero__dot.is-active .hero__dot-fill {
  animation-play-state: paused;
}
@keyframes hero-dot-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
[data-theme="light"] .hero__dot { border-color: #BCBBCA; }
[data-theme="light"] .hero__dot:hover { border-color: #9E9DB0; }
[data-theme="light"] .hero__dot-fill { background: #BCBBCA; }

/* ----- Tablet: column layout, media card centred ----- */
@media (max-width: 1199px) {
  .hero--slider .hero__texts { max-width: 100%; }
  .hero__aside { align-self: center; }
  .hero--slider .hero__media { align-self: auto; }
}

/* ----- Phone: full-width card, natural image height ----- */
@media (max-width: 767px) {
  .hero__aside {
    align-self: stretch;
    width: 100%;
    gap: 14px;
  }
  .hero--slider .hero__texts { padding-top: 16px; }
  .hero--slider .hero__content { padding-top: 0; }
  .hero--slider .hero__media-frame { height: auto; }
  .hero__slide picture,
  .hero__slide img {
    height: auto;
    object-fit: contain;
  }
  .hero__dots { gap: 8px; }
  .hero--slider .hero__content > * { transform: translate3d(0, 16px, 0); }
  .hero--slider .hero__content.is-leaving > * { transform: translate3d(0, -10px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero--slider .hero__content > *,
  .hero--slider .hero__content.is-leaving > *,
  .hero__slide img {
    transform: none !important;
  }
  .hero--slider .hero__content.is-active > * { transition-delay: 0ms !important; }
}
