/* --- 1. Container and Base Images --- */
.img-compare__container {
  position: relative;
  width: 100%;
  margin: 0px auto;
  overflow: hidden;
  cursor: ew-resize;
  border-radius: 12px;
}

.img-compare__container img {
  /* Base style for both images */
  width: 100%;
  display: block;
}

/* --- 2. Top Image Wrapper (Clipper) --- */
.img-compare__top-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
}

.img-compare__top-wrap .img-compare__top-img {
  position: absolute;
  top: 0;
  left: 0;
  /* Width set by JavaScript */
}

/* --- 3. The Custom Slider (The Thumb/Handle) --- */
.img-compare__slider-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.img-compare__slider-thumb {
  position: absolute;
  /* Center vertically */
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  /* Visual styling for the dividing line */
  width: 2px;
  height: 100%;
  background-color: white;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  pointer-events: none;
}

/* A draggable circle on the handle */
.img-compare__slider-thumb::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: white;
  border: 3px solid black;
  border-radius: 50%;
  color: black;
  content: "\2039 \203a";
  line-height: 35px;
  font-size: 32px;
  font-weight: 200;
  text-align: center;
}

/* --- 4. Hidden Range Input (The Actual Control) --- */
.img-compare__slider-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  margin: 0;
  opacity: 0; /* Make it invisible */
  cursor: ew-resize;
  z-index: 20;
}
