/* Content + Image block (blocks/content-image-block) */
.content-image-block {
    --content-image-offset: 0px;
    position: relative;
    background-color: var(--bg-color, #001744);
}

.content-image-inner {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--text-white, #fff);
    border-radius: 16px;
    overflow: visible;
}

.content-image-text {
    flex: 1 1 80%;
    order: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding:20px;
}

.content-image-heading {
    margin: 0 0 20px;
    font-weight: 800;
    font-style: italic;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -0.6px;
    background: linear-gradient(270deg, #182D82 72.96%, #153290 80.01%, #13359A 84.96%, #034CE3 91.86%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #182D82; /* fallback for browsers without background-clip: text support */
}

.content-image-copy {
    color: #182D82;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.45px;
}

.content-image-copy > *:last-child {
    margin-bottom: 0;
}

.content-image-media {
    position: relative;
    flex: 1 1 45%;
    order: 2;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 272px;
    /* Desktop-only vertical offset (ACF "Image Vertical Offset (Desktop)"
       field); reset to 0 in the mobile media query below. */
    margin-top: var(--content-image-offset);
}

.content-image-media img {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
}

/* Desktop: let the image bleed above/below the card and shift vertically. */
.content-image-media img.content-image-desktop {
    width: auto;
    height: 100%;
    max-height:344px;
}

.content-image-media img.content-image-mobile {
    display: none;
}

.content-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
    border: 1px dashed #c9c9c9;
    border-radius: 8px;
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Mobile stacking order: default is text first, then image. */
@media (max-width: 767px) {
    .content-image-block {
        padding: 0px 16px;
    }

    .content-image-inner {
        flex-direction: column;
        border-radius: 12px;
        overflow: hidden;
    }

    .content-image-text {
        order: 1;
        padding: 28px 24px;
        text-align: center;
    }

    .content-image-heading {
        font-size: 28px;
        letter-spacing: -0.56px;
    }

    .content-image-copy {
        font-size: 16px;
        letter-spacing: -0.4px;
    }

    .content-image-media {
        order: 2;
        min-height: 0;
        margin-top:0;
    }

    .content-image-media img.content-image-desktop {
        display: none;
    }

    .content-image-media img.content-image-mobile {
        display: block;
        position: static;
        transform: none;
        width: 50%;
        max-width: none;
        height: auto;
    }

    /* mobile_order = image_first: flip the image above the text. */
    .content-image-block.mobile-order-image_first .content-image-text {
        order: 2;
    }

    .content-image-block.mobile-order-image_first .content-image-media {
        order: 1;
    }
}
