/* ============================================================
   BEINC — PDP Success Statement (Section CSS)

   White cream background. Sits above overview (z:3) so it
   "covers" the overview as the user scrolls.

   Layout — desktop:
     • 20vh top + bottom padding
     • Full content respects global pad-x on left/right
     • 2 columns: text col (40vw) + grid col (60vw)
     • Text col: heading + body group (top), asterisk (bottom-left
       of column, infinite clockwise rotation)
     • Grid col: 2x2 cells, content centered. Dashed lines:
         - 3 vertical (left, mid, right of grid) — height = grid only
         - 3 horizontal (top, mid, bottom of grid) — extend to right
           edge of screen (no padding)

   Tablet: same 2-column layout, smaller text.

   Mobile: stacked. Title row has heading (left) + asterisk (right
   with space-between). Below it: body. Below that: 2x2 grid (vert
   line in middle only, 3 horiz lines).
   ============================================================ */


.pdp-success {
    position: relative;
    z-index: 3;
    background: var(--color-white);
    color: var(--color-black2);
    padding: 20vh 0;
    isolation: isolate;
}

.pdp-success__inner {
    display: grid;
    /* 40vw text + 60vw grid would sum to 100vw and overflow when we add
       left padding. Reserve pad-x in the text column instead so the grid
       column reaches exactly to the right edge. */
    grid-template-columns: 40vw 60vw;
    align-items: stretch;
    /* No padding here — left pad is applied INSIDE the text column so
       the right-side grid column extends edge-to-edge for the dashed
       horizontal lines. */
}

.pdp-success__col {
    display: flex;
    flex-direction: column;
}

.pdp-success__col--text {
    justify-content: space-between;
    gap: var(--space-9);
    /* IMPORTANT — use 2vw (NOT var(--pad-x)) so the left padding matches
       the global page padding regardless of column width. var(--pad-x) is
       `2%` and would resolve against THIS COLUMN's width (40vw on desktop)
       → smaller than the page-level 2vw rhythm. */
    padding-left: 2vw;
    padding-right: var(--space-8);
}

.pdp-success__intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);   /* 32px — gives the body more breathing room from the heading */
}

.pdp-success__heading {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--tracking-tight);
    font-size: clamp(20px, 1.8vw, 28px);
    line-height: var(--leading-tight);
    color: var(--color-black2);
    margin: 0;
}

/* Success body wrapper — holds N <p> children rendered by the binder.
   Same pattern as .pdp-hero__body. */
.pdp-success__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 50ch;
    margin: 0;
}

.pdp-success__body p {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    line-height: var(--leading-relaxed);
    color: var(--color-black2);
    letter-spacing: var(--tracking-body);
    margin: 0;
}

.pdp-success__asterisk {
    display: inline-flex;
    width: 21px;
    height: auto;
    color: var(--color-black2);
    /* Continuous clockwise rotation */
    animation: pdp-asterisk-spin 8s linear infinite;
    transform-origin: center center;
}

.pdp-success__asterisk svg {
    width: 100%;
    height: auto;
    display: block;
}

.pdp-success__asterisk svg path {
    fill: currentColor;
}

@keyframes pdp-asterisk-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


/* ============================================================
   GRID — 2 cols × 2 rows of cells with dashed-line guides
   ============================================================ */
.pdp-success__col--grid {
    /* Padding-right of 2vw matches the global page padding. Horizontal
       guide lines below break out and extend to the right screen edge
       via right: calc(-1 * 2vw). Same vw rationale as the text col. */
    padding-right: 2vw;
    position: relative;
    overflow: visible;     /* let horiz guides overflow to the right edge */
}

.pdp-success__grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    min-height: 240px;
    /* Let cell content drive height; dashed lines absolutely positioned
       relative to this container. */
}

.pdp-success__guide {
    position: absolute;
    background: none;
    pointer-events: none;
}

/* Vertical guides — section-level absolutes that span the FULL
   section height (top: 0; bottom: 0). x-coords are tied to the
   grid container's column boundaries — they shift per breakpoint
   to track the changing column proportions and inner-padding. */
.pdp-success__guide--vert {
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px dashed var(--color-greyish);
}

/* Desktop: text col 40vw, grid col 60vw with 2vw inner pad-right.
   Grid container = 40vw → 98vw. Mid = 69vw. */
.pdp-success__guide--vert-left   { left: 40vw; }
.pdp-success__guide--vert-mid    { left: 69vw; transform: translateX(-0.5px); }
.pdp-success__guide--vert-right  { left: 98vw; transform: translateX(-1px); }

/* Mobile-only vert line — hidden by default, shown via the @media query
   for ≤767px. (Anchored inside the grid container so its top aligns
   with the grid top, not the section top.) */
.pdp-success__guide--vert-mid-mobile {
    display: none;
}

/* Horizontal guides — span from left of grid to RIGHT EDGE OF SCREEN
   (overflow to the right by exactly 2vw, matching the col's right pad). */
