/* CTA: a floating card that straddles the section above and the footer by --portola-cta-overlap each way (both
 * neighbours add that space back). The cta_image photo sits under a deep-primary wash; heading and description on the
 * left, the secondary CTA and a white outline call button on the right. */
:root { --portola-cta-overlap: 150px; }

.ocf-cta {
    position: relative;
    z-index: 2;
    margin-block: calc(var(--portola-cta-overlap) * -1);
}

/* Room for the halves of the card that sit over the section above and over the footer. */
:has(+ .ocf-cta) { padding-bottom: calc(var(--section-pad) + var(--portola-cta-overlap)); }
body:has(.ocf-cta) .ocf-footer { padding-top: var(--portola-cta-overlap); }

.ocf-cta-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--ocf-grid-gap) * 1.75);
    min-height: calc(var(--portola-cta-overlap) * 2);
    padding: calc(var(--ocf-space-unit) * 4.5) calc(var(--ocf-space-unit) * 4);
    border: 1px solid color-mix(in srgb, var(--ocf-heading-alt) 16%, transparent);
    background: var(--portola-deep);
    color: var(--ocf-body-alt);
}

.ocf-cta-card__photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
}

.ocf-cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--portola-deep) 94%, transparent) 0%,
        color-mix(in srgb, var(--portola-deep) 86%, transparent) 55%,
        color-mix(in srgb, var(--portola-deep) 62%, transparent) 100%);
}

.ocf-cta-copy { max-width: 640px; }

.ocf-cta .heading-2 {
    margin: 0;
    color: var(--ocf-heading-alt);
    font-size: clamp(30px, 2.8vw, 42px);
}

.ocf-cta-description {
    max-width: 36rem;
    margin: calc(var(--ocf-space-unit) * 0.875) 0 0;
}

.ocf-cta-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    gap: calc(var(--ocf-space-unit) * 0.875);
}

.ocf-cta .btn-primary { background: var(--ocf-secondary); color: var(--ocf-secondary-contrast); }
.ocf-cta .btn-primary:hover { background: var(--ocf-secondary-hover); color: var(--ocf-secondary-contrast); }

@media (max-width: 1023px) {
    :root { --portola-cta-overlap: 90px; }
    .ocf-cta-card {
        flex-direction: column;
        align-items: flex-start;
        padding: calc(var(--ocf-space-unit) * 3.25) calc(var(--ocf-space-unit) * 2);
    }
}

@media (max-width: 560px) {
    .ocf-cta-actions { flex-direction: column; align-items: stretch; width: 100%; }
    .ocf-cta-actions > * { width: 100%; }
}
