/* Before and After Slider for Specific Image */

.before-after-container {
    position: relative;
    width: 100%;
    margin: 0rem auto;
    overflow: hidden;
    max-width: 400px;
}

.before-after-container .before-image,
.before-after-container .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.before-after-container img {
    display: block;
    width: 100%;
    height: auto;
}


/* Initially, we won't rely on a static clip; 
   The JS will set it after images load.
   By default, half will be shown once JS runs.
*/

.before-after-container .after-image {
    /* Placeholder, JS overrides after load */
    clip: rect(0, 50%, 100%, 0);
    transition: clip 0.2s ease;
}


/* The divider line is hidden */

.before-after-container .divider-line {
    display: none;
}


/* Slider styling */

.before-after-container .slider {
    position: absolute;
    bottom: 10px;
    left: 50%;
    top: 50%;
    transform: translateX(-50%);
    width: 80%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.before-after-container .slider::-webkit-slider-thumb,
.before-after-container .slider::-moz-range-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #222;
    border-radius: 50%;
    cursor: grab;
    border: 2px solid #fff;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
    .before-after-container .slider {
        bottom: 20px;
    }
}