*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* Slider Container */
.before-after-container {
  position: relative;
  width: 100%;
  /* height: 500px; */
  /* margin: 40px auto; */
  --position: 50%;
}

/* Images fill container */
.image-container {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.slider-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Clip after image dynamically */
.image-after {
  clip-path: polygon(0 0, var(--position) 0, var(--position) 100%, 0 100%);
}

/* Invisible slider input */
.slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
}

/* Vertical divider */
.slider-line {
  position: absolute;
  top: 0;
  left: var(--position);
  width: 2px;
  height: 100%;
  background: white;
  z-index: 5;
  pointer-events: none;
}

/* Circle handle */
.slider-button {
  position: absolute;
  top: 50%;
  left: var(--position);
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: white;
  border: 3px solid #333;
  border-radius: 50%;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}