.pdp-success__guide--horiz {
    left: 0;
    right: -2vw;
    height: 0;
    border-top: 1px dashed var(--color-greyish);
}
.pdp-success__guide--horiz-top    { top: 0; }
.pdp-success__guide--horiz-mid    { top: 50%; transform: translateY(-0.5px); }
.pdp-success__guide--horiz-bottom { bottom: 0; transform: translateY(1px); }


/* Cell content — centered both axes */
.pdp-success__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-7) var(--space-5);
    text-align: center;
}

.pdp-success__cell-title {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--tracking-tight);
    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1;
    color: var(--color-black2);
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
}

.pdp-success__cell-num {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    color: var(--color-black2);
}

.pdp-success__cell-body {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
    color: var(--color-black2);
    letter-spacing: var(--tracking-body);
    margin: 0;
    max-width: 32ch;
}


/* ============================================================
   RESPONSIVE — TABLET (768–1023px)
   ============================================================ */
@media (max-width: 1023px) {
    .pdp-success {
        padding: 16vh 0;
    }

    .pdp-success__inner {
        grid-template-columns: 38vw 62vw;
    }

    .pdp-success__col--text {
        padding-left: 4vw;       /* matches global pad-x at this breakpoint */
        padding-right: var(--space-6);
    }

    .pdp-success__col--grid {
        padding-right: 4vw;
    }

    .pdp-success__guide--horiz {
        right: -4vw;             /* overflow to right edge with the new pad */
    }

    /* Tablet: text col 38vw, grid col 62vw with 4vw inner pad-right.
       Grid container = 38vw → 96vw. Mid = 67vw. */
    .pdp-success__guide--vert-left   { left: 38vw; }
    .pdp-success__guide--vert-mid    { left: 67vw; }
    .pdp-success__guide--vert-right  { left: 96vw; }
}


/* ============================================================
   RESPONSIVE — MOBILE (≤767px)
   Stacked layout. Heading row has heading (left) + asterisk (right).
   Body below. Grid below: 2x2 with only vertical mid line + 3 horiz.
   ============================================================ */
@media (max-width: 767px) {
    .pdp-success {
        padding: 12vh 0;
    }

    .pdp-success__inner {
        grid-template-columns: 1fr;
        gap: var(--space-7);
        /* No padding here — left pad on text col, no left pad on grid col
           (horizontal lines extend to right screen edge). */
    }

    .pdp-success__col--text {
        padding-left: 4vw;
        padding-right: 4vw;
        gap: var(--space-4);
    }

    /* Title row: heading left, asterisk right (space-between).
       Mobile keeps a slightly tighter gap than desktop but still
       has noticeable breathing room between heading and body. */
    .pdp-success__intro {
        flex-direction: column;
        gap: var(--space-5);   /* 24px — bumped up from 12px */
    }

    /* Pull asterisk INTO the intro group, top-row, right-aligned with the heading.
       We re-arrange via flex order on a flex parent. */
    .pdp-success__col--text {
        position: relative;
    }

    .pdp-success__asterisk {
        position: absolute;
        top: 0;
        right: 4vw;
        align-self: flex-start;
        width: 18px;
    }

    .pdp-success__heading {
        font-size: 18px;
        padding-right: 32px;        /* leave space for asterisk top-right */
    }

    .pdp-success__col--grid {
        padding-left: 4vw;
        padding-right: 4vw;
    }

    .pdp-success__grid {
        min-height: 200px;
    }

    /* Mobile: hide ALL section-level vertical lines. The mobile vert-mid
       lives INSIDE the grid container (.pdp-success__grid) so its top
       aligns with the grid's top edge — not the section's top. See the
       --vert-mid-mobile rule below. */
    .pdp-success__guide--vert-left,
    .pdp-success__guide--vert-right,
    .pdp-success__guide--vert-mid {
        display: none;
    }

    /* Mobile vert-mid — anchored inside the grid container.
       grid is `position: relative` (set below). top: 0 = grid's top edge.
       bottom: -12vh extends past the grid's bottom by the section
       padding-bottom amount, reaching the section's bottom edge.
       left: 50% = horizontal center of the grid container (which is
       already centered inside the col-grid via equal 4vw padding). */
    .pdp-success__guide--vert-mid-mobile {
        display: block;
        position: absolute;
        top: 0;
        bottom: -12vh;
        left: 50%;
        width: 0;
        border-left: 1px dashed var(--color-greyish);
        transform: translateX(-0.5px);
    }

    /* Make grid container the positioned ancestor for the mobile vert line. */
    .pdp-success__grid {
        position: relative;
    }

    /* Mobile: horizontal lines extend ALL the way left + right to the
       screen edges (no inner gap). The grid container sits inside col-grid's
       4vw padding-left, so we need to overflow leftward by that pad. */
    .pdp-success__guide--horiz {
        left: -4vw;
        right: -4vw;
    }

    /* Mobile vertical mid line stops inside the grid (already does — grid-bound). */

    .pdp-success__cell {
        padding: var(--space-5) var(--space-3);
    }

    .pdp-success__cell-title {
        font-size: 14px;
    }

    .pdp-success__cell-body {
        font-size: 12px;
    }
}
