/**
 * Hero Carousel Styles
 */

/* Configuration */
.hero-carousel {
  --carousel-autoplay-duration: 6000ms;
  --carousel-transition-duration: 500ms;
  --hero-image-overlay: 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%
  );
  --hero-content-panel-width: auto;
  --hero-content-panel-padding: 0;
  --hero-content-panel-background: transparent;
  --hero-content-panel-border: 0;
  --hero-content-panel-radius: 0;
  --hero-content-panel-shadow: none;
  --hero-content-panel-blur: none;
  --hero-text-color: var(--njtpa-white);
  --hero-title-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --hero-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --hero-title-max-width: 600px;
  --hero-text-max-width: 500px;
  --hero-button-background: var(--njtpa-white);
  --hero-button-color: var(--njtpa-dark-blue);
  --hero-button-hover-background: var(--njtpa-white);
  --hero-button-hover-color: var(--njtpa-dark-blue);
  --hero-button-focus: var(--njtpa-white);
  --hero-control-background: rgba(255, 255, 255, 0.15);
  --hero-control-background-hover: rgba(255, 255, 255, 0.25);
  --hero-control-border: rgba(255, 255, 255, 0.3);
  --hero-control-color: var(--njtpa-white);
  --hero-control-focus: var(--njtpa-white);
  --hero-dot-background: rgba(255, 255, 255, 0.4);
  --hero-dot-hover-background: rgba(255, 255, 255, 0.7);
  --hero-dot-active-background: var(--njtpa-white);
  --hero-progress-track: rgba(255, 255, 255, 0.2);
  --hero-progress-fill: rgba(255, 255, 255, 0.6);
}

