.ba-slider {
    --pos: 50%;
    display: block;
    position: relative;
    overflow: hidden;
    line-height: 0;
}
.ba-slider > img {
    display: block;
    width: 100%;
    height: auto;
}

.ba-reveal {
    position: absolute;
    inset: 0;
    clip-path: inset(0 calc(100% - var(--pos)) 0 0);
    z-index: 1;
}
.ba-reveal > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ba-range {
    position: absolute;
    z-index: 3;
    top: 0;
    left: -1px;
    width: calc(100% + 2px);
    height: 100%;
    margin: 0;
    cursor: ew-resize;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    opacity: 0;
    touch-action: auto;
}
.ba-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 300vh;
    width: 2px;
}
.ba-range::-moz-range-thumb {
    height: 300vh;
    width: 2px;
    border: none;
    background: transparent;
}

.ba-handle {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    top: 50%;
    left: var(--pos);
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.7);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}
.ba-handle::before,
.ba-handle::after {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    top: 50%;
    border-top: solid 2px #333;
    border-left: solid 2px #333;
    transform-origin: 0 0;
}
.ba-handle::before {
    left: 10px;
    transform: rotate(-45deg);
}
.ba-handle::after {
    right: 0;
    transform: rotate(135deg);
}

.ba-slider:hover .ba-handle {
    background: rgba(255, 255, 255, 0.9);
}
