/* --- Klantcases: automatisch doorlopende slider ---------------------------
   Loopt van rechts naar links, staat stil met de muis (of toetsenbord) erop.
   Gebruik: {% include "case-slider.njk" %}, gegevens in src/_data/cases.json.
   --------------------------------------------------------------------------- */

.sc-cases {
  position: relative;
}

.sc-cases-viewport {
  overflow: hidden;
  /* Ruimte voor de schaduw en het omhoogkomen van de kaarten. */
  padding: 10px 0 30px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.sc-cases-track {
  display: flex;
  width: max-content;
  animation: sc-cases-scroll var(--sc-cases-duur, 200s) linear infinite;
}

.sc-cases-viewport:hover .sc-cases-track,
.sc-cases-viewport:focus-within .sc-cases-track {
  animation-play-state: paused;
}

/* Met JavaScript neemt case-slider.js het doorschuiven over (dan kan er ook
   vooruit en terug geklikt worden); zonder JavaScript loopt de CSS-animatie. */
.sc-cases.is-js .sc-cases-track {
  animation: none;
  will-change: transform;
}

.sc-cases.is-js .sc-cases-viewport {
  touch-action: pan-y;
}

/* Vorige / volgende: ronde knoppen aan weerszijden, midden op de foto's. */
.sc-cases-knop {
  position: absolute;
  z-index: 2;
  top: calc(10px + 95px);
  display: none;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--sc-primary, #1b2246);
  box-shadow: 0 12px 30px rgba(27, 34, 70, 0.2);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 850;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.sc-cases.is-js .sc-cases-knop {
  display: grid;
}

.sc-cases-vorige {
  left: clamp(8px, 2vw, 28px);
}

.sc-cases-volgende {
  right: clamp(8px, 2vw, 28px);
}

.sc-cases-knop:hover,
.sc-cases-knop:focus-visible {
  background: var(--sc-accent, #56cfbd);
  outline: none;
}

.sc-cases-vorige:hover span,
.sc-cases-vorige:focus-visible span {
  transform: translateX(-4px);
}

.sc-cases-volgende:hover span,
.sc-cases-volgende:focus-visible span {
  transform: translateX(4px);
}

.sc-cases-knop span {
  display: block;
  line-height: 1;
  transition: transform 180ms ease;
}

.sc-cases-knop:focus-visible {
  box-shadow: 0 0 0 3px var(--sc-primary, #1b2246), 0 12px 30px rgba(27, 34, 70, 0.2);
}

.sc-cases-list {
  display: flex;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sc-cases-item {
  display: flex;
  flex-shrink: 0;
  width: 340px;
  margin-right: 22px;
}

.sc-cases-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(27, 34, 70, 0.1);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(27, 34, 70, 0.06);
  color: var(--sc-primary, #1b2246);
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.sc-cases-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e8f1ef;
  transition: transform 300ms ease;
}

.sc-cases-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px 24px;
  position: relative;
  background: #ffffff;
}

.sc-cases-body strong {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sc-cases-bedrijf {
  color: #0d7f70;
  font-size: 0.88rem;
  font-weight: 700;
}

.sc-cases-intro {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #5c6b7d;
  font-size: 0.93rem;
  line-height: 1.55;
}

.sc-cases-more {
  margin-top: auto;
  padding-top: 6px;
  color: #0d7f70;
  font-size: 0.95rem;
  font-weight: 800;
}

.sc-cases-more::after {
  content: "→";
  display: inline-block;
  margin-left: 0.3em;
  transition: transform 180ms ease;
}

.sc-cases-card:hover,
.sc-cases-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(86, 207, 189, 0.7);
  box-shadow: 0 18px 40px rgba(27, 34, 70, 0.12);
  outline: none;
}

.sc-cases-card:hover .sc-cases-img {
  transform: scale(1.04);
}

.sc-cases-card:focus-visible {
  box-shadow: 0 0 0 3px #56cfbd;
}

.sc-cases-card:hover .sc-cases-more::after,
.sc-cases-card:focus-visible .sc-cases-more::after {
  transform: translateX(4px);
}

@keyframes sc-cases-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .sc-cases-item {
    width: 280px;
    margin-right: 16px;
  }

  .sc-cases-card {
    border-radius: 20px;
  }

  .sc-cases-body {
    padding: 18px 20px 20px;
  }

  .sc-cases-knop {
    top: calc(10px + 79px);
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }
}

/* Wie minder beweging wil: geen animatie, maar een rij om zelf te scrollen. */
@media (prefers-reduced-motion: reduce) {
  .sc-cases:not(.is-js) .sc-cases-viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .sc-cases-track {
    animation: none;
  }

  .sc-cases:not(.is-js) .sc-cases-list[aria-hidden="true"],
  .sc-cases:not(.is-js) .sc-cases-item[aria-hidden="true"] {
    display: none;
  }

  .sc-cases-card,
  .sc-cases-img,
  .sc-cases-knop,
  .sc-cases-knop span,
  .sc-cases-more::after {
    transition: none;
  }
}

/* Kop boven de slider als vervolg op de rijen erboven (zelfde sectie). */
.sc-cases-head {
  margin-top: clamp(72px, 8vw, 120px);
}
