/* ============================================================
   MWD-CAROUSEL.CSS  |  Reusable Horizontal Carousel
   MWeb Design V2
   Prefix: mwdcar-  (avoids collision with all other stylesheets)

   USAGE:
     <link rel="stylesheet" href="assets/css/mwd-carousel.css">
     <script src="assets/js/mwd-carousel.js" defer></script>

   Wrap any existing grid of cards:
     <div class="mwdcar-wrap">
       <div class="mwdcar-track" data-mwdcar-track>
         ...cards as .mwdcar-slide...
       </div>
       <button class="mwdcar-arrow mwdcar-arrow--prev" data-mwdcar-prev aria-label="Previous"><i class="fa-solid fa-chevron-left"></i></button>
       <button class="mwdcar-arrow mwdcar-arrow--next" data-mwdcar-next aria-label="Next"><i class="fa-solid fa-chevron-right"></i></button>
     </div>
     <div class="mwdcar-dots" data-mwdcar-dots></div>
   ============================================================ */

.mwdcar-wrap {
  position: relative;
  z-index: 1;
}

/* Track — horizontal scroll-snap row */
.mwdcar-track {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2.5vw, 24px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: -8px;
  /* Hide scrollbar visually, keep it usable */
  scrollbar-width: none;
}
.mwdcar-track::-webkit-scrollbar { display: none; }

/* Each slide — fixed-ish width so 1 / 2 / 3 show depending on viewport */
.mwdcar-slide {
  flex: 0 0 auto;
  width: min(360px, 86vw);
  scroll-snap-align: start;
}

/* Wider slide variant — for project cards with image */
.mwdcar-slide--lg {
  width: min(380px, 86vw);
}

@media (min-width: 640px) {
  .mwdcar-slide   { width: calc(50% - 12px); }
  .mwdcar-slide--lg { width: calc(50% - 12px); }
}
@media (min-width: 1024px) {
  .mwdcar-slide   { width: calc(33.333% - 16px); }
  .mwdcar-slide--lg { width: calc(33.333% - 16px); }
}

/* ── Arrows ──────────────────────────────────────────────── */
.mwdcar-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-white);
  border: 1.5px solid var(--clr-warm-200);
  color: var(--clr-black);
  cursor: pointer;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  z-index: 3;
  transition: background 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              opacity 0.2s ease;
}
.mwdcar-arrow:hover {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
  color: var(--clr-white);
  transform: translateY(-50%) scale(1.08);
}
.mwdcar-arrow--prev { left: -8px; }
.mwdcar-arrow--next { right: -8px; }
.mwdcar-arrow[disabled] { opacity: 0.35; pointer-events: none; }

/* Dark-section arrow variant (auto-applied inside .ct-section--dark) */
.ct-section--dark .mwdcar-arrow {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--clr-white);
}
.ct-section--dark .mwdcar-arrow:hover {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
}

@media (max-width: 1100px) {
  .mwdcar-arrow { display: none; } /* rely on swipe on smaller screens */
}

/* ── Dots ────────────────────────────────────────────────── */
.mwdcar-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(20px, 3vw, 32px);
}
.mwdcar-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--clr-warm-300);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}
.mwdcar-dot:hover { background: var(--clr-warm-400); }
.mwdcar-dot.is-active {
  background: var(--clr-accent);
  width: 22px;
  border-radius: 5px;
}
.ct-section--dark .mwdcar-dot { background: rgba(255,255,255,0.18); }
.ct-section--dark .mwdcar-dot:hover { background: rgba(255,255,255,0.32); }
.ct-section--dark .mwdcar-dot.is-active { background: var(--clr-accent-glow); }

/* ── "View All" CTA under a carousel ─────────────────────── */
.mwdcar-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(28px, 4vw, 40px);
  position: relative; z-index: 1;
}