/* --- Hero Rotator as background layers (caption always visible) --------- */
/* Works for both splash and home layouts */
.layout--splash .page__hero--overlay,
.layout--home  .page__hero--overlay {
  position: relative;   /* stacking context */
  overflow: hidden;
}

/* Theme's image wrapper is the base layer */
.layout--splash .page__hero--overlay .page__hero-image,
.layout--home  .page__hero--overlay .page__hero-image {
  position: relative;
  z-index: 0;           /* bottom */
}

/* Our rotator container lives inside the image wrapper */
.hero-rotator-bg {
  position: absolute;
  inset: 0;
  z-index: 0;           /* below overlay filter and caption */
  pointer-events: none;
}

/* Two background layers we crossfade between */
.hr-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity var(--fade, 900ms) ease-in-out;
}

.hr-bg.hr--active {
  opacity: 1;
}

/* Keep the theme's overlay_filter above backgrounds */
.layout--splash .page__hero--overlay::before,
.layout--home  .page__hero--overlay::before {
  z-index: 1 !important;
}

/* Caption always on top and never fades */
.layout--splash .page__hero--overlay .page__hero-caption,
.layout--home  .page__hero--overlay .page__hero-caption {
  position: relative;
  z-index: 2 !important;
  opacity: 1 !important;
  transition: none !important;
  animation: none !important;
}

/* Also lock down children against inherited animations */
.layout--splash .page__hero--overlay .page__hero-caption *,
.layout--home  .page__hero--overlay .page__hero-caption * {
  opacity: 1 !important;
  transition: none !important;
  animation: none !important;
}

/* Reduced motion: we already only fade backgrounds; caption is static */
@media (prefers-reduced-motion: reduce) {
  .hr-bg { transition: none !important; }
}
