/* ---------------------------------------------------------------------------
   Werkwijze als scrollverhaal (werkwijze-scroll.njk + werkwijze.js), naar het
   voorbeeld van "Vraagstukken" op de site van Student Consultant.
   Links een podium dat met position: sticky blijft staan; rechts de stappen.
   Het script zet data-actief="<index>" op het vlak; dat bepaalt welke foto
   zichtbaar is. Geen overflow: hidden op het vlak of een ouder (dan plakt
   niets); het vlak gebruikt clip. Zonder JavaScript staat alles gewoon
   onder elkaar en is alles leesbaar.
   --------------------------------------------------------------------------- */

.sc-ww-sectie {
  --sc-primary: #1b2246;
  --sc-accent: #56cfbd;
  --sc-max: 1680px;
  --sc-gutter: clamp(20px, 5.4vw, 96px);

  padding: clamp(24px, 3vw, 48px) 0 clamp(56px, 7vw, 110px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sc-ww-sectie *,
.sc-ww-sectie *::before,
.sc-ww-sectie *::after {
  box-sizing: border-box;
}

.sc-ww {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: clamp(56px, 7vw, 110px) max(var(--sc-gutter), calc((100% - var(--sc-max)) / 2 + var(--sc-gutter)));
  border-radius: 34px;
  background: #f4fbf8;
  color: var(--sc-primary);
}

/* Licht vlak (in de lichte tint van de site), zodat het afsteekt tegen de
   donkere kop erboven; een zacht stippenpatroon in donkerblauw. */
.sc-ww::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(27, 34, 70, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.35;
  pointer-events: none;
}

.sc-ww-inner {
  position: relative;
}

.sc-ww-titel {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.sc-ww-raster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(48px, 6vw, 112px);
  margin-top: clamp(24px, 3vw, 40px);
}

/* Direct onder de paginakop (zoals op "Hoe wij werken"): één doorlopend
   vlak. Het lichte vlak schuift onder de schuine onderrand van de kop
   (die ligt ~7vw lager aan de linkerkant, zie page-hero.css), zodat er geen
   wit tussen de kop en het verhaal overblijft. */
main > .sc-ww-sectie:first-child {
  position: relative;
  z-index: 0;
  margin-top: calc(-7vw - 40px);
  padding-top: 0;
}

main > .sc-ww-sectie:first-child .sc-ww {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding-top: calc(7vw + 40px + clamp(24px, 3vw, 48px));
}

.sc-page-hero:has(+ main > .sc-ww-sectie:first-child) {
  z-index: 1;
}

/* --- Podium: de foto van de actieve stap ---------------------------------- */
.sc-ww-podium {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: 100svh;
  min-height: 600px;
}

.sc-ww-beelden {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  max-height: calc(100svh - 120px);
}

.sc-ww-beeld {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 500ms ease, transform 500ms ease;
}

.sc-ww-beeld img,
.sc-ww-stapbeeld img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 34px;
  box-shadow: 0 24px 60px rgba(27, 34, 70, 0.16);
  background: #e8f1ef;
}

/* Kaartje op de foto, linksonder (zoals bij het voorstelblok). */
.sc-ww-kaart {
  position: absolute;
  left: clamp(16px, 2vw, 28px);
  bottom: clamp(16px, 2vw, 28px);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 2 * clamp(16px, 2vw, 28px));
  padding: 14px 20px 14px 14px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(27, 34, 70, 0.22);
  color: var(--sc-primary);
}

.sc-ww-kaart strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sc-ww-kaart strong + span {
  display: block;
  margin-top: 2px;
  color: #5c6b7d;
  font-size: 0.86rem;
  line-height: 1.35;
}

.sc-ww-icoon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--sc-accent);
}

.sc-ww-icoon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--sc-primary);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Welke foto zichtbaar is, volgt uit data-actief op het vlak (tot 8 stappen). */
.sc-ww[data-actief="0"] [data-ww-beeld="0"],
.sc-ww[data-actief="1"] [data-ww-beeld="1"],
.sc-ww[data-actief="2"] [data-ww-beeld="2"],
.sc-ww[data-actief="3"] [data-ww-beeld="3"],
.sc-ww[data-actief="4"] [data-ww-beeld="4"],
.sc-ww[data-actief="5"] [data-ww-beeld="5"],
.sc-ww[data-actief="6"] [data-ww-beeld="6"],
.sc-ww[data-actief="7"] [data-ww-beeld="7"] {
  opacity: 1;
  transform: none;
}

/* --- Stappen langs een lijn die zich vult -------------------------------- */
.sc-ww-stappen {
  position: relative;
  padding-left: 72px;
}

.sc-ww-lijn {
  position: absolute;
  left: 17px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: rgba(27, 34, 70, 0.12);
}

