/* ==========================================================================
   Homepage Hero Carousel (Ken Burns)
   Classes: content-hero.php + hero-carousel.js
   JS toggles: .is-active on slides, .ken-burns-0/1/2 on slides
   PHP sets initial: .hero-carousel__slide--active on first slide
   ========================================================================== */

/* ---------- Carousel Section ---------- */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Slide Track ---------- */
.hero-carousel__track {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---------- Individual Slides ---------- */
.hero-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 1.5s ease;
}

/* Active state — supports both the BEM modifier from PHP and the JS class */
.hero-carousel__slide--active,
.hero-carousel__slide.is-active {
  opacity: 1;
  z-index: 1;
}

/* ---------- Slide Background Image ---------- */
.hero-carousel__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

/* ---------- Ken Burns Animations ----------
   Applied by JS to .hero-carousel__slide via data-animation attribute.
   The ken-burns class goes on the slide; we animate the __image child
   so the overlay and content stay stable.
   ========================================================================== */

/* Variant 0: slow zoom in, drift top-left */
.hero-carousel__slide.ken-burns-0 .hero-carousel__image,
.hero-carousel__slide[data-animation="ken-burns-0"].is-active .hero-carousel__image,
.hero-carousel__slide[data-animation="ken-burns-0"].hero-carousel__slide--active .hero-carousel__image {
  animation: ken-burns-0 10s alternate infinite ease-in-out;
}

/* Variant 1: zoom out, drift bottom-right */
.hero-carousel__slide.ken-burns-1 .hero-carousel__image,
.hero-carousel__slide[data-animation="ken-burns-1"].is-active .hero-carousel__image,
.hero-carousel__slide[data-animation="ken-burns-1"].hero-carousel__slide--active .hero-carousel__image {
  animation: ken-burns-1 10s alternate infinite ease-in-out;
}

/* Variant 2: zoom in, drift right */
.hero-carousel__slide.ken-burns-2 .hero-carousel__image,
.hero-carousel__slide[data-animation="ken-burns-2"].is-active .hero-carousel__image,
.hero-carousel__slide[data-animation="ken-burns-2"].hero-carousel__slide--active .hero-carousel__image {
  animation: ken-burns-2 10s alternate infinite ease-in-out;
}

/* Inactive slides: no animation */
.hero-carousel__slide:not(.is-active):not(.hero-carousel__slide--active) .hero-carousel__image {
  animation: none;
}

/* ---------- Gradient Overlay ---------- */
.hero-carousel__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    var(--color-bg) 0%,
    rgba(13, 13, 18, 0.5) 30%,
    rgba(13, 13, 18, 0.15) 60%,
    transparent 100%
  );
  pointer-events: none;
}

/* ---------- Content Area (centered, near bottom) ---------- */
.hero-carousel__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding-bottom: 5rem;
}

.hero-carousel__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 56rem;
}

/* ---------- Heading ---------- */
.hero-carousel__heading {
  font-family: var(--font-body);
  font-weight: var(--font-weight-normal);
  font-size: 2.25rem;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .hero-carousel__heading {
    font-size: 3rem;
  }
}

@media (min-width: 768px) {
  .hero-carousel__heading {
    font-size: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .hero-carousel__heading {
    font-size: 4.5rem;
  }
}

/* Accent span inside heading — uses the shared .text-gradient utility from main.css */
.hero-carousel__heading-accent {
  /* .text-gradient handles the gradient + italic display font */
}

/* CTA button spacing */
.hero-carousel__text .btn-cta {
  margin-bottom: 4rem;
}

/* ---------- Navigation Arrows ---------- */
.hero-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.hero-carousel__nav:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-carousel__nav--prev {
  left: 1.5rem;
}

.hero-carousel__nav--next {
  right: 1.5rem;
}

@media (max-width: 639px) {
  .hero-carousel__nav {
    width: 40px;
    height: 40px;
  }
  .hero-carousel__nav--prev {
    left: 1rem;
  }
  .hero-carousel__nav--next {
    right: 1rem;
  }
}

/* ---------- Pagination Dots ---------- */
.hero-carousel__dots {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 0.5rem;
}

.hero-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s, width 0.2s, border-radius 0.2s;
}

.hero-carousel__dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.hero-carousel__dot.is-active {
  background: #fff;
  border-color: #fff;
  width: 24px;
  border-radius: 5px;
}

/* ---------- Scroll Indicator (bottom-right) ---------- */
.hero-carousel__scroll {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Hide on small screens where it crowds the CTA */
@media (max-width: 639px) {
  .hero-carousel__scroll {
    display: none;
  }
}

.hero-carousel__scroll-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.hero-carousel__scroll-line {
  position: relative;
  width: 1px;
  height: 4rem;
  background-color: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.hero-carousel__scroll-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1.5rem;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: slide-down 1.5s ease-in-out infinite;
}

/* ---------- Ken Burns Keyframes ----------
   Defined in main.css — duplicated here for component self-containment.
   If main.css already has them, these are harmless duplicates.
   ========================================================================== */
@keyframes ken-burns-0 {
  0% {
    transform: scale(1.05) translate(0, 0);
  }
  100% {
    transform: scale(1.18) translate(-3%, -2%);
  }
}

@keyframes ken-burns-1 {
  0% {
    transform: scale(1.15) translate(-2%, -1%);
  }
  100% {
    transform: scale(1.05) translate(2%, 1%);
  }
}

@keyframes ken-burns-2 {
  0% {
    transform: scale(1.05) translate(2%, 0);
  }
  100% {
    transform: scale(1.15) translate(-1%, -3%);
  }
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(300%);
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-carousel__slide {
    transition-duration: 0.01ms !important;
  }

  .hero-carousel__image {
    animation: none !important;
  }

  .hero-carousel__scroll-indicator {
    animation: none !important;
  }
}
