/* ==========================================================================
   Process Slider Component Stylesheet (Pure CSS Tabs)
   File: template-parts/components/process-slider.css
   ========================================================================== */

/* 1. Container & Input Reset
   -------------------------------------------------------------------------- */
.process-slider-container {
  max-width: 100%;
  margin: 0 auto;
  /* padding: 40px 20px;*/
  font-family: inherit;
  box-sizing: border-box;
}

/* Hide Radio Inputs completely */
.process-slider-container input[type="radio"].process-radio {
  display: none !important;
}

/* 2. Top Navigation Tabs
   -------------------------------------------------------------------------- */
.process-nav-wrapper {
  width: 100%;
  margin-bottom: 40px;
  border-bottom: 1px solid #e0e0e0;
}

.process-nav-wrapper {
  position: relative;
  --tab-width: 140px;
  --tab-gap: 16px;
  --arrow-space: 56px;
}

/* Base nav is always horizontally scrollable (drag/swipe fallback) and
   snaps cleanly to tab boundaries. Whether ARROW BUTTONS show is decided
   by JS at runtime based on whether the tabs actually overflow the
   container -- NOT by slide count -- so on a wide FullHD screen where
   all tabs fit, no arrows render (and there'd be nothing to scroll to
   anyway); on a narrower screen where tabs don't all fit, JS adds the
   .has-arrows class and the arrows appear and work. */
.process-nav {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--tab-gap);
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;

  /* Hide the native scrollbar track that was rendering as a visible bar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* old Edge/IE */
}

.process-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.process-nav-wrapper.has-arrows {
  overflow: hidden;
}

.process-nav-wrapper.has-arrows .process-nav {
  padding: 0 var(--arrow-space);
}

.process-tab-btn {
  scroll-snap-align: start;
}

.process-nav-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: #ffffff;
  color: #2c2c2c;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
}

.process-nav-wrapper.has-arrows .process-nav-arrow {
  display: flex;
}

.process-nav-arrow.left {
  left: 10px;
}

.process-nav-arrow.right {
  right: 10px;
}

.process-nav-arrow svg {
  width: 14px;
  height: 14px;
}

.process-tab-btn {
  flex: 1 1 var(--tab-width, 140px);
  min-width: var(--tab-width, 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 0 10px 20px 10px;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease;
}

/* Tab Icon */
.process-tab-btn .tab-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-tab-btn .tab-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Tab Label */
.process-tab-btn .tab-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #2c2c2c;
  width: 80%;
}

/* Red Indicator Line under Active Tab */
.process-tab-btn::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: #a81c1c;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.process-tab-btn:hover .tab-label {
  color: #a81c1c;
}

/* 3. Pure CSS State Switching Engine
   -------------------------------------------------------------------------- */
/* NOTE: The active-tab-underline and active-slide-display rules are now
   generated dynamically per-instance in process-slider.php, scoped to each
   slider's unique ID. This lets the switching CSS always match the real
   ACF row count instead of being capped at a fixed number of tabs. */

/* Hide all slides by default */
.process-slide {
  display: none;
}

/* 4. Overlapping Content Stage Layout
   -------------------------------------------------------------------------- */
.process-slides-stage {
  position: relative;
  width: 100%;
  margin-top: 20px;
}

.process-slide {
  display: none; /* Managed by radio switcher (inline <style> per instance) */
  position: relative;
  align-items: center;
  width: 100%;
  min-height: 480px;
}

/* Left Overlapping White Card */
.slide-card {
  position: relative;
  z-index: 2;
  width: 52%;
  background: #ffffff;
  padding: 45px;
  border-radius: 0px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  margin-right: -8%; /* Creates overlap over right image */
}

.slide-title {
  color: #2c2c2c;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 24px 0;
}

/* WYSIWYG Content Styling */
.slide-description {
  color: #4a4a4a;
  font-size: 17px;
  line-height: 1.65;
}

.slide-description p {
  margin: 0 0 14px 0;
}

.slide-description p:last-child {
  margin-bottom: 0;
}

.slide-description strong {
  color: #1a1a1a;
  font-weight: 600;
}

.slide-description a {
  color: #a81c1c;
  text-decoration: underline;
}

/* Right Side Image */
.slide-media {
  position: relative;
  z-index: 1;
  width: 56%;
  height: 100%;
  min-height: 480px;
  margin-left: auto;
  border-radius: 0px;
  overflow: hidden;
}

.slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet (< 992px) */
@media (max-width: 992px) {
  /* Reverse order on mobile: Image goes top, Text card goes bottom */
  .process-slide {
    flex-direction: column-reverse;
    min-height: auto;
  }

  .slide-card {
    width: 100%;
    margin-right: 0;
    margin-top: -30px; /* Slight vertical overlap over the bottom of the image */
    z-index: 2;
  }

  .slide-media {
    width: 100%;
    min-height: 320px;
  }
}

/* Mobile (< 640px) */
@media (max-width: 640px) {
  .slide-card {
    padding: 25px 20px;
    margin-top: -20px;
  }

  .slide-title {
    font-size: 22px;
  }

  .slide-media {
    min-height: 240px;
  }
}
