/**
 * Hero Carousel Styles
 */

/* Configuration */
.hero-carousel {
  --carousel-autoplay-duration: 6000ms;
  --carousel-transition-duration: 500ms;
}

/* Container */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 400px;
  background: var(--njtpa-dark-blue);
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-carousel {
    height: 500px;
  }
}

@media (min-width: 1024px) {
  .hero-carousel {
    height: 650px;
  }
}

/* Track - holds all slides in a row */
.hero-carousel__track {
  display: flex;
  height: 100%;
  transition: transform var(--carousel-transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-carousel__track.is-dragging {
  transition: none;
}

/* Individual slides */
.hero-carousel__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

/* Background image layer */
.hero-carousel__image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Dark overlay on left where text lives, fades out to show image */
.hero-carousel__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.15) 70%,
    transparent 100%
  );
}

/* Content container */
.hero-carousel__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--space-xl);
  color: var(--njtpa-white);
}

@media (min-width: 768px) {
  .hero-carousel__content {
    padding: var(--space-4xl);
  }
}

@media (min-width: 1024px) {
  .hero-carousel__content {
    padding: var(--space-5xl) var(--space-4xl);
  }
}

/* Title */
.hero-carousel__title {
  margin: 0 0 var(--space-lg);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  max-width: 600px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .hero-carousel__title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .hero-carousel__title {
    font-size: var(--font-size-5xl);
  }
}

/* Description text */
.hero-carousel__text {
  margin: 0 0 var(--space-xl);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  max-width: 500px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .hero-carousel__text {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2xl);
  }
}

/* CTA Button */
.hero-carousel__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  background: var(--njtpa-white);
  color: var(--njtpa-dark-blue);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-carousel__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: var(--njtpa-dark-blue);
}

.hero-carousel__button:focus {
  outline: 2px solid var(--njtpa-white);
  outline-offset: 2px;
}

.hero-carousel__button svg {
  width: 1em;
  height: 1em;
  transition: transform 0.2s ease;
}

.hero-carousel__button:hover svg {
  transform: translateX(3px);
}

/* Navigation arrows */
.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--njtpa-white);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}

@media (min-width: 768px) {
  .hero-carousel__arrow {
    display: flex;
  }
}

.hero-carousel__arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hero-carousel__arrow:focus {
  outline: 2px solid var(--njtpa-white);
  outline-offset: 2px;
}

.hero-carousel__arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.hero-carousel__arrow--prev {
  left: var(--space-lg);
}

.hero-carousel__arrow--next {
  right: var(--space-lg);
}

@media (min-width: 1024px) {
  .hero-carousel__arrow--prev {
    left: var(--space-xl);
  }
  .hero-carousel__arrow--next {
    right: var(--space-xl);
  }
}

.hero-carousel__arrow svg {
  width: 24px;
  height: 24px;
}

/* Dot navigation */
.hero-carousel__dots {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero-carousel__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.hero-carousel__dot:focus {
  outline: 2px solid var(--njtpa-white);
  outline-offset: 2px;
}

.hero-carousel__dot.is-active {
  background: var(--njtpa-white);
  transform: scale(1.2);
}

/* Progress bar */
.hero-carousel__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.hero-carousel__progress-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  transform-origin: left;
  transform: scaleX(0);
}

.hero-carousel__progress-bar.is-animating {
  animation: hero-progress-fill var(--carousel-autoplay-duration) linear forwards;
}

@keyframes hero-progress-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-carousel.is-paused .hero-carousel__progress-bar {
  animation-play-state: paused;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-carousel__track {
    transition-duration: 0ms;
  }

  .hero-carousel__progress-bar {
    animation: none;
    transform: scaleX(1);
  }

  .hero-carousel__button,
  .hero-carousel__arrow,
  .hero-carousel__dot {
    transition: none;
  }
}

/* Screen reader only */
.hero-carousel .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
