/**
 * @file
 * DHD Slider - Thema-onafhankelijke homepage slider.
 */

/* =========================
   BASE (mobile-first, portrait)
   ========================= */

/* Container */
.dhd-slider {
  position: relative;
  height: 80vh;
  height: clamp(28rem, 80svh, 44rem);
  width: 100%;
  z-index: 20;
  overflow: hidden;
}

.dhd-slider .container {
  position: relative;
  height: 100%;
}

/* Track: all slides stacked */
.dhd-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Single slide */
.dhd-slider__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 2.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 1;
  box-sizing: border-box;
}

.dhd-slider__slide--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* Text area */
.dhd-slider__text {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  z-index: 20;
}

/* Image area */
.dhd-slider__image {
  flex: 1 1 auto;
  z-index: 20;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.dhd-slider__image img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Typography */
.dhd-slider__text h2 {
  line-height: 1.2;
  font-size: 1.6rem;
  margin-bottom: .75rem;
}

.dhd-slider__text em {
  color: var(--primary);
  font-style: normal;
}

.dhd-slider__text p {
  font-size: 1rem;
  margin-bottom: .75rem;
}

/* Buttons: use theme's .button class, only add spacing */
.dhd-slider__text .button {
  text-decoration: none;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Layer animations */
.dhd-slider__layer {
  opacity: 0;
  transition: all ease 1s;
}

/* Start positions: odd layers from right, even from top */
.dhd-slider__layer--1 {
  transform: translate3d(100%, 0, 0);
}

.dhd-slider__layer--2 {
  transform: translate3d(0, -100%, 0);
}

.dhd-slider__layer--3 {
  transform: translate3d(0, 100%, 0);
}

/* Active slide layer transitions */
.dhd-slider__slide--active .dhd-slider__layer {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.dhd-slider__slide--active .dhd-slider__layer--1 {
  transition-delay: 0.3s;
}

.dhd-slider__slide--active .dhd-slider__layer--2 {
  transition-delay: 0.8s;
}

.dhd-slider__slide--active .dhd-slider__layer--3 {
  transition-delay: 1.6s;
}

/* Controls */
.dhd-slider__controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .375rem;
  z-index: 30;
}

.dhd-slider .dhd-slider__prev,
.dhd-slider .dhd-slider__next {
  margin: 0 .2rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  cursor: pointer;
  font-size: 0.7rem;
}

/* =========================
   MOBILE PORTRAIT (< 768px)
   ========================= */
@media (max-width: 767px) {
  .dhd-slider__text h2 {
    font-size: 1.2rem;
    margin-bottom: .375rem;
  }

  .dhd-slider__text p {
    font-size: 0.9rem;
    margin-bottom: .375rem;
  }

  .dhd-slider__text .button {
    padding: .375rem 1rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
  }

  .dhd-slider__slide {
    gap: 0;
  }

  .dhd-slider__image {
    max-height: 25vh;
  }
}

/* =========================
   MOBILE LANDSCAPE (< 768px, landscape)
   ========================= */
@media (max-width: 767px) and (orientation: landscape) {
  .dhd-slider {
    height: clamp(16rem, 90svh, 24rem);
  }

  .dhd-slider__slide {
    flex-direction: row;
    padding-top: 4rem;
  }

  .dhd-slider__text {
    flex: 3 3 55%;
    text-align: left;
    align-items: flex-start;
  }

  .dhd-slider__image {
    flex: 2 2 45%;
    max-height: none;
  }
}

/* =========================
   TABLET PORTRAIT (768-991px, portrait)
   ========================= */
@media (min-width: 768px) and (max-width: 991px) and (orientation: portrait) {
  .dhd-slider {
    height: clamp(24rem, 60svh, 36rem);
  }

  .dhd-slider__text h2 {
    font-size: 1.8rem;
  }

  .dhd-slider__text p {
    font-size: 1.1rem;
  }
}

/* =========================
   TABLET LANDSCAPE (768-991px, landscape)
   ========================= */
@media (min-width: 768px) and (max-width: 991px) and (orientation: landscape) {
  .dhd-slider {
    height: clamp(20rem, 80svh, 32rem);
  }

  .dhd-slider__slide {
    flex-direction: row;
  }

  .dhd-slider__text {
    flex: 3 3 55%;
    text-align: left;
    align-items: flex-start;
  }

  .dhd-slider__text h2 {
    font-size: 1.8rem;
  }

  .dhd-slider__image {
    flex: 2 2 45%;
    max-height: none;
  }
}

/* =========================
   DESKTOP (>= 992px)
   ========================= */
@media (min-width: 992px) {
  .dhd-slider__slide {
    flex-direction: row;
  }

  .dhd-slider__text {
    flex: 3 3 60%;
    align-items: flex-start;
    text-align: left;
  }

  .dhd-slider__text h2 {
    font-size: 2rem;
  }

  .dhd-slider__text p {
    font-size: 1.2rem;
  }

  .dhd-slider__image {
    flex: 2 2 40%;
    max-height: none;
    margin: 2rem 0;
  }
}

/* =========================
   GROOT DESKTOP (>= 1200px)
   ========================= */
@media (min-width: 1200px) {
  .dhd-slider__text h2 {
    font-size: 2.4rem;
  }
}
