/* ═══════════════════════════════════════════════════════════
   Section 3 — Featured Products (scroll-driven rotating cards)
   A tall pinned stage; assets/js/featured-rotator.js drives each
   card's transform directly off scroll position (plain JS + rAF, no
   animation library). Falls back to a static stacked list under
   prefers-reduced-motion (.featured-rotator--static, set by the JS).
   ═══════════════════════════════════════════════════════════ */

.featured-rotator {
  position: relative;
  height: calc(var(--count, 5) * 90vh);
  /* Was permanently dark (var(--color-primary)) regardless of theme —
     the section chrome (bg, header, counter) now follows the site
     theme like everything else. The individual .rotator-card tiles
     are unaffected: they're full-bleed photos with their own fixed
     dark scrim (.rotator-card::after) baked in for legibility, which
     stays correct in both themes since it's compositing onto a photo,
     not a surface color. */
  background: var(--color-bg-light);
  color: var(--color-text-dark);
}

.featured-rotator__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(1.5rem, 4vh, 3rem);
}

.featured-rotator__header {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 620px;
  padding-inline: var(--space-6);
  margin-bottom: clamp(1.5rem, 4vh, 2.75rem);
}

.featured-rotator__header .section-tag {
  justify-content: center;
  color: var(--color-accent-light);
}

.featured-rotator__header .section-title {
  color: var(--color-text-dark);
}

.featured-rotator__container {
  position: relative;
  z-index: 1;
  width: min(1200px, 88vw);
  height: min(600px, 66vh);
  perspective: 1200px;
}

.rotator-card {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 36px;
  overflow: hidden;
  background: var(--color-primary-light);
  text-decoration: none;
  transform-origin: center center;
  will-change: transform, opacity, filter;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.rotator-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Only the inner image animates here — the card itself (.rotator-card)
     has its transform/opacity/filter driven directly by
     featured-rotator.js off scroll position, so hover polish must stay
     off those properties to avoid fighting the JS-set inline styles. */
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rotator-card:hover img {
  transform: scale(1.04);
}

.rotator-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 55%),
    linear-gradient(to right, rgba(0, 0, 0, 0.55) 0%, transparent 48%);
  pointer-events: none;
}

.rotator-card__content {
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 48px;
  z-index: 2;
}

.rotator-card__eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.65;
  margin-bottom: 12px;
}

.rotator-card__title {
  font-family: var(--font-heading);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: #ffffff;
}

.rotator-card__desc {
  color: #dddddd;
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
  max-width: 44ch;
}

.featured-rotator__counter {
  position: absolute;
  right: clamp(1.25rem, 4vw, 2.5rem);
  bottom: clamp(1.25rem, 4vw, 2.5rem);
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.05em;
  opacity: 0.55;
  z-index: 5;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 599.98px) {
  .featured-rotator__container {
    width: 92vw;
    height: 56vh;
  }

  .rotator-card {
    border-radius: 24px;
  }

  .rotator-card__content {
    left: 28px;
    right: 28px;
    bottom: 28px;
  }

  .rotator-card__title {
    font-size: 32px;
  }

  .rotator-card__desc {
    font-size: 14px;
  }
}

/* ── Reduced motion / no-JS fallback ────────────────────────────
   Cards render as a normal stacked list, fully visible, no pin. */
.featured-rotator--static {
  height: auto;
  padding-block: clamp(3rem, 6vw, 5rem) clamp(3.5rem, 7vw, 6rem);
}

.featured-rotator--static .featured-rotator__stage {
  position: static;
  height: auto;
  display: block;
  padding-block: 0;
}

.featured-rotator--static .featured-rotator__header {
  margin-inline: auto;
}

.featured-rotator--static .featured-rotator__container {
  position: static;
  width: min(720px, 92vw);
  height: auto;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.featured-rotator--static .rotator-card {
  position: relative;
  inset: auto;
  height: min(480px, 70vh);
  opacity: 1 !important;
  transform: none !important;
}

.featured-rotator--static .featured-rotator__counter {
  display: none;
}
