/*
  WumeHealth — Pathways page DESKTOP layout overrides (Stage 2)
  ----------------------------------------------------------------------------
  Scope: every rule is prefixed `body.is-pathways-page` AND wrapped in
  `@media (min-width: 992px)` so the already-synced MOBILE view (<992px),
  which lives in wume.css, is left completely untouched.

  This file is linked from templates/pages/pathways.html.twig via {% block head %}.
  It does NOT modify wume.css or base.html.twig.

  Implements the Stage-2 desktop spec for "pathways":
    - Dr.Wu intro split: stone band; right column carries the heading, the
      "GUIDED CARE FROM DAY ONE" kicker, and the body paragraph.
    - featured-pathways: sand band; "SIGNATURE PATHWAYS" kicker top-right,
      heading left; full-width 5-row accordion (Metabolic expanded default).
    - how-it-works: stone band; CTA is an underlined text link; flow diagram
      panel painted lbrown (#715434).
  V02 adds the Stage-2b MOBILE block (@media max-width:991.98px) — see the
      banner comment lower in this file. Desktop (>=992px) block is untouched.
*/

@media (min-width: 992px) {

    /* ====================================================================
       Dr. Wu intro split  (#integrated-care)
       Stone band (no wume-section-alt in template). Image LEFT in a narrow
       column, the heading + kicker + body stacked in the RIGHT column.
       ==================================================================== */
    body.is-pathways-page #integrated-care .wume-split {
        display: grid;
        grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
        column-gap: 80px;
        align-items: start;
    }
    body.is-pathways-page #integrated-care .wume-split > .wume-img-placeholder {
        aspect-ratio: 4 / 5;
        min-height: auto;
        padding: 0;
    }
    body.is-pathways-page #integrated-care .wume-split > .wume-img-placeholder img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* The right column: heading first, then the relocated kicker, then body. */
    body.is-pathways-page #integrated-care .wume-drwu-copy .wume-section-title {
        margin: 0 0 28px;
    }
    body.is-pathways-page #integrated-care .wume-drwu-kicker {
        display: block;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: var(--wume-tracking-caps);
        text-transform: uppercase;
        line-height: 1.35;
        max-width: 9em;
        margin: 0 0 16px;
    }
    body.is-pathways-page #integrated-care .wume-drwu-copy > p {
        margin: 0;
        max-width: 30em;
    }

    /* ====================================================================
       Featured pathways  (#featured-pathways) — full-width accordion
       Sand band. Header row: heading LEFT, "SIGNATURE PATHWAYS" kicker
       top-RIGHT. Then 5 stacked full-width rows with +/- toggles.
       ==================================================================== */
    body.is-pathways-page #featured-pathways .container {
        max-width: 1440px;
        padding-left: 36px;
        padding-right: 36px;
    }

    /* Header: heading left, kicker pinned top-right on the same band. */
    body.is-pathways-page .wume-pw-acc-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 36px;
    }
    body.is-pathways-page .wume-pw-acc-head .wume-section-title {
        margin: 0;
        max-width: 14em;
        text-align: left;
    }
    body.is-pathways-page .wume-pw-acc-head .wume-pw-acc-kicker {
        margin: 8px 0 0;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: var(--wume-tracking-caps);
        text-transform: uppercase;
        white-space: nowrap;
    }

    /* Accordion rows. */
    body.is-pathways-page .wume-pw-acc {
        display: block;
    }
    body.is-pathways-page .wume-pw-acc-item {
        border-top: 1px solid rgba(77, 61, 45, 0.28);
    }
    body.is-pathways-page .wume-pw-acc-item:last-child {
        border-bottom: 1px solid rgba(77, 61, 45, 0.28);
    }

    /* Row header: title (serif) left, +/- glyph right. */
    body.is-pathways-page .wume-pw-acc-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 24px;
        width: 100%;
        padding: 36px 8px;
        background: transparent;
        border: 0;
        text-align: left;
        cursor: pointer;
        color: inherit;
    }
    body.is-pathways-page .wume-pw-acc-title {
        font-family: var(--wume-font-heading);
        font-weight: 300;
        font-size: 1.9rem;
        line-height: 1.15;
        margin: 0;
    }
    body.is-pathways-page .wume-pw-acc-sign {
        flex: 0 0 auto;
        font-family: var(--wume-font-body);
        font-weight: 300;
        font-size: 1.6rem;
        line-height: 1;
        margin-top: 4px;
    }
    /* Plus when collapsed, minus when the item carries .is-open. */
    body.is-pathways-page .wume-pw-acc-sign::before {
        content: "+";
    }
    body.is-pathways-page .wume-pw-acc-item.is-open .wume-pw-acc-sign::before {
        content: "\2212"; /* minus */
    }

    /* Expanded body: hidden unless the item is open. */
    body.is-pathways-page .wume-pw-acc-body {
        display: none;
        padding: 0 8px 44px;
    }
    body.is-pathways-page .wume-pw-acc-item.is-open .wume-pw-acc-body {
        display: block;
    }

    /* Expanded body layout: LEFT meta column (duration + paragraph + inset
       image) and RIGHT bullet list, sitting under the row title. */
    body.is-pathways-page .wume-pw-acc-grid {
        display: grid;
        grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 40px;
        align-items: start;
    }
    body.is-pathways-page .wume-pw-acc-duration {
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: var(--wume-tracking-caps);
        text-transform: uppercase;
        margin: 0;
    }
    body.is-pathways-page .wume-pw-acc-lead {
        margin: 0 0 24px;
        max-width: 30em;
    }
    body.is-pathways-page .wume-pw-acc-lead-col {
        grid-column: 2;
    }
    /* Small aesthetic inset image (or placeholder) sits below the paragraph. */
    body.is-pathways-page .wume-pw-acc-inset {
        width: 152px;
        height: 130px;
        min-height: 0;
        margin: 0;
    }
    body.is-pathways-page .wume-pw-acc-inset img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* Right bullet list — small uppercase items. */
    body.is-pathways-page .wume-pw-acc-list {
        grid-column: 3;
        list-style: none;
        margin: 0;
        padding: 0;
        max-width: 22em;
    }
    body.is-pathways-page .wume-pw-acc-list li {
        position: relative;
        padding-left: 18px;
        margin-bottom: 16px;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        line-height: 1.5;
    }
    body.is-pathways-page .wume-pw-acc-list li::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.45em;
        width: 5px;
        height: 5px;
        background: currentColor;
    }

    /* ====================================================================
       How It Works  (#how-it-works)
       Stone band (no wume-section-alt in template). Left column aligns to
       the top (heading high, kicker/body lower). CTA becomes an underlined
       text link. Flow-diagram panel painted lbrown.
       ==================================================================== */
    body.is-pathways-page #how-it-works .wume-split {
        align-items: start;
    }
    body.is-pathways-page #how-it-works .wume-hiw-copy {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        min-height: 100%;
    }
    /* Push the kicker + body + link down, leaving the heading near the top. */
    body.is-pathways-page #how-it-works .wume-hiw-copy .wume-section-title {
        margin: 0 0 auto;
    }
    body.is-pathways-page #how-it-works .wume-hiw-copy .wume-hero-tagline {
        margin-top: 120px;
    }

    /* CTA: underlined text link instead of the filled button. */
    body.is-pathways-page #how-it-works .wume-hiw-cta {
        appearance: none;
        background: transparent;
        border: 0;
        padding: 0;
        margin-top: 28px;
        color: inherit;
        font-family: var(--wume-font-body);
        font-weight: 500;
        font-size: 0.85rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 3px;
        cursor: pointer;
    }
    body.is-pathways-page #how-it-works .wume-hiw-cta:hover {
        text-decoration-thickness: 2px;
    }

    /* Flow-diagram panel: lbrown (#715434) instead of the darker brown. */
    body.is-pathways-page .wume-pathway-flow-bg {
        fill: var(--wume-lbrown);
    }
    body.is-pathways-page .wume-pathway-flow {
        max-width: 100%;
    }
}

