/* ============================================
   Voor/na-slider (components/before-after.njk)
   Maten van de twentytwenty-slider op het origineel.
   ============================================ */
.ba-slider {
  --pos: 50%;
  position: relative;
  /* eigen stapellaag: de z-indexen hieronder (tot 40) blijven binnen de slider
     en komen niet boven de plakkende header (z-index 10) uit */
  isolation: isolate;
  overflow: hidden;
  user-select: none;
  line-height: 0;
  cursor: ew-resize;
}
.ba-slider__after { position: relative; z-index: 10; display: block; width: 100%; max-width: 100%; height: auto; }
.ba-slider__before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
/* donkere laag met "Before/After" bij hover, zoals op het origineel */
.ba-slider::before,
.ba-slider::after {
  position: absolute;
  top: 50%;
  z-index: 26;
  margin-top: -19px;
  padding: 0 20px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  line-height: 38px;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.ba-slider::before { content: "Before"; left: 10px; }
.ba-slider::after { content: "After"; right: 10px; }
.ba-slider__handle {
  position: absolute;
  top: 50%;
  left: var(--pos);
  z-index: 40;
  width: 38px;
  height: 38px;
  margin: -22px 0 0 -22px;
  border: 3px solid #fff;
  border-radius: 1000px;
  box-shadow: 0 0 12px rgba(51, 51, 51, 0.5);
  box-sizing: content-box;
  cursor: all-scroll;
}
.ba-slider__handle::before,
.ba-slider__handle::after {
  content: " ";
  position: absolute;
  left: 50%;
  z-index: 30;
  display: block;
  width: 3px;
  height: 9999px;
  margin-left: -1.5px;
  background: #fff;
}
.ba-slider__handle::before { bottom: 50%; margin-bottom: 22px; box-shadow: 0 3px 0 #fff, 0 0 12px rgba(51, 51, 51, 0.5); }
.ba-slider__handle::after { top: 50%; margin-top: 22px; box-shadow: 0 -3px 0 #fff, 0 0 12px rgba(51, 51, 51, 0.5); }
.ba-slider__arrow {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -6px;
  border: 6px inset transparent;
  box-sizing: content-box;
}
.ba-slider__arrow--left { left: 50%; margin-left: -17px; border-right: 6px solid #fff; }
.ba-slider__arrow--right { right: 50%; margin-right: -17px; border-left: 6px solid #fff; }

.ba-slider__overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0);
  transition: background 0.5s;
}
.ba-slider__before { z-index: 20; }
@media (hover: hover) {
  .ba-slider:not(.is-active):hover .ba-slider__overlay { background: rgba(0, 0, 0, 0.5); }
  .ba-slider:not(.is-active):hover::before,
  .ba-slider:not(.is-active):hover::after { opacity: 1; }
}
