/* 🧩 CFBA v4.3 – Slider CSS */

/* Wrapper spacing */
.cfba4-slider-wrapper {
    margin: 1.5rem 0;
}

/* Main slider shell */
.cfba4-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    background: #000;
}

/* Inner area sets the aspect ratio */
.cfba4-slider-inner {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* overridden inline when ratio is passed */
    overflow: hidden;
}

/* Images */
.cfba4-slider-inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* After image (background) */
.cfba4-after {
    position: absolute;
    inset: 0;
}

/* Before wrap – reveals via width% */
.cfba4-before-wrap {
    position: absolute;
    inset: 0;
    width: 40%;
    overflow: hidden;
    pointer-events: none;
}

.cfba4-before {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Handle */
.cfba4-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 40%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: ew-resize;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.cfba4-handle-bar {
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.75);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}

.cfba4-handle-knob {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Simple double-bar icon inside knob */
.cfba4-handle-knob::before,
.cfba4-handle-knob::after {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border-top: 2px solid #c41e3a;
    border-bottom: 2px solid #c41e3a;
    margin: 0 2px;
}

/* Labels */
.cfba4-label {
    position: absolute;
    top: 12px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    backdrop-filter: blur(4px);
}

.cfba4-label-before {
    left: 12px;
}

.cfba4-label-after {
    right: 12px;
}

/* Caption */
.cfba4-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

/* Dragging state */
.cfba4-slider.cfba4-dragging .cfba4-handle-knob {
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    transform: scale(1.02);
}

/* Entry effects – base ready state */
.cfba4-slider.cfba4-ready .cfba4-handle-knob {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Pulse animation */
@keyframes cfba4-pulse {
    0%   { transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
    40%  { transform: scale(1.08); box-shadow: 0 8px 18px rgba(0,0,0,0.3); }
    80%  { transform: scale(1.02); box-shadow: 0 5px 12px rgba(0,0,0,0.25); }
    100% { transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
}

/* Nudge animation */
@keyframes cfba4-nudge {
    0%   { transform: translateX(-50%) translateX(0); }
    40%  { transform: translateX(-50%) translateX(-6px); }
    80%  { transform: translateX(-50%) translateX(4px); }
    100% { transform: translateX(-50%) translateX(0); }
}

/* Pulse only */
.cfba4-slider.cfba4-ready.cfba4-entry-pulse .cfba4-handle-knob {
    animation: cfba4-pulse 1.4s ease-out 0.4s 1;
}

/* Nudge only */
.cfba4-slider.cfba4-ready.cfba4-entry-nudge .cfba4-handle {
    animation: cfba4-nudge 1.2s ease-out 0.4s 1;
}

/* Pulse + slight nudge combo */
.cfba4-slider.cfba4-ready.cfba4-entry-pulse-nudge .cfba4-handle-knob {
    animation: cfba4-pulse 1.4s ease-out 0.3s 1;
}
.cfba4-slider.cfba4-ready.cfba4-entry-pulse-nudge .cfba4-handle {
    animation: cfba4-nudge 1.2s ease-out 0.5s 1;
}

/* Mobile tweaks */
@media (max-width: 600px) {
    .cfba4-handle-knob {
        width: 26px;
        height: 26px;
    }
    .cfba4-label {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}