/* ============================================================================
   STAGE 2b — MOBILE layout (<=991.98px, target 393px)
   ----------------------------------------------------------------------------
   Pixel-matches figma-final/screens/mobile/pathways.png (393 wide, 1px=1px).
   Every rule below is scoped `body.is-pathways-page` AND wrapped in
   @media (max-width:991.98px), so the desktop block above stays untouched.

   The HERO mobile reflow is already handled in wume.css V37
   (`body.is-pathways-page` @media <992 block): single-column stack, body
   below heading, jump-links stacked left. We do NOT restate it here.

   Figma mobile section map (content gutter = 24px each side):
     1. Dr.Wu (#integrated-care, cream): full-width 4:5 photo -> heading
        -> "GUIDED CARE FROM DAY ONE" kicker (left) -> indented body.
     2. Featured (#featured-pathways, sand): "SIGNATURE PATHWAYS" kicker
        pinned top-RIGHT -> heading left -> stack of bordered accordion
        cards. Expanded card stacks: title+sign, inset photo, duration,
        lead paragraph, bullet list.
     3. How It Works (#how-it-works, cream): lbrown flow-diagram panel
        FIRST -> heading -> "HOW IT WORKS" kicker -> indented body ->
        "START WITH WUME" underlined text link.
   ========================================================================== */
