/* Explain: Styles for the before/after image comparison component. */
/* Vorher-Nachher-Vergleich auf der Galerieseite */
.ba-compare {
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    background: color-mix(in srgb, var(--surface-color) 92%, transparent);
    box-shadow: var(--shadow-card);
    transition: transform 300ms ease, border-color 300ms ease;
}

.ba-compare:hover {
    transform: translateY(-0.35rem);
    border-color: color-mix(in srgb, var(--primary-color) 60%, transparent);
}

.ba-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    background: var(--cream-color);
    user-select: none;
    touch-action: pan-y;
}

.ba-stage img {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ba-after {
    z-index: 1;
}

.ba-before {
    z-index: 2;
    -webkit-clip-path: inset(0 50% 0 0);
    clip-path: inset(0 50% 0 0);
}

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 3;
    width: 2px;
    background: var(--cream-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--charcoal-color) 28%, transparent);
    transform: translateX(-50%);
    pointer-events: none;
}

.ba-handle-grip {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    height: 3rem;
    width: 3rem;
    transform: translate(-50%, -50%);
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 3px solid var(--cream-color);
    background: var(--primary-color);
    color: var(--cream-color);
    box-shadow: var(--shadow-card);
}

.ba-badge {
    position: absolute;
    top: 1rem;
    z-index: 3;
    border-radius: 999px;
    background: color-mix(in srgb, var(--charcoal-color) 72%, transparent);
    padding: 0.3rem 0.85rem;
    color: var(--cream-color);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.ba-badge-before {
    left: 1rem;
}

.ba-badge-after {
    right: 1rem;
}

.ba-range {
    position: absolute;
    inset: 0;
    z-index: 4;
    margin: 0;
    width: 100%;
    height: 100%;
    cursor: ew-resize;
    opacity: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.ba-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
    width: 3rem;
    cursor: ew-resize;
}

.ba-range::-moz-range-thumb {
    height: 100%;
    width: 3rem;
    border: 0;
    background: transparent;
    cursor: ew-resize;
}