/* ============================================================
   Before/After smile comparison slider.
   ============================================================ */
.ba-compare {
    --x: 50%;
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(var(--nd-navy-rgb), .14);
    background: var(--nd-surface-alt);
    user-select: none;
}
.ba-stage { position: relative; width: 100%; aspect-ratio: 7 / 6; }
.ba-stage img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover; display: block;
    pointer-events: none;
}
.ba-after { z-index: 1; }
.ba-before { z-index: 2; clip-path: inset(0 calc(100% - var(--x)) 0 0); }

.ba-label {
    position: absolute; top: .6rem; z-index: 3;
    font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: .25rem .6rem; border-radius: 999px; color: var(--nd-white);
}
.ba-label--before { left: .6rem; background: rgba(var(--nd-navy-rgb), .82); }
.ba-label--after { right: .6rem; background: rgba(var(--nd-blue-rgb), .92); }

.ba-handle {
    position: absolute; top: 0; bottom: 0; left: var(--x); z-index: 4;
    width: 3px; margin-left: -1.5px; background: var(--nd-white); box-shadow: 0 0 0 1px rgba(var(--nd-navy-rgb), .15);
    cursor: ew-resize;
}
.ba-handle::after {
    content: "\F14C"; /* bi-arrow-left-right via Bootstrap Icons font */
    font-family: "bootstrap-icons"; font-size: 1rem; color: var(--nd-blue);
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 38px; height: 38px; border-radius: 50%; background: var(--nd-white);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(var(--nd-navy-rgb), .25);
}
.ba-range {
    position: absolute; inset: 0; z-index: 5;
    width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y;   /* horizontal drags move the slider, vertical swipes still scroll the page */
}
.ba-dragging { cursor: ew-resize; }
/* keyboard focus lands on the invisible range input, so the decorative handle shows the focus ring */
.ba-focus .ba-handle::after { outline: 3px solid var(--nd-blue); outline-offset: 3px; }