@media (max-width: 991.98px) {

    /* Page content gutter: stock Bootstrap .container is 12px each side
       below 576px; Figma wants 24px. Bump it for this page's sections. */
    body.is-pathways-page #integrated-care .container,
    body.is-pathways-page #featured-pathways .container,
    body.is-pathways-page #how-it-works .container {
        padding-left: 24px;
        padding-right: 24px;
    }

    /* ====================================================================
       1. Dr. Wu intro split  (#integrated-care) — cream band
       Image full-bleed (within the 24px gutter), then heading, the
       relocated "GUIDED CARE FROM DAY ONE" kicker, then the INDENTED body.
       The base 991.98 .wume-split rule already stacks the split 1-up with
       the image first (DOM order), so no reorder is needed here.
       ==================================================================== */
    body.is-pathways-page #integrated-care .wume-split {
        gap: 28px;
    }
    body.is-pathways-page #integrated-care .wume-split > .wume-img-placeholder {
        aspect-ratio: 4 / 5;
        width: 100%;
        min-height: 0;
        padding: 0;
    }
    body.is-pathways-page #integrated-care .wume-split > .wume-img-placeholder img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* Heading — override the template's inline 2.6rem so it scales on mobile. */
    body.is-pathways-page #integrated-care .wume-drwu-copy .wume-section-title {
        font-size: 1.8rem !important;
        line-height: 1.18;
        margin: 0 0 22px;
    }
    /* Kicker: small uppercase, two short lines, left-aligned (no inline style
       on this element, so it would otherwise render as an unstyled <p>). */
    body.is-pathways-page #integrated-care .wume-drwu-kicker {
        display: block;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: var(--wume-tracking-caps);
        text-transform: uppercase;
        line-height: 1.4;
        max-width: 9em;
        margin: 0 0 24px;
    }
    /* Body paragraph: indented ~40px from the content edge per Figma. */
    body.is-pathways-page #integrated-care .wume-drwu-copy > p {
        margin: 0 0 0 40px;
        font-size: 0.95rem;
        line-height: 1.55;
    }

    /* ====================================================================
       2. Featured pathways  (#featured-pathways) — sand band
       Header: "SIGNATURE PATHWAYS" kicker pinned top-RIGHT, heading below
       it on the LEFT. Then a vertical stack of bordered accordion cards.
       ==================================================================== */
    body.is-pathways-page .wume-pw-acc-head {
        display: block;
        margin-bottom: 32px;
    }
    body.is-pathways-page .wume-pw-acc-head .wume-pw-acc-kicker {
        display: block;
        text-align: right;
        margin: 0 0 40px;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: var(--wume-tracking-caps);
        text-transform: uppercase;
        line-height: 1.4;
    }
    body.is-pathways-page .wume-pw-acc-head .wume-section-title {
        margin: 0;
        text-align: left;
        font-size: 1.8rem;
        line-height: 1.18;
    }

    /* Accordion = vertical stack of cards with a small gap. Each card has a
       subtle lighter fill, a hairline border, and rounded corners. */
    body.is-pathways-page .wume-pw-acc {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    body.is-pathways-page .wume-pw-acc-item {
        background: rgba(255, 255, 255, 0.22);
        border: 1px solid rgba(77, 61, 45, 0.18);
        border-radius: 4px;
    }

    /* Collapsed row header: serif title left (may wrap to 2 lines), +/- right. */
    body.is-pathways-page .wume-pw-acc-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
        padding: 24px 22px;
        background: transparent;
        border: 0;
        text-align: left;
        cursor: pointer;
        color: inherit;
    }
    body.is-pathways-page .wume-pw-acc-title {
        font-family: var(--wume-font-heading);
        font-weight: 300;
        font-size: 1.55rem;
        line-height: 1.15;
        margin: 0;
    }
    body.is-pathways-page .wume-pw-acc-sign {
        flex: 0 0 auto;
        font-family: var(--wume-font-body);
        font-weight: 300;
        font-size: 1.5rem;
        line-height: 1;
        margin-top: 2px;
    }
    body.is-pathways-page .wume-pw-acc-sign::before {
        content: "+";
    }
    body.is-pathways-page .wume-pw-acc-item.is-open .wume-pw-acc-sign::before {
        content: "\2212"; /* minus */
    }

    /* Expanded body: hidden unless the item is open. */
    body.is-pathways-page .wume-pw-acc-body {
        display: none;
        padding: 0 22px 28px;
    }
    body.is-pathways-page .wume-pw-acc-item.is-open .wume-pw-acc-body {
        display: block;
    }

    /* Expanded body is a single column. Markup order is duration ->
       (lead paragraph + inset image) -> list, but Figma mobile shows
       inset image FIRST (right-aligned), then duration, lead, list.
       `display:contents` lifts the lead-col's children (lead + inset) into
       the flex flow so `order` can place the inset above the duration. */
    body.is-pathways-page .wume-pw-acc-grid {
        display: flex;
        flex-direction: column;
    }
    body.is-pathways-page .wume-pw-acc-lead-col {
        display: contents;
    }
    /* Inset photo first, right-aligned within the card. (TODO-ASSET: empty
       placeholder until the aesthetics treatment image is supplied.) */
    body.is-pathways-page .wume-pw-acc-inset {
        order: 1;
        width: 128px;
        height: 135px;
        min-height: 0;
        margin: 0 0 28px auto;
    }
    body.is-pathways-page .wume-pw-acc-inset img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    body.is-pathways-page .wume-pw-acc-duration {
        order: 2;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: var(--wume-tracking-caps);
        text-transform: uppercase;
        margin: 0 0 18px;
    }
    body.is-pathways-page .wume-pw-acc-lead {
        order: 3;
        margin: 0 0 26px;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    body.is-pathways-page .wume-pw-acc-list {
        order: 4;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    body.is-pathways-page .wume-pw-acc-list li {
        position: relative;
        padding-left: 20px;
        margin-bottom: 18px;
        font-family: var(--wume-font-body);
        font-weight: var(--wume-w-sub);
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        line-height: 1.45;
    }
    body.is-pathways-page .wume-pw-acc-list li:last-child {
        margin-bottom: 0;
    }
    body.is-pathways-page .wume-pw-acc-list li::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.4em;
        width: 5px;
        height: 5px;
        background: currentColor;
    }

    /* ====================================================================
       3. How It Works  (#how-it-works) — cream band
       Figma mobile order: lbrown flow-diagram panel FIRST, then heading,
       "HOW IT WORKS" kicker, indented body, "START WITH WUME" link. The
       template puts .wume-hiw-copy before the diagram, so flip their order.
       ==================================================================== */
    body.is-pathways-page #how-it-works .wume-split {
        display: flex;
        flex-direction: column;
        gap: 28px;
    }
    body.is-pathways-page #how-it-works .wume-split > div:last-child {
        order: 1; /* diagram panel to the top */
    }
    body.is-pathways-page #how-it-works .wume-hiw-copy {
        order: 2; /* copy below the diagram */
        display: block;
    }
    /* Heading — override the template inline 2.6rem so it scales on mobile. */
    body.is-pathways-page #how-it-works .wume-hiw-copy .wume-section-title {
        font-size: 1.8rem !important;
        line-height: 1.18;
        margin: 0 0 28px;
    }
    /* "HOW IT WORKS" kicker (uses .wume-hero-tagline base styling). */
    body.is-pathways-page #how-it-works .wume-hiw-copy .wume-hero-tagline {
        margin: 0 0 22px;
    }
    /* Body paragraph: indented ~40px from the content edge per Figma. */
    body.is-pathways-page #how-it-works .wume-hiw-copy > p:not(.wume-hero-tagline) {
        margin: 0 0 0 40px;
        font-size: 0.95rem;
        line-height: 1.55;
    }
    /* CTA: underlined text link instead of the filled button, indented to
       align with the body paragraph above it. */
    body.is-pathways-page #how-it-works .wume-hiw-cta {
        appearance: none;
        background: transparent;
        border: 0;
        padding: 0;
        margin: 28px 0 0 40px;
        color: inherit;
        font-family: var(--wume-font-body);
        font-weight: 500;
        font-size: 0.8rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 3px;
        cursor: pointer;
    }

    /* Flow-diagram panel: lbrown fill (base is darker brown), full content
       width within the 24px gutter. Base wume.css caps it at 340px and
       centers it; restate to span the gutter exactly like Figma. */
    body.is-pathways-page .wume-pathway-flow-bg {
        fill: var(--wume-lbrown);
    }
    body.is-pathways-page .wume-pathway-flow {
        max-width: 100%;
        margin: 0;
    }
}
