.img-compare {
    display: inline-block;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
    font-size: 0;
}

.center-wrapper {
    display: flex;
    justify-content: center;
    margin: 30px;
}

.img-compare img {
    display: block;
    user-select: none;
    pointer-events: none;
    width: 100%;
    height: auto;
}

.img-compare .label {
  position: absolute;
  bottom: 8px;
  left: 0;               /* span full width */
  width: 100%;
  display: block;
  padding: 2px 6px;
  font-size: 14px;
  font-family: sans-serif;
  color: white;
  border-radius: 3px;
  pointer-events: none;
  z-index: 20;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8),
               0 2px 4px rgba(0,0,0,0.6);
  /* make sure clip-path respects this element’s box */
  clip-path: inset(0 50% 0 0);
}

/* just align the text within that full‑width block */
.img-compare .before-label { text-align: left; }
.img-compare .after-label  { text-align: right; }

.img-compare .divider {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 3;
}

.img-compare .after {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(0 50% 0 0);
    z-index: 2;
}

.img-compare .divider {
    position: absolute;
    top: 0;
    height: 100%;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 10; /* make sure it's on top but still inside container */
}
