/* Before/After Comparison Slider */

.ba-compare {
    max-width: 800px;
    margin: 20px auto;
}

.ba-slider-wrapper {
    position: relative;
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    line-height: 0;
}

.ba-slider-after {
    display: block;
    width: 100%;
    height: auto;
}

.ba-slider-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.ba-slider-before img {
    display: block;
    /* Width/height set by JS to match the after image */
}

/* Drag handle */
.ba-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    z-index: 10;
}

.ba-slider-handle-line {
    position: absolute;
    top: 0;
    left: -1px;
    width: 3px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.ba-slider-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #555;
    letter-spacing: -2px;
}

/* Labels */
.ba-slider-label {
    position: absolute;
    bottom: 12px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    pointer-events: none;
    line-height: 1.3;
}

.ba-slider-label-before {
    left: 12px;
}

.ba-slider-label-after {
    right: 12px;
}

/* Caption below slider */
.ba-slider-caption {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-top: 8px;
    font-style: italic;
    line-height: 1.4;
}

/* Size variant */
.ba-compare.ba-size-medium {
    max-width: 500px;
}

/* Side-by-side row */
.ba-row {
    display: flex;
    gap: 12px;
    margin: 20px auto;
    max-width: 800px;
}
.ba-row .ba-compare {
    flex: 1 1 0;
    max-width: none;
    margin: 0;
}

/* Mobile: stack side-by-side */
@media (max-width: 600px) {
    .ba-row {
        flex-direction: column;
    }
}

/* Active state: no transition lag */
.ba-slider-active .ba-slider-before,
.ba-slider-active .ba-slider-handle {
    transition: none;
}

/* Progressive enhancement: without JS, show images stacked */
.ba-compare:not(.ba-slider-init)::before {
    content: attr(data-caption);
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}
