/* ==========================================================================
   Reclameworks · nieuw werk
   Slider met projecten. Items komen uit WordPress (Nieuw werk) en worden
   in rw-werk.js opgebouwd. Een project met URL krijgt een link.
   ========================================================================== */

.rw-werk {
  --off: var(--gut);
  position: relative;
  padding: clamp(80px, 8vw, 120px) 0 calc(clamp(96px, 9vw, 150px) + clamp(40px, 6vw, 110px));
  overflow: hidden;
  background: var(--rw-koolzwart);
}

/* Groot "werk" als outline op de achtergrond */
.rw-werk-giant {
  position: absolute;
  top: clamp(40px, 5vw, 80px);
  left: calc(var(--off) - .055em);
  color: transparent;
  -webkit-text-stroke: 1.5px #3a3a3a;
  font-family: var(--font-display);
  font-size: 34vw;
  line-height: .8;
  letter-spacing: -.06em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.rw-werk-head {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin: 0 var(--off);
}

.rw-werk-eyebrow {
  color: var(--rw-diepblauw);
}

.rw-werk-title {
  margin: 22px 0 0;
  color: var(--rw-zacht-grijs);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .9;
  letter-spacing: -.05em;
}

/* Vetgedrukt deel van de titel in wit */
.rw-werk-title b {
  color: #fff;
  font-weight: 400;
}

.rw-werk-intro {
  max-width: 46ch;
  margin: 28px 0 0;
  color: var(--rw-zacht-grijs);
  font-size: clamp(16px, 1.43vw, 20px);
  line-height: 1.55;
  letter-spacing: -.015em;
}

/* --------------------------------------------------------------------------
   Slider
   -------------------------------------------------------------------------- */

.rw-werk-stage {
  position: relative;
  z-index: 2;
  margin: clamp(48px, 6vw, 88px) 0 0 var(--off);
  overflow: hidden;
  outline: none;
}

.rw-werk-track {
  display: flex;
  gap: clamp(16px, 2.2vw, 36px);
  transition: transform 1.1s cubic-bezier(.76, 0, .24, 1);
  will-change: transform;
}

.rw-werk-slide {
  flex: 0 0 min(62vw, 900px);
  margin: 0;
  cursor: pointer;
}

.rw-werk-image {
  position: relative;
  display: block;
  aspect-ratio: 1484 / 920;
  overflow: hidden;
  background: #1d1d1d;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - clamp(36px, 4vw, 72px)), calc(100% - clamp(36px, 4vw, 72px)) 100%, 0 100%);
}

.rw-werk-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(.7) brightness(.55);
  transform: scale(1.08);
  transition: transform 1.6s var(--ease-out), filter .9s var(--ease-out);
}

.rw-werk-slide.is-active .rw-werk-image img {
  filter: none;
  transform: scale(1);
}

.rw-werk-slide figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 16px;
  opacity: .35;
  transition: opacity .6s var(--ease-out);
}

.rw-werk-slide.is-active figcaption {
  opacity: 1;
}

.rw-werk-name {
  color: #fff;
  font-weight: 500;
  font-size: clamp(15px, 1.15vw, 17px);
  letter-spacing: -.01em;
}

.rw-werk-label {
  color: var(--rw-diepblauw);
}

/* Link naar het project (alleen als er een URL is ingevuld) */
.rw-werk-link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-left: auto;
  color: var(--rw-warm-wit);
  text-decoration: none;
  transition: color var(--dur-fast);
}

.rw-werk-link i {
  font-style: normal;
  color: var(--rw-diepblauw);
  transition: transform var(--dur-fast) var(--ease-out);
}

.rw-werk-link:hover {
  color: #fff;
}

.rw-werk-link:hover i {
  transform: translate(2px, -2px);
}

.rw-werk-slide:not(.is-active) .rw-werk-link {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Teller, voortgang en pijlen
   -------------------------------------------------------------------------- */

.rw-werk-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: 28px var(--off) 0;
}

.rw-werk-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--rw-zacht-grijs);
}

.rw-werk-controls .rw-arrow-btn {
  background: #333;
}

.rw-werk-progress {
  position: relative;
  width: clamp(96px, 12vw, 180px);
  height: 2px;
  overflow: hidden;
  background: #4a4a4a;
}

.rw-werk-progress i {
  position: absolute;
  inset: 0;
  background: var(--rw-diepblauw);
  transform: scaleX(0);
  transform-origin: left;
}

.rw-werk-progress i.is-running {
  animation: rw-progress var(--duration, 3s) linear forwards;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 1101px) {
  .rw-werk {
    padding-bottom: 12vw;
  }

  .rw-werk-title {
    font-size: 5vw;
  }
}

/* Lage laptopschermen */
@media (min-width: 1101px) and (max-height: 950px) {
  .rw-werk-title {
    font-size: min(5vw, 8vh);
  }

  .rw-werk-slide {
    flex: 0 0 min(62vw, 900px, 82vh);
  }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .rw-werk {
    padding-bottom: 12vw;
  }

  .rw-werk-giant {
    top: 4.9vw;
    font-size: 52.8vw;
  }

  .rw-werk-title {
    font-size: 6vw;
  }

  .rw-werk-stage {
    margin-top: 10vw;
  }

  .rw-werk-track {
    column-gap: 3vw;
  }

  .rw-werk-slide {
    flex: 0 0 80vw;
  }
}

@media (max-width: 700px) {
  .rw-werk {
    padding-top: 13vw;
    padding-bottom: 25vw;
  }

  .rw-werk-giant {
    top: 37.3vw;
    font-size: 55.8vw;
  }

  .rw-werk-title {
    font-size: 9vw;
  }

  .rw-werk-intro {
    font-size: 18px;
  }

  .rw-werk-slide {
    flex: 0 0 85vw;
  }

  .rw-werk-image {
    aspect-ratio: 4 / 5;
  }

  .rw-werk-name {
    font-size: 18px;
    line-height: 1.6;
  }

  .rw-werk-slide figcaption {
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 2px;
  }

  .rw-werk-link {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
  }
}
