/* The styles verslag-2014-2015.js needs on top of the 2014 and 2015 stylesheets (duurzaam spec plain-js-2014-2015).
   Emitted beside the module by FrozenVerslagen. Where the old libraries left a class the frozen stylesheets style
   (remodal's, slick's arrows), the module reuses it, and only what the library did inline is here. */

/* ── scroll animations (ticket 02) ───────────────────────────────────────────
   Velocity's slide transitions: 20 px and a fade, 900 ms up and down, 1000 ms left and right. The original hid an
   element with display:none until it came in; it stays in the layout here, so nothing below it jumps. */

.animate {
  display: block;
  transition: opacity 900ms ease-in-out, transform 900ms ease-in-out;
}

.animate-left,
.animate-right {
  transition-duration: 1000ms;
}

.animate.is-out {
  opacity: 0;
}

.animate-up.is-out {
  transform: translateY(20px);
}

.animate-down.is-out {
  transform: translateY(-20px);
}

.animate-left.is-out {
  transform: translateX(-20px);
}

.animate-right.is-out {
  transform: translateX(20px);
}

/* A block waiting to slide in from the right sits 20 px past its place, which on a phone is past the viewport's
   edge; the content clips it rather than scrolling sideways. */
.content {
  overflow-x: clip;
}

/* The play button turns on hover with its own transition (.video-row__btn, 0.5 s); the slide-in keeps it. */
.video-row__btn.animate {
  transition: opacity 1000ms ease-in-out, transform 0.5s ease-out;
}

/* ── sliders (ticket 03) ─────────────────────────────────────────────────────
   Slick's layout as scroll-snap: the slides move into a track, which scrolls. Slick's slidesToShow was 2.5 for the
   "ons werk" slider, 1.5 up to 991 px, and 1 for a .slider. */

.vw-slider {
  position: relative;
}

.vw-slider__track {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.vw-slider__track::-webkit-scrollbar {
  display: none;
}

.vw-slider__track.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.vw-slider__track > * {
  flex: 0 0 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
}

.vw-slider__track img {
  -webkit-user-drag: none;
}

.ons-werk-slider .vw-slider__track > * {
  flex-basis: 40%;
  padding: 0 7.5px;
}

@media screen and (min-width: 768px) {
  .ons-werk-slider .vw-slider__track > * {
    padding: 0 15px;
  }
}

@media screen and (max-width: 991px) {
  .ons-werk-slider .vw-slider__track > * {
    flex-basis: 66.6667%;
  }
}

.vw-slider .slick-prev,
.vw-slider .slick-next {
  z-index: 1;
  cursor: pointer;
}

/* ── the scope popup (ticket 03) ─────────────────────────────────────────────
   A <dialog> in the role of remodal's wrapper, so the frozen .remodal-wrapper and .remodal rules apply. The
   backdrop is remodal's overlay. */

dialog.remodal-wrapper {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

dialog.remodal-wrapper[open] {
  display: block;
}

dialog.remodal-wrapper::backdrop {
  background: rgba(33, 33, 34, 0.85);
}

dialog.remodal-wrapper .remodal {
  visibility: visible;
}

/* ── reduced motion ──────────────────────────────────────────────────────────
   Everything shows in its final state at once; the module also leaves the counters at their final text. */

@media (prefers-reduced-motion: reduce) {
  .animate,
  .co2-saved__stats__val,
  .remodal {
    transition: none;
  }
}
