/* ===== JBA HERO ATC-STYLE SLIDER CSS ===== */
/* Namespace: .jba-hero - All styles scoped to prevent conflicts */

.jba-hero {
  position: relative;
  min-height: clamp(720px, 85svh, 1000px);
  margin-bottom: -1px; /* bleed 1px anti hairline */
  padding-bottom: 1px; /* counter bleed */
  isolation: isolate;
  overflow: hidden; /* prevent horizontal scroll */
  width: 100%;
  
  /* CSS Variables for easy tuning */
  --fade-ms: 1400ms;
  --hold-ms: 5200ms;
  --card-delay: 350ms;
  
  /* Performance optimizations */
  contain: layout style paint;
  will-change: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Slides container */
.jba-hero__slides {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

/* Individual slide - background cross-fade layer */
.jba-hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateZ(0);
  will-change: opacity, transform;
  transition: opacity var(--fade-ms) ease;
  pointer-events: none;
  z-index: 1;
  
  /* Performance optimizations */
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.jba-hero__slide.is-active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

/* Optional overlay for better text readability */
.jba-hero__slide .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.35));
  mix-blend-mode: multiply;
  z-index: 1;
}

/* Hero card - delayed fade animation */
.jba-hero__card {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity   calc(var(--fade-ms) * .75) ease,
    transform calc(var(--fade-ms) * .75) ease;
  transition-delay: var(--card-delay);
  will-change: opacity, transform;
  
  /* Ensure card is positioned correctly */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(20px, 4vw, 40px);
  
  /* Glass morphism effect */
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  
  /* Responsive sizing */
  width: min(90vw, 600px);
  max-width: 600px;
  min-height: clamp(320px, 40vh, 480px);
  height: auto;
  
  /* Center positioning */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(10px);
}

.jba-hero__slide.is-active .jba-hero__card.card-show {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

/* Navigation dots */
.jba-hero__dots {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3svh, 26px);
  transform: translateX(-50%);
  display: flex;
  gap: clamp(6px, 1vw, 10px);
  z-index: 3;
  
  /* Responsive visibility */
  opacity: 1;
  transition: opacity 0.3s ease;
  
  /* Responsive wrapping for many dots */
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 20px;
}

.jba-hero__dot {
  width: clamp(8px, 1.2vw, 10px);
  height: clamp(8px, 1.2vw, 10px);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,0,0,.1);
  cursor: pointer;
  transition: transform .2s, background .2s;
  
  /* Touch-friendly sizing */
  min-width: 8px;
  min-height: 8px;
  
  /* Ensure clickable area */
  padding: 2px;
  margin: 1px;
}

.jba-hero__dot.is-active {
  background: #fff;
  transform: scale(1.3);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.jba-hero__dot:hover {
  background: rgba(255,255,255,.8);
  transform: scale(1.15);
}

/* Navigation arrows */
.jba-hero__prev,
.jba-hero__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 1;
  
  /* Remove default button styles */
  border: none;
  outline: none;
  
  /* Touch optimization */
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.jba-hero__prev {
  left: 20px;
}

.jba-hero__next {
  right: 20px;
}

.jba-hero__prev:hover,
.jba-hero__next:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.jba-hero__prev:active,
.jba-hero__next:active {
  transform: translateY(-50%) scale(0.95);
  background: rgba(255, 255, 255, 1);
}

/* Arrow icons */
.jba-hero__prev::before {
  content: '‹';
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.jba-hero__next::before {
  content: '›';
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

/* Anti overscroll and vh rounding fixes */
.jba-hero,
.jba-hero__slides {
  width: 100%;
  overflow-x: clip;
}

/* Content styling - inherit from existing hero-card styles */
.jba-hero__card .hero-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  margin-bottom: clamp(20px, 3vw, 28px);
}

.jba-hero__card .hero-logo {
  width: clamp(120px, 20vw, 200px);
  height: auto;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.jba-hero__card .hero-title-image {
  width: clamp(280px, 70vw, 450px);
  height: auto;
  max-width: 450px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.jba-hero__card .hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 clamp(12px, 2vw, 20px) 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jba-hero__card .hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #4a5568;
  margin: 0 0 clamp(24px, 4vw, 32px) 0;
  line-height: 1.6;
  font-weight: 400;
}

.jba-hero__card .hero-actions {
  display: flex;
  gap: clamp(12px, 3vw, 20px);
  justify-content: center;
  flex-wrap: wrap;
}

.jba-hero__card .hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vw, 16px) clamp(20px, 4vw, 32px);
  border-radius: 12px;
  font-weight: 600;
  font-size: clamp(0.875rem, 2vw, 1rem);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  min-width: 140px;
  text-align: center;
  
  /* Button styling */
  background: #1a76d1;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.jba-hero__card .hero-btn:hover {
  background: #155ba3;
  box-shadow: 0 8px 20px rgba(26, 118, 209, 0.3);
  transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .jba-hero {
    min-height: clamp(600px, 80svh, 800px);
  }
  
  .jba-hero__card {
    width: min(88vw, 480px);
    min-height: clamp(280px, 35vh, 380px);
    padding: clamp(18px, 3.5vw, 24px);
  }
  
  .jba-hero__prev,
  .jba-hero__next {
    width: 44px;
    height: 44px;
  }
  
  .jba-hero__prev {
    left: 16px;
  }
  
  .jba-hero__next {
    right: 16px;
  }
  
  .jba-hero__dots {
    bottom: clamp(12px, 2.5svh, 20px);
    gap: clamp(4px, 0.8vw, 8px);
    padding: 6px 12px;
    max-width: 95vw;
  }
  
  .jba-hero__dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
    padding: 1px;
  }
}

@media (max-width: 576px) {
  .jba-hero {
    min-height: clamp(500px, 75svh, 700px);
  }
  
  .jba-hero__card {
    width: min(85vw, 350px);
    min-height: clamp(260px, 32vh, 320px);
    padding: clamp(16px, 3vw, 20px);
  }
  
  .jba-hero__prev,
  .jba-hero__next {
    width: 40px;
    height: 40px;
  }
  
  .jba-hero__prev::before,
  .jba-hero__next::before {
    font-size: 20px;
  }
  
  .jba-hero__card .hero-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
  }
  
  .jba-hero__card .hero-subtitle {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  }
  
  .jba-hero__card .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .jba-hero__card .hero-btn {
    width: 100%;
    max-width: 280px;
    padding: 14px 24px;
  }
  
  .jba-hero__dots {
    gap: clamp(3px, 0.6vw, 6px);
    padding: 4px 8px;
    max-width: 98vw;
  }
  
  .jba-hero__dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    padding: 1px;
    margin: 0.5px;
  }
  
  .jba-hero__dot.is-active {
    transform: scale(1.2);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .jba-hero__slide,
  .jba-hero__card {
    transition: none !important;
    animation: none !important;
  }
  
  .jba-hero__card {
    opacity: 1 !important;
    transform: translate(-50%, -50%) translateY(0) !important;
  }
  
  .jba-hero__slide.is-active .jba-hero__card {
    opacity: 1 !important;
    transform: translate(-50%, -50%) translateY(0) !important;
  }
}

/* Ensure proper stacking and no conflicts with existing styles */
.jba-hero * {
  box-sizing: border-box;
}

/* Hide original hero-slider when jba-hero is active */
.jba-hero .hero-slider {
  display: none;
}
