/*---*\
Half Text Half Form
Half-and-half CTA with optional bg media and form card (half-image-text, gravity-forms).
\*---*/

.half-text-half-form {
    position: relative;
    overflow: hidden;
    padding-bottom: 0;
}

.half-text-half-form.no-form-selected,
.half-text-half-form.duplicate-form-selected {
    padding-bottom: var(--section-margins);
}
.half-text-half-form.no-form-selected,
.half-text-half-form.duplicate-form-selected + .page-footer .page-footer__main {
    padding-top: 40px;
}

.half-text-half-form.no-form-selected .half-text-half-form__form-frame, .half-text-half-form.duplicate-form-selected .half-text-half-form__form-frame {
    border-radius: 20px;
    padding: 20px;
}

.half-text-half-form.no-form-selected .half-text-half-form__form-col,
.half-text-half-form.duplicate-form-selected .half-text-half-form__form-col {
    justify-content: center;
}

.half-text-half-form.no-form-selected .half-text-half-form__background,
.half-text-half-form.duplicate-form-selected .half-text-half-form__background {
    bottom: 0;
}

/* Bg stack; bottom offset leaves room for the form-frame strip. */
.half-text-half-form__background {
    background-image: var(--bg-gradient);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 90px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.half-text-half-form__bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Gradient film when a bg image is present. */
.half-text-half-form__background::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.half-text-half-form--has-bg-image .half-text-half-form__background::after {
    background-image: linear-gradient(
        110deg,
        rgba(22, 97, 45, 0.85) 0%,
        rgba(15, 86, 139, 0.85) 100%
    );
}

.half-text-half-form > .container,
.half-text-half-form > .container-fluid {
    position: relative;
    z-index: 1;
}

/* bg-white + gradient: invert text-column tokens (global flip does not apply). */
.section-block.half-text-half-form.bg-white:not(.half-text-half-form--contact-page) .half-and-half__col--text {
    color: var(--color-body-inverse);
    --color-heading: var(--color-heading-inverse);
    --color-body: var(--color-body-inverse);
    --color-link: var(--color-secondary-inverse);
    --color-link-hover: var(--color-white);
}

.section-block.half-text-half-form.bg-white:not(.half-text-half-form--contact-page) .half-and-half__col--text .sub-heading {
    color: var(--color-primary-inverse);
}

.section-block.half-text-half-form.bg-white:not(.half-text-half-form--contact-page) .half-and-half__col--text .half-and-half__heading {
    color: var(--color-heading-inverse);
}

/* Form column: restore static body/heading tokens for the card. */
.section-block.half-text-half-form.bg-white:not(.half-text-half-form--contact-page) .half-text-half-form__form-col {
    --color-body: var(--color-body-static);
    --color-heading: var(--color-heading-static);
    color: var(--color-body);
}

.half-text-half-form__form-col {
    align-self: stretch;
}

.half-text-half-form__form-frame {
    background-color: var(--color-white);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 10px 10px 0;
}

.half-text-half-form__form {
    background-color: var(--bg-medium-green);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: var(--space-paragraph-to-button);
}

.half-text-half-form__form > :last-child {
    margin-bottom: 0;
}

.half-text-half-form--contact-page .half-and-half__col:not(.half-and-half__col--media) {
    padding-top: var(--section-margins);
}

@media ( max-width: 1199px ) {
    .half-text-half-form .half-text-half-form__content-inner {
        text-align: center;
    }

    .half-text-half-form .half-text-half-form__content-inner .sub-heading {
        justify-content: center;
    }

    .half-text-half-form .half-text-half-form__content-inner .sub-heading::after {
        display: block;
    }
}

@media (min-width: 768px) {

    .half-text-half-form__form {
        padding: 30px;
        gap: 32px;
    }

    .section-block.half-text-half-form.bg-white:not(.half-text-half-form--contact-page) .half-text-half-form__form-col {
        margin-bottom: 0;
    }
}

@media (min-width: 1200px) {

    .half-text-half-form__background {
        bottom: 100px;
    }


    .half-text-half-form .half-text-half-form__content-inner {
        margin-left: auto;
    }

    .half-text-half-form .half-text-half-form__content-inner {
        max-width: 780px;
    }

    .half-text-half-form__form-frame {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding: 20px 20px 0;
    }

    .half-text-half-form .half-and-half__row {
        align-items: stretch;
    }

    .half-text-half-form__form-col {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .half-text-half-form__form {
        padding: 35px;
        gap: 32px;
    }

    .half-text-half-form .half-and-half__col:not(.half-and-half__col--media) {
        align-self: flex-start;
    }

}
