/**
 * Posts-only Global CTA Rows component.
 *
 * Markup and visibility are owned by func/mg-global-cta-rows.php. All selectors
 * stay component-scoped so Beaver Builder and Themer layouts are unaffected.
 */

.mg-global-cta {
    box-sizing: border-box;
    width: 100%;
    padding: 40px 20px;
    background: #fff;
}

.mg-global-cta *,
.mg-global-cta *::before,
.mg-global-cta *::after {
    box-sizing: inherit;
}

.mg-global-cta__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    width: calc( 100% - 40px );
    max-width: 1248px;
    margin: 0 auto;
}

.mg-global-cta__card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 400px;
    overflow: hidden;
    align-items: stretch;
    border-radius: 20px;
    background: #051a55;
    color: #fff;
    text-decoration: none;
    isolation: isolate;
}

.mg-global-cta__card:hover,
.mg-global-cta__card:focus,
.mg-global-cta__card:active {
    color: #fff;
    text-decoration: none;
}

.mg-global-cta__card:focus-visible {
    /* The Themer shell owns a global body a:focus-visible !important rule. */
    outline: 3px solid #ccdcff !important;
    outline-offset: 4px !important;
    box-shadow: none !important;
}

.mg-global-cta__image,
.mg-global-cta__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mg-global-cta__image {
    z-index: -2;
    max-width: none;
    object-fit: cover;
}

.mg-global-cta__overlay {
    z-index: -1;
    /* Match the reference card's left-to-right navy image wash. */
    background: linear-gradient( 90deg in oklch, rgb( 5, 26, 85 ) 0%, rgba( 0, 225, 255, 0 ) 100% );
}

.mg-global-cta__content {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 400px;
    padding: 40px;
    align-items: flex-end;
    flex-direction: row;
    gap: 10px;
}

.mg-global-cta__heading {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    color: #fff;
    font-family: "DM Sans", sans-serif;
    /* Pixel values intentionally mirror the measured Good Shepherd row. */
    font-size: 42px;
    font-weight: 400;
    letter-spacing: -0.84px;
    line-height: 42px;
    /* Keep editor-supplied long words inside the card at browser/text zoom. */
    overflow-wrap: anywhere;
}

.mg-global-cta__button {
    display: inline-flex;
    width: 218px;
    height: 48px;
    min-height: 48px;
    max-width: 100%;
    padding: 14px 24px;
    flex: 0 0 218px;
    align-items: center;
    justify-content: center;
    border: 1px solid #c0d0f3;
    border-radius: 6px;
    background: #ccdcff;
    color: #051a55;
    font-family: "DM Sans", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.36px;
    line-height: 18px;
    text-transform: uppercase;
}

.mg-global-cta__card:hover .mg-global-cta__button,
.mg-global-cta__card:focus-visible .mg-global-cta__button {
    border-color: #000e49;
    background: #051a55;
    color: #fff;
}

/*
 * Good Shepherd keeps the desktop row treatment too long and its fixed button
 * overlaps adjacent cards near 1024px. Preserve the same visual vocabulary but
 * stack each card's internals before that collision can occur.
 */
@media ( max-width: 1100px ) {
    .mg-global-cta__content {
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
        gap: 30px;
    }

    .mg-global-cta__heading {
        width: 100%;
        flex: 0 1 auto;
    }

    .mg-global-cta__button {
        flex-basis: 48px;
    }
}

@media ( max-width: 767px ) {
    .mg-global-cta__inner {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 40px;
    }
}

@media ( forced-colors: active ) {
    .mg-global-cta__card {
        border: 2px solid ButtonText;
    }

    .mg-global-cta__button {
        border: 2px solid ButtonText;
    }
}

@media ( prefers-reduced-motion: reduce ) {
    /* The matched component has no motion; keep this explicit for future edits. */
    .mg-global-cta__card,
    .mg-global-cta__image,
    .mg-global-cta__button {
        transition: none;
    }
}
