.hero-slider-section {
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Hero should bleed edge-to-edge; global .section padding must not inset the banner.
   Doubled-class selector beats .section base without !important. */
.hero-slider-section.section.section {
  padding: 0;
}

.hero-slider-section .container-full,
.hero-slider-section .section-body {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

.hero-slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  box-sizing: border-box;
}

/* Video / gradient slides: viewport band. Image slides use .hero--natural-image-height + JS height. */
.hero-slider-wrapper:not(.hero--natural-image-height) {
  min-height: calc(450px - var(--header-hero-offset, 0px));
  height: calc(100vh - var(--header-hero-offset, 0px));
  height: calc(100svh - var(--header-hero-offset, 0px));
}

.hero-slider-wrapper.hero--natural-image-height {
  min-height: 0;
  height: auto;
  max-height: calc(100vh - var(--header-hero-offset, 0px));
  max-height: calc(100svh - var(--header-hero-offset, 0px));
}

/* Fixed aspect ratios (desktop). Height is derived from the ratio, overriding the
   viewport band and JS intrinsic height. 'original' keeps the default behavior. */
@media (min-width: 769px) {
  .hero-slider-section .hero-slider-wrapper.hero-ratio-16-9 { aspect-ratio: 16 / 9; }
  .hero-slider-section .hero-slider-wrapper.hero-ratio-3-1  { aspect-ratio: 3 / 1; }
  .hero-slider-section .hero-slider-wrapper.hero-ratio-4-3  { aspect-ratio: 4 / 3; }
  .hero-slider-section .hero-slider-wrapper.hero-ratio-1-1  { aspect-ratio: 1 / 1; }
  .hero-slider-section .hero-slider-wrapper.hero-ratio-3-4  { aspect-ratio: 3 / 4; }
  .hero-slider-section .hero-slider-wrapper:not(.hero-ratio-original) {
    height: auto;
    min-height: 0;
    max-height: none;
  }
}

.hero-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s;
  display: flex;
  overflow: hidden;
  z-index: 1;
}

[dir="rtl"] .hero-slide {
  transform: translateX(-100%);
}

.hero-slide.is-active {
  transform: translateX(0);
  visibility: visible;
  z-index: 2;
}

/* Prevent initial slide-in animation on page load (removed by JS after init) */
.hero-slide.hero-no-transition {
  transition: none !important;
  transform: translateX(0);
  visibility: visible;
}

.hero-slide.is-exiting {
  transform: translateX(-100%);
  visibility: visible;
  z-index: 1;
}

[dir="rtl"] .hero-slide.is-exiting {
  transform: translateX(100%);
}

/* Backward navigation: old slide exits back toward the trailing edge it came from */
.hero-slide.is-exiting-prev {
  transform: translateX(100%);
  visibility: visible;
  z-index: 1;
}

[dir="rtl"] .hero-slide.is-exiting-prev {
  transform: translateX(-100%);
}

/* Backward navigation: snap new slide to the leading edge (no transition) before animating it to center */
.hero-slide.is-entering-prev {
  transform: translateX(-100%);
  visibility: visible;
  transition: none !important;
  z-index: 2;
}

[dir="rtl"] .hero-slide.is-entering-prev {
  transform: translateX(100%);
}

/* Used by cleanup to snap an exited slide back to its idle position without animating across the viewport */
.hero-slide.hero-snap {
  transition: none !important;
}

/* Background Media */
.hero-media-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--color-bg);
}

/* Raster slides: fill the band edge-to-edge (crop overflow). Video embeds stay cover-filled. */
.hero-media-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.hero-media-bg video,
.hero-media-bg iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.hero-media-bg iframe {
  transform: scale(1.5);
}

.hero-video-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(10, 10, 10, 0.35);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  pointer-events: none;
}

.hero-video-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.hero-video-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: hero-video-spin 0.8s linear infinite;
}

