.ct_image_comparison {
    border: 20px solid #e5ecf1;
    position: relative;
    --width: 50%;
}
.darkmode .ct_image_comparison {
    border-color: #2a2a2a;
}

.ct_image_comparison::before {
    float: right;
    clear: right;
    margin: 0 -160px 0 0;
    position: relative;
    content: ' ';
    width: 100px;
    height: 100px;
    display: block;
    background: url('https://files.instruct.nl/fundament/flask.png');
    background-size: contain;
}
.darkmode .ct_image_comparison::before {
    background-image: url('https://files.instruct.nl/fundament/flask_darkmode.png');
}

.ct_image_comparison img {
    width: 100%;
    display: block;
}

.ct_image_comparison .ct_image_separator {
    position: absolute;
    top: 0;
    height: 100%;
    left: var(--width);
    width: 2px;
    margin-left: -1px;
    background: #E5ECF1;
    z-index: 1;
    pointer-events: none;
}
.darkmode .ct_image_comparison .ct_image_separator {
    background: #2a2a2a;
}

.ct_image_comparison .ct_image_image2 {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1;
    background: white;
    overflow: hidden;
    width: var(--width);
}

.ct_image_comparison .ct_image_image2 img {
    height: 100%;
    width: auto;
}

.ct_image_comparison input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    top: 0;
    left: -16px;
    width: calc(100% + 16px);
    height: 100%;
    opacity: 0;
    z-index: 2;
    cursor: col-resize;
    background: transparent;
}

.ct_image_comparison input[type=range]::-moz-range-track {
    height: 100%;
}

.ct_image_comparison input[type=range]::-moz-range-thumb {
    height: 100%;
    border-radius: 0;
    width: 32px;
    border: none;
}

.ct_image_comparison input[type=range]::-webkit-slider-runnable-track {
    height: 100%;
}

.ct_image_comparison input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
    border-radius: 0;
    width: 32px;
    border: none;
}

.ct_image_comparison .ct_image_separator img {
    position: absolute;
    z-index: 2;
    color: #004879;
    width: 32px;
    height: 32px;
    top: 50%;
    left: var(--width);
    transform: translate(-50%, -50%);
    padding: 6px;
    border-radius: 50%;
    background: #E5ECF1;
}

.darkmode .ct_image_comparison .ct_image_separator img {
    background: #2a2a2a;
}

.ct_image_separator:has(~ input[type=range]:focus) img {
    outline: 2px solid #004879;
}
.darkmode .ct_image_separator:has(~ input[type=range]:focus) img {
    outline-color: #E5ECF1;
}