/* ─── PhotoSplit ────────────────────────────────────────────
   Ported 1:1 from components/PhotoSplit.tsx.
   Desktop: full-bleed photo absolutely-positioned on the left,
   content-default grid with empty left cell + right cell holding
   text block + 3 cards. Mobile: stacked photo → text → cards.
   ─────────────────────────────────────────────────────────── */

.block-photo-split {
    position: relative;
    overflow: hidden;
    background: var(--bg, var(--slate-50));
}

/* Corners modifier — pull up into prior section so the rounded
   top-right reveals the section above through the curve. */
.block-photo-split--corners {
    margin-top: -40px;
    border-top-right-radius: 40px;
    z-index: 1;
}

/* Parallax inner — absolutely fills the photo-wrap at EVERY breakpoint.
   The <img> inside is height:100%, so it needs a definite-height parent;
   the photo-wrap supplies that (aspect-ratio on mobile, top/bottom on
   desktop). This rule used to live only inside the desktop media query,
   which left the mobile image at its natural ratio inside the 16/11
   wrap — the wrap's bleed colour (slate-100) showed through as a
   grey rectangle. */
.block-photo-split__parallax {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── DESKTOP (md+) ── */
@media (min-width: 768px) {
    .block-photo-split__inner {
        position: relative;
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        gap: 56px;
        min-height: 720px;
        z-index: 2;
    }

    /* Photo wraps out of the grid via absolute positioning — bleeds to
       the viewport's left edge, capped at min(50%+60px, 60vw). */
    .block-photo-split__photo-wrap {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(calc(50% + 60px), 60vw);
        overflow: hidden;
        z-index: 1;
        background: var(--bleed, var(--slate-100));
    }
    .block-photo-split--corners .block-photo-split__photo-wrap {
        border-bottom-left-radius: 40px;
    }
    .block-photo-split__photo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Right column — prose + cards stack */
    .block-photo-split__prose {
        grid-column: 2;
        display: flex;
        flex-direction: column;
        gap: 32px;
        padding-top: 96px;
        padding-bottom: 96px;
        position: relative;
        z-index: 2;
    }
}

/* ── MOBILE (<md) ── */
@media (max-width: 767px) {
    .block-photo-split__inner {
        display: flex;
        flex-direction: column;
        padding-bottom: 48px;
    }
    .block-photo-split__photo-wrap {
        order: 1;
        /* Full-bleed to both viewport edges. `width: 100%` only equals
           the inner's CONTENT box (viewport minus 2×--section-px), so
           with the negative side margins the wrap still landed
           2×--section-px narrow — leaving section-background gaps beside
           the photo. Add that width back so it spans edge to edge. */
        width: calc(100% + 2 * var(--section-px));
        aspect-ratio: 16 / 11;
        position: relative;
        margin-left: calc(-1 * var(--section-px));
        margin-right: calc(-1 * var(--section-px));
        background: var(--bleed, var(--slate-100));
        overflow: hidden;
    }
    .block-photo-split__photo {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .block-photo-split__prose {
        order: 2;
        padding: 40px var(--section-px) 0;
        display: flex;
        flex-direction: column;
        gap: 26px;
    }
}

/* ── Text content ── */
.block-photo-split__eyebrow {
    margin-bottom: 26px;
    /* the .eyebrow .eyebrow--clay utility classes already provide font/color */
}

.block-photo-split__headline {
    margin: 0;
    color: var(--slate-700);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--display-sm);
    line-height: 1.05;
    letter-spacing: -1.5px;
    text-transform: uppercase;
}
.block-photo-split__headline p {
    margin: 0;
    font: inherit;
    color: inherit;
}
@media (max-width: 767px) {
    .block-photo-split__headline {
        letter-spacing: -1px;
    }
}

.block-photo-split__body {
    margin: 0;
    max-width: 540px;
    color: var(--slate-500);
    font-family: var(--font-body);
    font-size: var(--body-md);
    line-height: 1.75;
}
.block-photo-split__body p {
    margin: 0;
    font: inherit;
    color: inherit;
}
.block-photo-split__body p + p {
    margin-top: 16px;
}
@media (max-width: 767px) {
    .block-photo-split__body {
        line-height: 1.65;
    }
}

/* ── Cards stack ── */
.block-photo-split__cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (max-width: 767px) {
    .block-photo-split__cards {
        margin-top: 6px;
    }
}

.block-photo-split__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: white;
    border: 1px solid var(--slate-100);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}

/* Number "01" sits top-left; arrow "→" sits top-right. The PHP doesn't
   emit a separate arrow element, so use a ::after on the card-number. */
.block-photo-split__card-number {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: var(--slate-300);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--label-md);
}
.block-photo-split__card-number::after {
    content: "→";
    color: var(--slate-500);
    font-size: var(--body-md);
}

.block-photo-split__card-title {
    color: var(--slate-700);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--body-lg);
}
@media (max-width: 767px) {
    .block-photo-split__card-title {
        font-size: var(--body-md);
    }
}

.block-photo-split__card-desc {
    color: var(--slate-500);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--label-lg);
    line-height: 1.55;
}

/* Decorative MaskBlock at top-right of photo. Anchored absolutely so it
   sits flush with the photo's top-right corner and bleeds into the section
   bg above the photo. Hidden on mobile (no overlap to bridge). */
.block-photo-split__mask-anchor {
    position: absolute;
    right: 0;
    top: -3px;
    z-index: 2;
    pointer-events: none;
}
@media (max-width: 767px) {
    .block-photo-split__mask-anchor {
        display: none;
    }
}
