/* Before / after — i2t3 component styles
 * Two images with a draggable divider. Works horizontally or vertically.
 * The reveal image width/height is synced to the container by script.js.
 */

.i2t3-beforeafter {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    line-height: 0;
    touch-action: none;
}
.i2t3-beforeafter--rounded { border-radius: .75rem; }
.i2t3-beforeafter--hover { cursor: ew-resize; }

.i2t3-beforeafter__base {
    display: block;
    width: 100%;
    height: auto;
}

.i2t3-beforeafter__reveal {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    overflow: hidden;
}
.i2t3-beforeafter--vertical .i2t3-beforeafter__reveal {
    width: 100%;
    height: 50%;
}

.i2t3-beforeafter__revealimg {
    display: block;
    max-width: none;
    height: auto;
}

/* Divider handle */
.i2t3-beforeafter__handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #fff;
    transform: translateX(-1px);
    cursor: ew-resize;
}
.i2t3-beforeafter--vertical .i2t3-beforeafter__handle {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-1px);
    cursor: ns-resize;
}

.i2t3-beforeafter__grip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .12), 0 .25rem .5rem rgba(0, 0, 0, .2);
}
.i2t3-beforeafter__grip::before {
    content: "\2194";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--i2t3-primary, #0d6efd);
    font-size: 1.1rem;
    line-height: 1;
}
.i2t3-beforeafter--vertical .i2t3-beforeafter__grip::before {
    content: "\2195";
}

/* Captions */
.i2t3-beforeafter__label {
    position: absolute;
    bottom: .5rem;
    padding: .2rem .6rem;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: .8rem;
    line-height: 1.3;
    border-radius: .25rem;
    z-index: 2;
}
.i2t3-beforeafter__label--before { left: .5rem; }
.i2t3-beforeafter__label--after { right: .5rem; }