/* 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: var(--hero-image-overlay);
}

/* 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(--hero-text-color);
}

.hero-carousel__content-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: var(--hero-content-panel-width);
  padding: var(--hero-content-panel-padding);
  background: var(--hero-content-panel-background);
  border: var(--hero-content-panel-border);
  border-radius: var(--hero-content-panel-radius);
  box-shadow: var(--hero-content-panel-shadow);
  backdrop-filter: var(--hero-content-panel-blur);
  -webkit-backdrop-filter: var(--hero-content-panel-blur);
}

@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: var(--hero-title-max-width);
  color: inherit;
  text-shadow: var(--hero-title-shadow);
}

@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: var(--hero-text-max-width);
  color: inherit;
  text-shadow: var(--hero-text-shadow);
}

@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.625rem 1.25rem;
  margin-bottom: var(--space-lg);
  background: var(--hero-button-background);
  color: var(--hero-button-color);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

@media (min-width: 768px) {
  .hero-carousel__button {
    padding: 0.75rem 1.5rem;
    margin-bottom: var(--space-xl);
    font-size: var(--font-size-base);
  }
}

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

.hero-carousel__button:focus {
  outline: 2px solid var(--hero-button-focus);
  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: var(--hero-control-background);
  border: 1px solid var(--hero-control-border);
  border-radius: 50%;
  color: var(--hero-control-color);
  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: var(--hero-control-background-hover);
}

.hero-carousel__arrow:focus {
  outline: 2px solid var(--hero-control-focus);
  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: var(--hero-dot-background);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-carousel__dot:hover {
  background: var(--hero-dot-hover-background);
}

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

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

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

.hero-carousel__progress-bar {
  height: 100%;
  background: var(--hero-progress-fill);
  transform-origin: left;
  transform: scaleX(0);
}

.hero-carousel--dark-panel {
  --hero-image-overlay: rgba(19, 47, 94, 0.08);
  --hero-content-panel-width: min(100%, 34rem);
  --hero-content-panel-padding: clamp(0.875rem, 1.4vw, 1.25rem);
  --hero-content-panel-background: rgba(249, 239, 213, 0.8);
  --hero-content-panel-border: 1px solid rgba(19, 47, 94, 0.12);
  --hero-content-panel-radius: 6px;
  --hero-content-panel-shadow: 0 14px 32px rgba(19, 47, 94, 0.16);
  --hero-content-panel-blur: none;
  --hero-text-color: var(--njtpa-dark-blue);
  --hero-title-shadow: none;
  --hero-text-shadow: none;
  --hero-button-background: var(--njtpa-dark-blue);
  --hero-button-color: var(--njtpa-white);
  --hero-button-hover-background: var(--njtpa-maroon);
  --hero-button-hover-color: var(--njtpa-white);
  --hero-button-focus: var(--njtpa-dark-blue);
  --hero-title-max-width: 100%;
  --hero-text-max-width: 100%;
}

.hero-carousel--dark-panel .hero-carousel__title {
  margin-bottom: 0.75rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
}

.hero-carousel--dark-panel .hero-carousel__text {
  margin-bottom: 1rem;
}

.hero-carousel--dark-panel .hero-carousel__button {
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  font-size: var(--font-size-xs);
}

@media (min-width: 768px) {
  .hero-carousel--dark-panel .hero-carousel__title {
    margin-bottom: 0.875rem;
    font-size: clamp(1.75rem, 2.8vw, 2rem);
  }

  .hero-carousel--dark-panel .hero-carousel__text {
    margin-bottom: 1.125rem;
  }

  .hero-carousel--dark-panel .hero-carousel__button {
    padding: 0.625rem 1.125rem;
    font-size: var(--font-size-sm);
  }
}

@media (min-width: 1024px) {
  .hero-carousel--dark-panel .hero-carousel__title {
    font-size: clamp(1.9rem, 2.2vw, 2.15rem);
  }
}

.hero-carousel--split-sand,
.hero-carousel--split-dark-blue {
  --hero-image-overlay: none;
  --hero-content-panel-width: min(100%, 31rem);
  --hero-title-shadow: none;
  --hero-text-shadow: none;
  --hero-title-max-width: 100%;
  --hero-text-max-width: 100%;
}

.hero-carousel--split-sand {
  --hero-split-surface: var(--njtpa-sand);
  --hero-split-outline: rgba(19, 47, 94, 0.14);
  --hero-split-shadow: 0 16px 36px rgba(19, 47, 94, 0.14);
  --hero-text-color: var(--njtpa-dark-blue);
  --hero-title-shadow: none;
  --hero-text-shadow: none;
  --hero-button-background: var(--njtpa-dark-blue);
  --hero-button-color: var(--njtpa-white);
  --hero-button-hover-background: var(--njtpa-maroon);
  --hero-button-hover-color: var(--njtpa-white);
  --hero-button-focus: var(--njtpa-dark-blue);
  --hero-control-background: rgba(19, 47, 94, 0.74);
  --hero-control-background-hover: rgba(19, 47, 94, 0.88);
  --hero-control-border: rgba(255, 255, 255, 0.25);
  --hero-control-focus: var(--njtpa-dark-blue);
  --hero-dot-background: rgba(19, 47, 94, 0.32);
  --hero-dot-hover-background: rgba(19, 47, 94, 0.52);
  --hero-dot-active-background: var(--njtpa-maroon);
  --hero-progress-track: rgba(19, 47, 94, 0.16);
  --hero-progress-fill: var(--njtpa-maroon);
}

.hero-carousel--split-dark-blue {
  --hero-split-surface: var(--njtpa-dark-blue);
  --hero-split-outline: rgba(249, 239, 213, 0.16);
  --hero-split-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  --hero-text-color: var(--njtpa-white);
  --hero-button-background: var(--njtpa-sand);
  --hero-button-color: var(--njtpa-dark-blue);
  --hero-button-hover-background: var(--njtpa-white);
  --hero-button-hover-color: var(--njtpa-dark-blue);
  --hero-button-focus: var(--njtpa-sand);
  --hero-control-background: rgba(19, 47, 94, 0.78);
  --hero-control-background-hover: rgba(34, 54, 90, 0.92);
  --hero-control-border: rgba(249, 239, 213, 0.4);
  --hero-control-color: var(--njtpa-sand);
  --hero-control-focus: var(--njtpa-sand);
  --hero-dot-background: rgba(249, 239, 213, 0.36);
  --hero-dot-hover-background: rgba(249, 239, 213, 0.6);
  --hero-dot-active-background: var(--njtpa-sand);
  --hero-progress-track: rgba(249, 239, 213, 0.18);
  --hero-progress-fill: var(--njtpa-sand);
}

.hero-carousel--split-sand .hero-carousel__slide,
.hero-carousel--split-dark-blue .hero-carousel__slide {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: auto;
  overflow: hidden;
  background: var(--hero-split-surface);
  border: 1px solid var(--hero-split-outline);
  border-radius: 0;
  box-shadow: var(--hero-split-shadow);
}

.hero-carousel--split-sand .hero-carousel__image,
.hero-carousel--split-dark-blue .hero-carousel__image {
  position: relative;
  inset: auto;
  order: 1;
  flex: 1 1 auto;
  min-height: clamp(12rem, 34vw, 18rem);
}

.hero-carousel--split-sand .hero-carousel__content,
.hero-carousel--split-dark-blue .hero-carousel__content {
  position: relative;
  order: 2;
  align-items: stretch;
  justify-content: center;
  height: auto;
  max-width: none;
  margin: 0;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: transparent;
}

.hero-carousel--split-sand .hero-carousel__content-panel,
.hero-carousel--split-dark-blue .hero-carousel__content-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 31rem);
}

.hero-carousel--split-sand .hero-carousel__content-panel::before {
  content: '';
  display: block;
  width: 3.5rem;
  height: 0.35rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: var(--njtpa-maroon);
}

.hero-carousel--split-dark-blue .hero-carousel__content-panel::before {
  content: '';
  display: block;
  width: 3.5rem;
  height: 0.35rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: var(--njtpa-maroon);
}

.hero-carousel--split-sand .hero-carousel__content::after,
.hero-carousel--split-dark-blue .hero-carousel__content::after {
  content: '';
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 3.75rem;
  height: 3.75rem;
  pointer-events: none;
}

.hero-carousel--split-sand .hero-carousel__content::after {
  border-top: 2px solid rgba(19, 47, 94, 0.28);
  border-right: 2px solid rgba(19, 47, 94, 0.28);
}

.hero-carousel--split-dark-blue .hero-carousel__content::after {
  border-top: 2px solid rgba(249, 239, 213, 0.65);
  border-right: 2px solid rgba(249, 239, 213, 0.65);
}

@media (max-width: 959px) {
  .hero-carousel--split-sand,
  .hero-carousel--split-dark-blue,
  .hero-carousel--split-sand .hero-carousel__track,
  .hero-carousel--split-dark-blue .hero-carousel__track {
    height: auto;
  }

  .hero-carousel--split-sand .hero-carousel__content,
  .hero-carousel--split-dark-blue .hero-carousel__content {
    box-shadow: none;
  }

  .hero-carousel--split-sand .hero-carousel__content::after,
  .hero-carousel--split-dark-blue .hero-carousel__content::after {
    display: none;
  }

  .hero-carousel--split-sand .hero-carousel__title,
  .hero-carousel--split-dark-blue .hero-carousel__title {
    font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-3xl));
  }
}

@media (min-width: 768px) and (max-width: 959px) {
  .hero-carousel--split-sand .hero-carousel__arrow,
  .hero-carousel--split-dark-blue .hero-carousel__arrow {
    top: clamp(12rem, 34vw, 18rem);
    transform: translateY(-100%);
  }

  .hero-carousel--split-sand .hero-carousel__arrow:active,
  .hero-carousel--split-dark-blue .hero-carousel__arrow:active {
    transform: translateY(-100%) scale(0.95);
  }
}

@media (min-width: 960px) and (max-width: 1299px) {
  .hero-carousel--split-sand .hero-carousel__title,
  .hero-carousel--split-dark-blue .hero-carousel__title {
    font-size: clamp(1.65rem, 1.8vw, 1.9rem);
  }
}

@media (min-width: 960px) {
  .hero-carousel--split-sand .hero-carousel__arrow,
  .hero-carousel--split-dark-blue .hero-carousel__arrow {
    top: auto;
    bottom: clamp(1.5rem, 2vw, 2.25rem);
    transform: none;
  }

  .hero-carousel--split-sand .hero-carousel__arrow:active,
  .hero-carousel--split-dark-blue .hero-carousel__arrow:active {
    transform: scale(0.95);
  }

  .hero-carousel--split-sand .hero-carousel__slide,
  .hero-carousel--split-dark-blue .hero-carousel__slide {
    display: grid;
    grid-template-columns: minmax(20rem, 36%) minmax(0, 1fr);
    height: 100%;
  }

  .hero-carousel--split-sand .hero-carousel__content,
  .hero-carousel--split-dark-blue .hero-carousel__content,
  .hero-carousel--split-sand .hero-carousel__image,
  .hero-carousel--split-dark-blue .hero-carousel__image {
    order: initial;
    height: 100%;
  }

  .hero-carousel--split-sand .hero-carousel__content,
  .hero-carousel--split-dark-blue .hero-carousel__content {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-carousel--split-sand .hero-carousel__image,
  .hero-carousel--split-dark-blue .hero-carousel__image {
    grid-column: 2;
    grid-row: 1;
  }

  .hero-carousel--split-sand .hero-carousel__content,
  .hero-carousel--split-dark-blue .hero-carousel__content {
    padding-block: clamp(2rem, 3vw, 4rem);
    padding-inline: 75px;
  }

  .hero-carousel--split-sand .hero-carousel__content,
  .hero-carousel--split-dark-blue .hero-carousel__content {
    box-shadow: none;
  }
}

.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;
}