@keyframes hero-video-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video-spinner {
    animation-duration: 1.6s;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Content Layout */
.hero-slide-content-wrapper {
  position: relative;
  z-index: 35;
  width: 100%;
  height: 100%;
  display: flex;
  padding: clamp(2rem, 5vw, 4rem);
  pointer-events: none;
}

/* Settings-driven positions */
.hero-pos-middle-center { justify-content: center; align-items: center; text-align: center; }
.hero-pos-middle-left { justify-content: flex-start; align-items: center; text-align: left; }
.hero-pos-middle-right { justify-content: flex-end; align-items: center; text-align: right; }
.hero-pos-bottom-center { justify-content: center; align-items: flex-end; text-align: center; padding-bottom: 4rem; }
.hero-pos-bottom-left { justify-content: flex-start; align-items: flex-end; text-align: left; padding-bottom: 4rem; }
.hero-pos-bottom-right { justify-content: flex-end; align-items: flex-end; text-align: right; padding-bottom: 4rem; }

[dir="rtl"] .hero-pos-middle-left { text-align: right; }
[dir="rtl"] .hero-pos-middle-right { text-align: left; }
[dir="rtl"] .hero-pos-bottom-left { text-align: right; }
[dir="rtl"] .hero-pos-bottom-right { text-align: left; }

.hero-content-inner {
  max-width: 800px;
  width: 100%;
  pointer-events: auto;
}

.hero-slide-title {
  margin: 0 0 1rem;
  line-height: 1.2;
}
.hero-slide-subtitle {
  margin: 0 0 2rem;
  line-height: 1.5;
}

/* Text sizes desktop */
.hero-title-sm { font-size: clamp(1.5rem, 3vw, 2rem); }
.hero-title-md { font-size: clamp(2rem, 4vw, 3rem); }
.hero-title-lg { font-size: clamp(2.5rem, 5vw, 4rem); }
.hero-title-xl { font-size: clamp(3rem, 6vw, 5rem); }

.hero-sub-sm { font-size: clamp(0.875rem, 2vw, 1rem); }
.hero-sub-md { font-size: clamp(1rem, 2vw, 1.25rem); }
.hero-sub-lg { font-size: clamp(1.25rem, 3vw, 1.5rem); }

.hero-btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-pos-middle-center .hero-btn-group,
.hero-pos-bottom-center .hero-btn-group {
  justify-content: center;
}

/* Video Controls */
.hero-video-controls {
  position: absolute;
  z-index: 40;
  display: flex;
  gap: 0.5rem;
}
.hero-video-controls.pos-bottom-left { bottom: 2rem; left: 2rem; }
.hero-video-controls.pos-bottom-right { bottom: 2rem; right: 2rem; }
.hero-video-controls.pos-bottom-center { bottom: 2rem; left: 50%; transform: translateX(-50%); }
.hero-video-controls.pos-with-content { position: relative; bottom: auto; left: auto; right: auto; transform: none; display: inline-flex; margin-top: 1.5rem; }

/* Lift bottom-anchored controls above the pagination indicator so they don't overlap it */
.hero-has-pagination .hero-video-controls.pos-bottom-left,
.hero-has-pagination .hero-video-controls.pos-bottom-right,
.hero-has-pagination .hero-video-controls.pos-bottom-center { bottom: 3.75rem; }

.hero-vc-btn {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.3s;
}
.hero-vc-btn:hover { background: rgba(0,0,0,0.8); transform: scale(1.05); }

/* Arrows & Dots */
.hero-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.3s;
}
.hero-nav-arrow:hover { background: rgba(255,255,255,0.4); backdrop-filter: blur(4px); }
.hero-nav-prev { left: 1.5rem; }
.hero-nav-next { right: 1.5rem; }
[dir="rtl"] .hero-nav-prev { left: auto; right: 1.5rem; transform: translateY(-50%) rotate(180deg); }
[dir="rtl"] .hero-nav-next { right: auto; left: 1.5rem; transform: translateY(-50%) rotate(180deg); }

.hero-nav-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.hero-dot.is-active {
  background: #ffffff;
  transform: scale(1.3);
  border-color: rgba(255,255,255,0.8);
}

.hero-dot-fill {
  display: none;
}

/* Lines: short bars, active one widens */
.hero-nav-dots--lines {
  gap: 8px;
}
.hero-nav-dots--lines .hero-dot {
  width: 24px;
  height: 4px;
  border-radius: 4px;
  border: 0;
  background: rgba(255,255,255,0.4);
}
.hero-nav-dots--lines .hero-dot.is-active {
  width: 40px;
  background: #ffffff;
  transform: none;
}

