:root {
    --sticky-static-vh: 50;
    --sticky-fade-vh: 150;
    --sticky-zoom-intensity: 0.1;
}

.sticky-slider {
    position: relative;
    width: 100%;
}

/* The single unified native track that prevents any element overlapping */
.sticky-wrapper {
    position: sticky;
    /* Centers the image perfectly by offsetting the height of the adopted previous element */
    top: calc(50vh - var(--before-h, 0px) - var(--current-h, 100vh) / 2);
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sticky-wrapper .sticky-image {
    width: 100%;
    height: var(--current-h, 100vh);
    overflow: hidden;
    position: relative; /* Kept in normal DOM flow so adjacent text aligns perfectly */
}

.sticky-wrapper .sticky-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    will-change: transform, opacity;
    z-index: 0;
}

/* Base image sizes */
.sticky-wrapper .sticky-image img.fit-width {
    width: 100%;
    height: auto;
}

.sticky-wrapper .sticky-image img.fit-height {
    width: auto;
    height: 100vh;
}

.sticky-wrapper .sticky-image img.fit-diagonal,
.sticky-wrapper
    .sticky-image
    img:not(.fit-width):not(.fit-height):not(.fit-diagonal) {
    width: 100%;
    height: 100vh;
    object-fit: cover;
}
