.split-image-text {
    position: relative;
    width: 100%;
    min-height: 500px;
    overflow: visible;
    margin: 0;
    padding: 0;
}

/* Background Split - Horizontal (Top/Bottom) */
.split-image-text__backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.split-image-text__bg-top {
    width: 100%;
    height: 50%;
    background-color: #162E44;
}

.split-image-text__bg-bottom {
    width: 100%;
    height: 50%;
    background-color: #F4F1ED;
}

/* Container - No max-width constraint on right side */
.split-image-text__container {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: block;
    z-index: 2;
    padding: 60px 0;
}

/* Image Wrapper - Breaks out to viewport edge (Default: Right) */
.split-image-text__image-wrapper {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50vw;
    max-width: none;
    z-index: 2;
    margin: 0;
    padding: 0;
    opacity: 0;
    transform: translateX(var(--split-image-slide, 0));
    transition: transform 1s cubic-bezier(0.17, 0.55, 0.36, 1), opacity 0.8s cubic-bezier(0.17, 0.55, 0.36, 1);
    will-change: transform, opacity;
}

.split-image-text__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 16px 0 0 16px;
}

.split-image-text__image-wrapper.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.split-image-text--right .split-image-text__image-wrapper {
    --split-image-slide: 60px;
}

.split-image-text--left .split-image-text__image-wrapper {
    --split-image-slide: -60px;
}

/* Title Wrapper - Positioned at Bottom of Image, Overlapping Edge */
.split-image-text__title-wrapper {
    position: absolute;
    bottom: -74px;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 0 60px;
    border-radius: 0 0 0 16px;
}

/* Layout Variant: Image on Left */
.split-image-text--left .split-image-text__image-wrapper {
    right: auto;
    left: 0;
}

.split-image-text--left .split-image-text__image {
    border-radius: 0 16px 16px 0;
}

.split-image-text--left .split-image-text__title-wrapper {
    border-radius: 0 0 16px 0;
}

/* Default: Image on Right (explicit) */
.split-image-text--right .split-image-text__image-wrapper {
    right: 0;
    left: auto;
}

.split-image-text--right .split-image-text__image {
    border-radius: 16px 0 0 16px;
}

.split-image-text--right .split-image-text__title-wrapper {
    border-radius: 0 0 0 16px;
}

.split-image-text__title {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1.6px;
    margin: 0;
    color: #FBF8F6;
}

.split-image-text__title-word {
    display: inline;
}

.split-image-text__title-word--first {
    display: block;
}

.split-image-text__title-line-two {
    display: block;
    white-space: nowrap;
}

.split-image-text__title-line-two .split-image-text__title-word:not(:last-child)::after {
    content: ' ';
}

/* Tablet */
@media (max-width: 1024px) {
    .split-image-text__container {
        padding: 50px 0;
        min-height: 450px;
    }

    .split-image-text__image-wrapper {
        width: 55vw;
        max-width: none;
        right: 0;
    }

    .split-image-text__image {
        border-radius: 16px 0 0 16px;
    }

    .split-image-text__title-wrapper {
        bottom: -30px;
        left: 0;
        right: 0;
        padding: 0 40px;
    }

    .split-image-text__title {
        font-size: 44px;
    }

    /* Right variant on tablet */
    .split-image-text--right .split-image-text__image-wrapper {
        right: 0;
        left: auto;
    }

    .split-image-text--right .split-image-text__image {
        border-radius: 16px 0 0 16px;
    }

    .split-image-text--right .split-image-text__title-wrapper {
        border-radius: 0 0 0 16px;
    }

    /* Left variant on tablet */
    .split-image-text--left .split-image-text__image-wrapper {
        right: auto;
        left: 0;
    }

    .split-image-text--left .split-image-text__image {
        border-radius: 0 16px 16px 0;
    }

    .split-image-text--left .split-image-text__title-wrapper {
        border-radius: 0 0 16px 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .split-image-text {
        min-height: 500px;
    }

    .split-image-text__container {
        padding: 40px 20px;
        min-height: 500px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .split-image-text__image-wrapper,
    .split-image-text--left .split-image-text__image-wrapper {
        position: relative;
        width: calc(100% - 40px);
        max-width: 600px;
        height: auto;
        right: auto;
        left: auto;
        bottom: auto;
        top: auto;
        margin: 0 auto;
    }

    .split-image-text__image,
    .split-image-text--left .split-image-text__image,
    .split-image-text--right .split-image-text__image {
        height: auto;
        min-height: 400px;
        border-radius: 16px;
    }

    .split-image-text__title-wrapper {
        bottom: -20px;
        left: 0;
        right: 0;
        padding: 0 30px;
    }

    .split-image-text__title {
        font-size: 36px;
        letter-spacing: -1px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .split-image-text {
        min-height: 450px;
    }

    .split-image-text__container {
        padding: 32px 16px;
        min-height: 450px;
    }

    .split-image-text__image-wrapper,
    .split-image-text--left .split-image-text__image-wrapper {
        width: calc(100% - 32px);
    }

    .split-image-text__image,
    .split-image-text--left .split-image-text__image,
    .split-image-text--right .split-image-text__image {
        min-height: 350px;
        border-radius: 16px;
    }

    .split-image-text__title-wrapper {
        bottom: -33px;
        left: 0;
        right: 0;
        padding: 0 24px;
    }

    .split-image-text__title {
        font-size: 28px;
        letter-spacing: -0.8px;
    }
}

/* Editor Preview Styles */
.editor-preview.split-image-text {
    margin: 0;
}

.editor-preview .split-image-text__container {
    padding: 30px 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-preview .split-image-text__image-wrapper,
.editor-preview.split-image-text--left .split-image-text__image-wrapper {
    position: relative;
    width: 80%;
    max-width: 600px;
    height: auto;
    right: auto;
    left: auto;
    bottom: auto;
    top: auto;
    margin: 0 auto;
}

.editor-preview .split-image-text__image,
.editor-preview.split-image-text--left .split-image-text__image {
    height: auto;
    min-height: 350px;
    border-radius: 16px;
}

.editor-preview .split-image-text__title-wrapper {
    bottom: -25px;
    left: 0;
    right: 0;
    padding: 0 30px;
}

.editor-preview .split-image-text__title {
    font-size: 32px;
}


/* Full width alignment */
.alignfull.split-image-text {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Wide alignment */
.alignwide.split-image-text {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}
