/* =====================================================
   Lumina Before/After Slider – Frontend Styles
   ===================================================== */

.lumina-ba-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.lumina-ba-wrapper .lumina-ba-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    line-height: 0; /* removes ghost space under inline images */
    background: #111;

    /* Override theme's layout.css which forces 16/9 on ALL .lumina-ba-container */
    aspect-ratio: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ── Images ─────────────────────────────────────── */
.lumina-ba-img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}

.lumina-ba-img--before {
    position: relative;    /* block element → defines container height */
    z-index: 1;
}

/* After image: always fills the FULL container, clipped on the right via clip-path */
.lumina-ba-img--after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    /* Initial clip — JS overrides this with the exact data-position value */
    clip-path: inset(0 50% 0 0);
    will-change: clip-path;
}

/* ── Handle ──────────────────────────────────────── */
.lumina-ba-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    z-index: 4;
    transform: translateX(-50%);
    pointer-events: none;
    will-change: left;
}

.lumina-ba-handle-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.lumina-ba-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    color: #333;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lumina-ba-wrapper .lumina-ba-container:hover .lumina-ba-handle-circle,
.lumina-ba-wrapper .lumina-ba-container.is-dragging .lumina-ba-handle-circle {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.lumina-ba-handle-circle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ── Labels ──────────────────────────────────────── */
.lumina-ba-label {
    position: absolute;
    top: 16px;
    z-index: 5;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 20px;
    line-height: 1.6;
    pointer-events: none;
    white-space: nowrap;
}

.lumina-ba-label--before {
    left: 16px;
}

.lumina-ba-label--after {
    right: 16px;
}

/* ── Range Input (invisible, full-area draggable) ── */
.lumina-ba-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    padding: 0;
    cursor: col-resize;
    z-index: 10;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Placeholder / Error ─────────────────────────── */
.lumina-ba-placeholder {
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ── Editor preview notice ───────────────────────── */
.lumina-ba-editor-note {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 6px;
    font-style: italic;
    line-height: 1;
}
