.image-comparison {
    position: relative;
    user-select: none;
    overflow: hidden;
    display: flex;
}
.image-comparison .image-before,
.image-comparison .image-after {
    width: 100%;
}
.image-comparison .image-before {
    position: absolute;
    inset: 0;
    clip-path: inset(0 50% 0% 0%);
}
.image-comparison__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    background-color: transparent;
    transition: background-color 0.5s ease-in-out;
    padding: 10px;
}
.image-comparison__overlay:hover {
    background-color: rgba(0, 0, 0, 0.5);
}
.image-comparison__overlay:hover .image-comparison__before-label,
.image-comparison__overlay:hover .image-comparison__after-label {
    opacity: 1;
}
.image-comparison__before-label,
.image-comparison__after-label {
    color: white;
    font-size: 16px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    padding: 8px 16px;
    height: min-content;
    border-radius: 2px;
}
.image-comparison__handle {
    position: absolute;
    top: 0;
    right: 50%;
    height: 100%;
    width: 3px;
    --scrub-width: 40px;
}
.image-comparison__handle::before,
.image-comparison__handle::after {
    content: "";
    position: absolute;
    width: 3px;
    background-color: white;
    box-shadow: 0px 0px 8px 5px rgba(0, 0, 0, 0.082);
}
.image-comparison__handle::before {
    top: 0;
    bottom: calc(50% + (var(--scrub-width) / 2));
}
.image-comparison__handle::after {
    top: calc(50% + (var(--scrub-width) / 2));
    bottom: 0;
}
.image-comparison__scrub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: var(--scrub-width);
    height: var(--scrub-width);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.082);
    z-index: 1;
}
.image-comparison__scrub .right-icon {
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid white;
}
.image-comparison__scrub .left-icon {
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid white;
}
.image-comparison__scrub svg {
    width: 15px;
    color: white;
    stroke-width: 4;
}
