/*
  aerofitting-v2-hero.css — hero photo rotator and credit styles
  Contract: [data-photo-rotator], [data-rotator-slide], .is-active, .av2-credit
*/

.av2-photo-rotator {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0; /* Creates an isolated stacking context so slides and scrim stay strictly behind .av2-hero-inner (z-index: 2) */
}

.av2-rotator-slides {
  position: absolute;
  inset: 0;
}

.av2-rotator-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 800ms var(--av2-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              visibility 800ms var(--av2-ease, cubic-bezier(0.16, 1, 0.3, 1));
  pointer-events: none;
  z-index: 1;
}

.av2-rotator-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.av2-rotator-slide picture,
.av2-rotator-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.av2-rotator-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: none !important;
}

/* Ken Burns subtle zoom on the active frame only */
.av2-rotator-slide.is-active img {
  animation: av2-kenburns 18s ease-out 1 forwards !important;
}

/* Scrim: Ensure high-contrast legibility for white text against bright backgrounds */
.av2-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    /* Left gradient tuned for text legibility without crushing the athlete/venue */
    linear-gradient(90deg, rgba(10, 10, 10, 0.85) 0%, rgba(10, 10, 10, 0.72) 32%, rgba(10, 10, 10, 0.35) 55%, rgba(10, 10, 10, 0.08) 75%, transparent 100%),
    /* Vertical gradient for top nav readability and subtle bottom grounding */
    linear-gradient(180deg, rgba(10, 10, 10, 0.6) 0%, rgba(10, 10, 10, 0.15) 25%, rgba(10, 10, 10, 0.2) 65%, rgba(10, 10, 10, 0.75) 100%);
}

@media (max-width: 768px) {
  .av2-hero-scrim {
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.82) 0%, rgba(10, 10, 10, 0.5) 40%, rgba(10, 10, 10, 0.88) 100%);
  }
}

/* Photo credit element */
.av2-credit {
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.av2-credit--light,
.theme-light .av2-credit {
  color: var(--text-muted, #71717a);
}

.av2-rotator-slide .av2-credit {
  position: absolute;
  right: 24px;
  bottom: 18px;
  z-index: 4;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 768px) {
  .av2-rotator-slide .av2-credit {
    right: 16px;
    bottom: 12px;
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .av2-rotator-slide {
    transition: none !important;
  }
  .av2-rotator-slide:not(:first-child) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  .av2-rotator-slide:first-child {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .av2-rotator-slide img,
  .av2-rotator-slide.is-active img {
    animation: none !important;
    transform: none !important;
  }
}
