/* ==========================================================================
   Key Challenges — carousel (custom, non-Webflow)
   Flat / angular to match the rest of the site: no rounded corners,
   flat line icons only, no card hover effects.
   ========================================================================== */

.chal-wrapper {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.chal-carousel {
  position: relative;
  padding: 0 8px;
}

/* Viewport — the scrollable window */
.chal-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  cursor: grab;
}
.chal-viewport::-webkit-scrollbar {
  display: none;
}
.chal-viewport.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}
.chal-viewport.is-dragging * {
  cursor: grabbing;
  user-select: none;
  pointer-events: none;
}

/* Track — override Webflow grid, become a flex row */
.services-grid-list.chal-track {
  display: flex;
  grid-template-columns: none;
  grid-template-rows: none;
  gap: 20px;
  align-items: stretch;
}

/* Cards — 3 up on desktop, flat & square like the original */
.chal-track > .services-card-body.white {
  flex: 0 0 calc((100% - 40px) / 3);
  scroll-snap-align: start;
  box-sizing: border-box;
  border: 1px solid var(--card-border);
  border-radius: 0;
  padding: 30px 28px;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
}

.chal-track > .services-card-body.white > div {
  width: 100%;
  align-items: flex-start;
  text-align: left;
}

/* Card text stays left-aligned (cards use .centered helpers internally) */
.chal-track .services-card-body h4.centered,
.chal-track .services-card-body p.centered {
  text-align: left;
}
.chal-track .services-card-body h4 {
  margin-bottom: 10px;
}

/* Flat, angular line icons — same stroke language as the carousel arrows */
.chal-icon {
  color: var(--secondary);
  margin-bottom: 16px;
  line-height: 0;
}
.chal-icon svg {
  width: 34px;
  height: 34px;
  display: block;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* Arrows — square, mirroring the site's .button behaviour */
.chal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 0;
  border: 1px solid var(--card-border);
  background: var(--primary);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.chal-arrow:hover {
  background: #b5ccdd;
}
.chal-arrow svg {
  width: 22px;
  height: 22px;
}
.chal-prev {
  left: -23px;
}
.chal-next {
  right: -23px;
}
.chal-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Dots — square */
.chal-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.chal-dot {
  width: 10px;
  height: 10px;
  border-radius: 0;
  border: none;
  padding: 0;
  background: var(--primary);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s ease, width 0.2s ease, background 0.2s ease;
}
.chal-dots .chal-dot.is-active {
  opacity: 1;
  width: 28px;
  background: var(--secondary);
}

/* CTA below carousel */
.chal-cta {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

/* ==========================================================================
   Shared button variants — align stray buttons with the site's signature
   arrow button (.hero-flex-block + .button-text + .hero-icon).
   ========================================================================== */

/* Natural width instead of the fixed 180px / full-width bar */
.button.btn-auto {
  width: auto;
  min-width: 0;
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}


/* ---- Tablet: 2 up ---- */
@media screen and (max-width: 991px) {
  .chal-track > .services-card-body.white {
    flex: 0 0 calc((100% - 20px) / 2);
  }
  .chal-prev {
    left: -10px;
  }
  .chal-next {
    right: -10px;
  }
}

/* ---- Mobile: 1 up, hide arrows (swipe instead) ---- */
@media screen and (max-width: 767px) {
  .services-grid-list.chal-track {
    gap: 14px;
  }
  .chal-track > .services-card-body.white {
    flex: 0 0 88%;
  }
  .chal-arrow {
    display: none;
  }
  .chal-carousel {
    padding: 0;
  }
}