/* Story: progress bars that fill with the autoplay timer */
.hero-nav-dots--story {
  gap: 6px;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}
.hero-nav-dots--story li {
  flex: 1 1 0;
  max-width: 70px;
}
.hero-nav-dots--story .hero-dot {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  border: 0;
  background: rgba(255,255,255,0.35);
  overflow: hidden;
  transition: none;
}
.hero-nav-dots--story .hero-dot.is-active {
  background: rgba(255,255,255,0.35);
  transform: none;
}
.hero-nav-dots--story .hero-dot-fill {
  display: block;
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background: #ffffff;
  border-radius: inherit;
}

/* Numbers: "01 / 05" counter */
.hero-nav-numbers {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  font-size: 14px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.hero-nav-numbers .js-h-num-current {
  font-size: 16px;
  font-weight: 700;
}
.hero-nav-numbers-sep {
  opacity: 0.6;
}

/* Countdown */
.hero-countdown {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}
.hero-pos-middle-center .hero-countdown,
.hero-pos-bottom-center .hero-countdown {
  justify-content: center;
}
.hero-countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  min-width: 65px;
}
.hero-countdown-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.hero-countdown-label { font-size: 0.65rem; text-transform: uppercase; margin-top: 4px; letter-spacing: 0.05em; }

/* Mobile CSS */
@media (max-width: 768px) {
  .hero-slider-wrapper:not(.hero--natural-image-height) {
    min-height: calc(360px - var(--header-hero-offset, 0px));
    height: calc(100vh - var(--header-hero-offset, 0px));
    height: calc(100svh - var(--header-hero-offset, 0px));
  }

  /* Fixed aspect ratios (mobile). Overrides the viewport band above. */
  .hero-slider-section .hero-slider-wrapper.hero-mob-ratio-16-9 { aspect-ratio: 16 / 9; }
  .hero-slider-section .hero-slider-wrapper.hero-mob-ratio-4-3  { aspect-ratio: 4 / 3; }
  .hero-slider-section .hero-slider-wrapper.hero-mob-ratio-1-1  { aspect-ratio: 1 / 1; }
  .hero-slider-section .hero-slider-wrapper.hero-mob-ratio-3-4  { aspect-ratio: 3 / 4; }
  .hero-slider-section .hero-slider-wrapper:not(.hero-mob-ratio-original) {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .hero-media-desktop-only { display: none; }
  .hero-media-mobile-only { display: block; }
  
  .hero-slide-content-wrapper { padding: 2rem; }
  
  /* Text Sizes Mobile override */
  .hero-title-mob-sm { font-size: clamp(1.25rem, 5vw, 1.5rem); }
  .hero-title-mob-md { font-size: clamp(1.5rem, 6vw, 2rem); }
  .hero-title-mob-lg { font-size: clamp(2rem, 8vw, 2.5rem); }
  .hero-title-mob-xl { font-size: clamp(2.5rem, 10vw, 3.25rem); }
  
  .hero-sub-mob-sm { font-size: clamp(0.75rem, 3vw, 0.875rem); }
  .hero-sub-mob-md { font-size: clamp(0.875rem, 4vw, 1rem); }
  .hero-sub-mob-lg { font-size: clamp(1rem, 5vw, 1.25rem); }

  /* Mobile positioning overrides */
  .hero-mob-pos-middle-center { justify-content: center; align-items: center; text-align: center; padding-bottom: 2rem; }
  .hero-mob-pos-bottom-center { justify-content: center; align-items: flex-end; text-align: center; padding-bottom: 3rem; }
  
  .hero-mob-pos-middle-center .hero-btn-group,
  .hero-mob-pos-bottom-center .hero-btn-group { justify-content: center; width: 100%; }
  .hero-btn-group .btn { width: auto; max-width: 100%; text-align: center; justify-content: center; }

  .hero-nav-arrow { display: none; /* Hide arrows on mobile mostly, let dots handle it, or swipe if added */ }
}

@media (min-width: 769px) {
  .hero-media-mobile-only { display: none !important; }
}

.hero-slide-link {
  position: absolute;
  inset: 0;
  z-index: 30;
  cursor: pointer;
}
