:root {
  --carousel-duration: 4s;
}

.hero-carousel-section {
  position: relative;
  width: 100%;
  height: 95vh; /* Increased from 700px to fit the image proportions better */
  min-height: 800px; /* Ensures it doesn't get too small on laptops */
  overflow: hidden;
  background-color: #000;
  display: flex;
  flex-direction: column;
  /* Push it slightly above content but sit below primary transparent header. 
     Wait, primary header is pos absolute top 0. */
  margin-top: 0;
}

.carousel-images-container {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
  background-size: cover;
  background-position: right center; /* Align to the right to prevent cutting off the focal elements */
  background-repeat: no-repeat;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.carousel-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 35%, rgba(0,0,0,0) 65%),
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(to right, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 85%, #050b14 100%),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(5,11,20,0.85) 100%);
}

.carousel-content {
  position: relative;
  z-index: 3;
  width: calc(100% - 32px);
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center; /* Vertically centered like the image */
  padding: 0;
}

.content-block {
  max-width: 750px; /* Give it more room for the headline */
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  transition-delay: 0.2s; /* wait for crossfade slightly */
}

.carousel-slide.active .content-block {
  opacity: 1;
  transform: translateY(0);
}

.content-block .eyebrow {
  display: none; /* Hidden to match the clean image feel */
}

.content-block .headline {
  font-family: 'Outfit', sans-serif;
  font-size: 48px; /* Larger, more prominent */
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
  margin-top: 0;
  letter-spacing: -0.02em;
}

.content-block .description {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: #fff; /* Solid white like image */
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 32px;
  font-weight: 400;
}

.content-block .cta-link {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse; /* Icon on the left */
  justify-content: flex-end;
  background-color: #fff;
  color: #1b1564; /* Strong blue for text and icon */
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  gap: 12px;
  padding: 14px 32px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.content-block .cta-link:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Nav Strip */
.carousel-nav-strip-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: calc(100% - 32px);
  max-width: 1320px;
  margin: 0 auto;
  z-index: 10;
  display: flex;
  align-items: flex-start; /* Align tops so the lines are perfectly horizontal */
  justify-content: space-between;
  gap: 32px;
  padding: 0 0 40px;
  box-sizing: border-box;
}

.carousel-nav-strip {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 24px;
  /* On desktop, no overflow so it evenly divides the full width */
}

.nav-card {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 0 32px 0 0; /* Add right padding so the active line stops before the next item */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start; /* Force left alignment */
  text-align: left; /* Force text left */
  gap: 12px; /* Tighter gap matching the reference */
  scroll-snap-align: start;
}
.nav-card:hover {
  color: #fff;
}
.nav-card.active {
  color: #fff;
}

.nav-card .card-text {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  height: calc(14px * 1.5 * 2); /* Lock to exactly 2 lines height for all cards */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Progress bar */
.progress-bar-container {
  position: relative;
  width: 28px; /* Slightly wider inactive bar for better presence */
  height: 3px; /* Increased thickness */
  background: #fff;
  opacity: 0.5;
  border-radius: 3px;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.nav-card.active .progress-bar-container {
  width: 100%;
  opacity: 1; /* Bright white when active */
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: #1fa8df; /* Use the brand blue for active progress */
  border-radius: 2px;
}

/* Pause button */
.carousel-pause-btn {
  background: transparent;
  border: 1.5px solid #fff; 
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px; 
  transition: all 0.3s ease;
  flex: 0 0 auto;
  margin-top: -12px; /* Align perfectly with line */
}
.carousel-pause-btn:hover {
  background: rgba(255,255,255,0.2);
}

.nav-card.animating .progress-bar {
  animation: progress var(--carousel-duration) linear forwards;
}
.hero-carousel-section.paused .nav-card.animating .progress-bar {
  animation-play-state: paused;
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* Responsive */
@media (max-width: 1024px) {
  .content-block .headline {
    font-size: 32px;
  }
  .carousel-nav-strip-wrapper {
    padding: 0 4% 16px;
  }
  .carousel-nav-strip {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    gap: 16px !important;
    width: 100% !important;
  }
  .carousel-nav-strip::-webkit-scrollbar {
    display: none !important;
  }
  .nav-card {
    flex: 0 0 calc(50% - 8px) !important;
    width: calc(50% - 8px) !important;
    min-width: calc(50% - 8px) !important;
    max-width: calc(50% - 8px) !important;
    scroll-snap-align: start !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 768px) {
  .hero-carousel-section {
    height: 100svh !important;
    min-height: 580px !important;
    max-height: 900px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .carousel-images-container {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
  .carousel-slide {
    background-size: cover !important;
    background-position: right center !important;
    background-repeat: no-repeat !important;
  }
  .carousel-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 35%, rgba(0, 0, 0, 0.5) 75%, rgba(5, 11, 20, 0.95) 100%) !important;
  }
  .hero-carousel-section .carousel-content.container {
    padding: 90px 6% 110px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    text-align: left !important;
    height: 100% !important;
    box-sizing: border-box !important;
  }
  .carousel-nav-strip-wrapper {
    padding: 0 4% 16px !important;
    gap: 12px !important;
    bottom: 0 !important;
  }
  .nav-card {
    flex: 0 0 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    min-width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
    scroll-snap-align: start !important;
    padding-right: 8px !important;
  }
  .nav-card .card-text {
    font-size: 12px !important;
    line-height: 1.35 !important;
    height: 2.7em !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .content-block {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .content-block .headline {
    font-size: clamp(1.55rem, 6vw, 2.1rem) !important;
    margin-bottom: 12px !important;
    line-height: 1.2 !important;
  }
  .content-block .description {
    font-size: 14px !important;
    line-height: 1.55 !important;
    margin-bottom: 22px !important;
    -webkit-line-clamp: 3 !important;
  }
  .content-block .cta-link {
    padding: 12px 26px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .nav-card {
    flex: 0 0 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    min-width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }
  .nav-card .card-text {
    font-size: 11px !important;
  }
  .content-block .headline {
    font-size: 1.45rem !important;
  }
  .content-block .description {
    font-size: 13.5px !important;
    -webkit-line-clamp: 3 !important;
  }
}