.sc-ww-lijn span {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--sc-accent);
  transform-origin: top;
  transform: scaleY(var(--voortgang, 0));
}

/* Boven en onder ruimte, zodat het midden van de eerste (en laatste) stap
   gelijk ligt met het midden van de foto. */
.sc-ww-lijst {
  --sc-ww-stap: min(72svh, 640px);
  --sc-ww-uitlijn: calc((max(100svh, 600px) - var(--sc-ww-stap)) / 2);
  margin: 0;
  padding: var(--sc-ww-uitlijn) 0;
  list-style: none;
}

.sc-ww-stap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--sc-ww-stap);
  opacity: 0.35;
  transition: opacity 500ms ease;
}

.sc-ww-stap.is-actief {
  opacity: 1;
}

.sc-ww-stip {
  position: absolute;
  left: -72px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(27, 34, 70, 0.16);
  color: var(--sc-primary);
  font-size: 0.9rem;
  font-weight: 800;
  transition: background-color 300ms ease, box-shadow 300ms ease, color 300ms ease;
}

.sc-ww-stap.is-actief .sc-ww-stip {
  background: var(--sc-accent);
  box-shadow: 0 0 0 7px rgba(86, 207, 189, 0.22);
  color: var(--sc-primary);
}

.sc-ww-inhoud {
  padding: 24px 0;
}

.sc-ww-inhoud h3 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.sc-ww-inhoud p {
  max-width: 56ch;
  margin: 0;
  color: #5c6b7d;
  font-size: clamp(1.02rem, 1.15vw, 1.12rem);
  line-height: 1.7;
  font-weight: 450;
}

/* Foto per stap: alleen op mobiel (op desktop staat hij op het podium). */
.sc-ww-stapbeeld {
  display: none;
}

/* Zonder JavaScript: alle stappen volledig zichtbaar, geen lijn. */
.sc-ww:not(.is-js) .sc-ww-stap {
  opacity: 1;
}

.sc-ww:not(.is-js) .sc-ww-lijn span {
  display: none;
}

/* --- Mobiel en tablet: geen podium, elke stap een kaart met foto --------- */
@media (max-width: 880px) {
  .sc-ww {
    border-radius: 26px;
    padding-bottom: 88px;
  }

  .sc-ww-raster {
    display: block;
  }

  .sc-ww-podium,
  .sc-ww-lijn {
    display: none;
  }

  .sc-ww-stappen {
    padding-left: 0;
  }

  .sc-ww-lijst {
    display: grid;
    gap: 18px;
    padding: 0;
  }

  .sc-ww-stap {
    display: block;
    min-height: 0;
    opacity: 1;
  }

  .sc-ww-inhoud {
    padding: 14px 14px 22px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(27, 34, 70, 0.07);
  }

  /* geen stippen: de kaarten staan in volgorde onder elkaar */
  .sc-ww-stip {
    display: none;
  }

  .sc-ww-stapbeeld {
    position: relative;
    display: block;
    margin: 0 0 18px;
    aspect-ratio: 16 / 10;
  }

  .sc-ww-stapbeeld img {
    border-radius: 20px;
    box-shadow: none;
  }

  .sc-ww-stapbeeld .sc-ww-kaart {
    left: 10px;
    bottom: 10px;
    padding: 10px 14px 10px 10px;
    gap: 10px;
  }

  .sc-ww-stapbeeld .sc-ww-icoon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .sc-ww-stapbeeld .sc-ww-kaart strong {
    font-size: 0.9rem;
  }

  .sc-ww-stapbeeld .sc-ww-kaart strong + span {
    display: none;
  }

  .sc-ww-inhoud h3,
  .sc-ww-inhoud p {
    margin-inline: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-ww-beeld,
  .sc-ww-stap,
  .sc-ww-stip {
    transition: none;
  }

  .sc-ww-beeld {
    transform: none;
  }
}

/* Gevolgd door het voorstelblok (zoals op "Hoe wij werken"): het lichte vlak
   loopt zonder wit door tot het donkerblauwe voorstelblok, ook achter de
   afgeronde bovenhoeken daarvan. */
.sc-ww-sectie:has(+ .sc-voorstel-sectie) {
  padding-bottom: 0;
}

.sc-ww-sectie:has(+ .sc-voorstel-sectie) .sc-ww {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.sc-ww-sectie + .sc-voorstel-sectie {
  padding-top: 0;
  background: #f4fbf8;
}

/* Gevolgd door een licht getint vlak (zoals de cases op "Gratis
   projectvoorstel"): de twee lopen zonder witte strook in elkaar over. */
.sc-ww-sectie:has(+ .sc-section-tint) {
  padding-bottom: 0;
}

.sc-ww-sectie:has(+ .sc-section-tint) .sc-ww {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.sc-ww-sectie + .sc-section-tint {
  padding-top: clamp(8px, 1vw, 16px);
}
