.floating_image_with_text {
    position: relative;
    overflow: hidden;

    & .floating_image_with_text_inner {
        display: grid;
        grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
        gap: 8rem;
        align-items: center;
        position: relative;
    }

    & .floating_image_with_text_panel {
        position: relative;
        align-self: stretch;
        background-color: var(--panel-colour, #1B1788);
        min-height: 50rem;
        overflow: visible;

        /* Bleed the coloured panel out to the viewport's left edge */
        &::before {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            right: 100%;
            width: 100vw;
            background-color: inherit;
            pointer-events: none;
        }
    }

    & .floating_image_with_text_image {
        /* Absolutely positioned so the image can hang freely past the panel's right edge */
        position: absolute;
        top: 50%;
        left: 4rem;
        right: -8rem;
        transform: translateY(-50%);
        z-index: 2;

        & img {
            width: 100%;
            height: auto;
            display: block;
        }
    }

    & .floating_image_with_text_content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 6rem 0 6rem 4rem;

        & .subtitle {
            font-family: 'Karla', sans-serif;
            font-size: 2.4rem;
            font-weight: 700;
            line-height: 1;
            letter-spacing: -0.12rem;
            text-transform: uppercase;
            color: var(--subtitle-colour, #FFEB01);
            margin: 0 0 1.6rem;
        }

        & h2,
        & h3,
        & h4,
        & h5,
        & h6 {
            margin: 0 0 2.4rem;
            color: var(--title-colour, var(--content-colour, #002446));
            line-height: 1.15;
        }

        & .floating_image_with_text_title {
            font-family: 'Karla', sans-serif;
            font-size: clamp(32px, 4vw, 50px);
            font-weight: 700;
            line-height: 1.1;
            letter-spacing: -0.25rem;
            margin: 0 0 2.4rem;
            color: var(--title-colour, var(--content-colour, #002446));
        }

        & p {
            color: var(--content-colour, #3F3F3F);
            line-height: 1.6;
            margin: 0 0 1.6rem;

            &:last-child {
                margin-bottom: 0;
            }
        }

        & .btn_wrapper {
            margin-top: 2.4rem;
        }
    }

    /* Reversed: panel + image on the right, content on the left */
    &.reverse_section {
        & .floating_image_with_text_inner {
            grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
        }

        & .floating_image_with_text_panel {
            order: 2;
            justify-content: flex-end;

            &::before {
                left: 100%;
                right: auto;
            }
        }

        & .floating_image_with_text_image {
            /* Mirror: image anchored to right of panel, hangs over the left edge into content */
            left: -8rem;
            right: 4rem;
        }

        & .floating_image_with_text_content {
            order: 1;
            padding-left: 0;
            padding-right: 4rem;
            align-items: flex-start;
        }
    }

    & .floating_image_with_text_button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 1.6rem 3.2rem;
        font-size: 1.6rem;
        font-weight: 700;
        text-decoration: none;
        text-transform: uppercase;
        border-radius: 500px;
        transition: all 0.3s ease;
        min-width: 20rem;

        &.button_yellow {
            background-color: #FFEB01;
            color: #0A3956;

            &:hover {
                background-color: #002446;
                color: #fff;
            }
        }

        &.button_blue {
            background-color: #122841;
            color: #fff;

            &:hover {
                background-color: #FFEB01;
                color: #0A3956;
            }
        }
    }

    @media (max-width: 991px) {
        & .floating_image_with_text_inner {
            grid-template-columns: 1fr;
            gap: 3rem;
        }

        & .floating_image_with_text_panel {
            min-height: 0;
            padding: 4rem 0;

            &::before {
                left: 50%;
                right: auto;
                transform: translateX(-50%);
                width: 100vw;
            }
        }

        & .floating_image_with_text_image {
            position: relative;
            top: auto;
            left: auto;
            right: auto;
            transform: none;
            width: 80%;
            margin: 0 auto;
        }

        &.reverse_section .floating_image_with_text_inner {
            grid-template-columns: 1fr;
        }

        & .floating_image_with_text_content {
            padding-left: 0;
        }

        &.reverse_section {
            & .floating_image_with_text_panel {
                order: 1;
            }

            & .floating_image_with_text_image {
                margin-left: auto;
                margin-right: auto;
            }

            & .floating_image_with_text_content {
                order: 2;
                padding-right: 0;
            }
        }
    }
}
