/* 
  BEFORE/AFTER IMAGE SLIDER (from streakerswindow)
  Interactive drag-to-compare slider
*/

/* Variables - customize these! */
:root {
    --primary: #FB080E;
    --secondary: #2C3E50;
}

/* Gallery Container */
.before-after-gallery {
    background: linear-gradient(120deg, #f8f8f8 60%, #eaf6ff 100%);
    padding: 4rem 1rem 3.2rem 1rem;
    max-width: 1100px;
    margin: 0 auto 3.5rem auto;
    border-radius: 24px;
    box-shadow: 0 6px 32px rgba(32,58,103,0.09);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Section Heading */
.before-after-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2.2rem;
    text-align: center;
    letter-spacing: 0.01em;
    display: block;
}

/* Sliders Container */
.before-after-sliders {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Individual Slider */
.before-after-slider {
    max-width: 520px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.2rem;
    padding: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(32,58,103,0.10);
    border: 1.5px solid #eaf6ff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.before-after-slider h3 {
    padding: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    color: var(--secondary);
    margin: 0;
}

/* Slider Container */
.slider-container {
    max-width: 520px;
    width: 100%;
    aspect-ratio: 16/9;
    margin-left: auto;
    margin-right: auto;
    border-radius: 14px;
    overflow: hidden;
    background: #eaf6ff;
    box-shadow: 0 2px 12px rgba(32,58,103,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: ew-resize;
}

/* Before and After Images */
.slider-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

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

.after-img {
    clip-path: inset(0 0 0 50%);
    z-index: 1;
}

/* Slider Handle */
.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.slider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-handle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Handle Arrows */
.slider-handle::before,
.slider-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.slider-handle::before {
    left: 12px;
    border-width: 8px 8px 8px 0;
    border-color: transparent var(--primary) transparent transparent;
}

.slider-handle::after {
    right: 12px;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--primary);
}

/* Hover Effect on Container */
.slider-container:hover {
    box-shadow: 0 6px 20px rgba(32,58,103,0.15);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .before-after-gallery {
        padding: 2rem 0.5rem 2rem 0.5rem;
        border-radius: 16px;
    }
    
    .before-after-slider {
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .slider-container {
        border-radius: 12px;
    }
    
    .slider-handle {
        width: 40px;
        height: 40px;
    }
    
    .slider-handle::before {
        left: 10px;
        border-width: 6px 6px 6px 0;
    }
    
    .slider-handle::after {
        right: 10px;
        border-width: 6px 0 6px 6px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .slider-handle {
        transition: none;
    }
    
    .slider-handle:hover {
        transform: translate(-50%, -50%);
    }
}


