/* V32 — Program detail page cohesion and spacing polish.
   Loaded after V30/V31 so this layer only refines the current program detail page. */

.v30-program-page {
    --v32-navy: #0a2d59;
    --v32-blue: #0d66cc;
    --v32-cyan: #42b8e8;
    --v32-soft: #f4f8fc;
    --v32-line: #dce7f1;
    --v32-muted: #64798f;
}

/* Hero + impact rail feel like one composition. */
.v30-program-page .v30-program-hero .v3-program-hero-content {
    width: min(1180px, calc(100% - 56px));
}

.v30-program-page .v30-program-hero .v3-program-hero-content > div {
    max-width: 760px;
}

.v30-program-page .v30-program-hero h1 {
    max-width: 760px;
    letter-spacing: -.035em !important;
}

.v30-program-page .v30-program-hero p {
    max-width: 620px !important;
}

.v30-program-page .v3-impact-rail {
    width: min(1120px, calc(100% - 56px));
    margin-top: -34px;
    border-radius: 20px;
    border-color: #dce7f1;
    box-shadow: 0 18px 50px rgba(9, 43, 85, .10);
}

.v30-program-page .v3-impact-item {
    padding: 24px 28px;
}

.v30-program-page .v3-impact-item strong {
    font-size: clamp(32px, 3vw, 42px);
    letter-spacing: -.025em;
}

/* Story: less empty vertical space and a stronger editorial image/text lockup. */
.v30-program-page .v32-story-section {
    padding: 86px 0 92px !important;
}

.v30-program-page .v32-story-section .v3-program-story {
    width: min(1120px, calc(100% - 56px));
    grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr);
    gap: clamp(52px, 7vw, 92px);
    align-items: center;
}

.v30-program-page .v32-story-section .v3-program-story-media {
    position: relative;
    top: auto;
}

.v30-program-page .v32-story-section .v3-program-story-media::before {
    content: "";
    position: absolute;
    inset: 18px -18px -18px 18px;
    border-radius: 28px;
    background: #e9f3fb;
    z-index: 0;
}

[dir="rtl"] .v30-program-page .v32-story-section .v3-program-story-media::before {
    inset: 18px 18px -18px -18px;
}

.v30-program-page .v32-story-section .v3-program-story-media img {
    position: relative;
    z-index: 1;
    aspect-ratio: 4 / 5;
    border-radius: 26px;
    box-shadow: 0 18px 44px rgba(8, 43, 84, .09);
}

.v30-program-page .v32-story-section .v3-program-story-copy {
    max-width: 650px;
}

.v30-program-page .v32-story-section .v3-program-story-copy h2 {
    font-size: clamp(42px, 4.5vw, 60px);
    line-height: 1.04;
    margin-bottom: 24px;
    text-wrap: balance;
}

.v30-program-page .v32-story-section .v3-program-copy {
    font-size: 15px;
    line-height: 1.85;
    color: #5f7389;
}

/* Priorities: a contained soft section with a cleaner editorial list. */
.v30-program-page .v30-priorities-section {
    padding: 86px 0 !important;
    background: var(--v32-soft) !important;
    border-top: 1px solid #edf3f8;
    border-bottom: 1px solid #e7eff6;
}

.v30-program-page .v30-priorities-shell {
    width: min(1120px, calc(100% - 56px));
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
    gap: clamp(54px, 7vw, 92px);
    align-items: center;
}

.v30-program-page .v30-priorities-intro {
    position: static;
}

.v30-program-page .v30-priorities-intro h2 {
    font-size: clamp(40px, 4.15vw, 56px);
    line-height: 1.04;
    text-wrap: balance;
}

.v30-program-page .v30-priority-list {
    border-top: 0;
    background: #fff;
    border: 1px solid var(--v32-line);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(10, 45, 89, .055);
}

.v30-program-page .v30-priority-item {
    grid-template-columns: 44px 48px minmax(0, 1fr);
    gap: 16px;
    padding: 25px 26px;
    border-bottom-color: #e4edf5;
}

.v30-program-page .v30-priority-item:last-child {
    border-bottom: 0;
}

.v30-program-page .v30-priority-item:hover {
    transform: none;
    background: #f8fbfe;
}

.v30-program-page .v30-priority-number {
    color: #8aa0b6;
}

.v30-program-page .v30-priority-icon {
    width: 42px;
    height: 42px;
    background: #e9f5ff;
}

.v30-program-page .v30-priority-copy h3 {
    font-size: clamp(19px, 1.75vw, 23px);
    margin-bottom: 6px;
}

.v30-program-page .v30-priority-copy p {
    font-size: 13px;
    line-height: 1.65;
}

/* Album: true mosaic, including the common 3-image case without a blank lower-right area. */
.v30-program-page .v32-gallery-section {
    padding: 90px 0 98px !important;
}

.v30-program-page .v32-gallery-section .v3-program-heading {
    width: min(760px, calc(100% - 56px));
    margin-bottom: 38px;
}

.v30-program-page .v32-gallery-section .v3-program-heading h2 {
    font-size: clamp(42px, 4.6vw, 60px);
    text-wrap: balance;
}

.v30-program-page .v3-program-gallery {
    width: min(1160px, calc(100% - 56px));
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 215px;
    gap: 14px;
}

.v30-program-page .v3-program-gallery .v32-gallery-item {
    position: relative;
    grid-column: span 4;
    grid-row: span 1;
    border-radius: 20px;
    isolation: isolate;
}

.v30-program-page .v3-program-gallery .v32-gallery-item:first-child {
    grid-column: span 7;
    grid-row: span 2;
}

.v30-program-page .v3-program-gallery .v32-gallery-item:nth-child(2),
.v30-program-page .v3-program-gallery .v32-gallery-item:nth-child(3) {
    grid-column: span 5;
}

.v30-program-page .v3-program-gallery .v32-gallery-item::after {
    content: "";
    position: absolute;
    inset: 42% 0 0;
    z-index: 1;
    background: linear-gradient(180deg, transparent, rgba(4, 28, 56, .72));
    pointer-events: none;
    opacity: .86;
}

.v30-program-page .v3-program-gallery .v32-gallery-item img {
    transform: none;
}

.v30-program-page .v3-program-gallery .v32-gallery-item:hover img {
    transform: scale(1.025);
}

.v32-gallery-caption {
    position: absolute;
    z-index: 2;
    left: 18px;
    right: 18px;
    bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    color: #fff;
    pointer-events: none;
}

[dir="rtl"] .v32-gallery-caption {
    flex-direction: row-reverse;
}

.v32-gallery-caption small {
    flex: 0 0 auto;
    opacity: .72;
    font-size: 10px;
    letter-spacing: .12em;
}

.v32-gallery-caption strong {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* Measured impact: compact split-band instead of a second full-page block. */
.v30-program-page .v30-measured-impact-section {
    padding: 82px 0 86px !important;
}

.v30-program-page .v30-measured-impact-shell {
    width: min(1160px, calc(100% - 56px));
    display: grid;
    grid-template-columns: minmax(290px, .8fr) minmax(0, 1.2fr);
    gap: clamp(54px, 7vw, 92px);
    align-items: center;
}

.v30-program-page .v30-impact-heading {
    margin: 0;
}

.v30-program-page .v30-impact-heading h2 {
    font-size: clamp(40px, 4.3vw, 58px);
    line-height: 1.04;
    text-wrap: balance;
}

.v30-program-page .v30-impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,.025);
}

.v30-program-page .v30-impact-metric {
    min-height: 166px;
    padding: 22px 24px 24px;
    border-inline-end: 1px solid rgba(255,255,255,.14);
    border-bottom: 1px solid rgba(255,255,255,.14);
}

.v30-program-page .v30-impact-metric:nth-child(2n) {
    border-inline-end: 0;
}

.v30-program-page .v30-impact-metric:nth-last-child(-n+2) {
    border-bottom: 0;
}

.v30-program-page .v30-impact-meta {
    margin-bottom: 20px;
}

.v30-program-page .v30-impact-metric strong {
    font-size: clamp(36px, 3.4vw, 50px);
    margin-bottom: 8px;
}

/* Connected projects/appeals should not crash into the impact band. */
.v30-program-page .v11-program-work {
    padding-top: 90px !important;
}

@media (max-width: 991.98px) {
    .v30-program-page .v32-story-section .v3-program-story,
    .v30-program-page .v30-priorities-shell,
    .v30-program-page .v30-measured-impact-shell {
        width: min(100% - 40px, 760px);
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .v30-program-page .v32-story-section .v3-program-story-media {
        max-width: 560px;
    }

    .v30-program-page .v32-story-section .v3-program-story-media img {
        aspect-ratio: 16 / 11;
    }

    .v30-program-page .v30-priorities-intro,
    .v30-program-page .v30-impact-heading {
        max-width: 650px;
    }

    .v30-program-page .v3-program-gallery {
        width: min(100% - 40px, 860px);
        grid-auto-rows: 190px;
    }

    .v30-program-page .v30-measured-impact-shell {
        align-items: start;
    }
}

@media (max-width: 767.98px) {
    .v30-program-page .v3-impact-rail {
        width: calc(100% - 28px);
        margin-top: -22px;
        border-radius: 17px;
    }

    .v30-program-page .v3-impact-item {
        padding: 19px 20px;
    }

    .v30-program-page .v32-story-section,
    .v30-program-page .v30-priorities-section,
    .v30-program-page .v32-gallery-section,
    .v30-program-page .v30-measured-impact-section {
        padding-top: 64px !important;
        padding-bottom: 68px !important;
    }

    .v30-program-page .v32-story-section .v3-program-story,
    .v30-program-page .v30-priorities-shell,
    .v30-program-page .v30-measured-impact-shell {
        width: calc(100% - 30px);
    }

    .v30-program-page .v32-story-section .v3-program-story-media::before {
        inset: 10px -10px -10px 10px;
        border-radius: 20px;
    }

    .v30-program-page .v32-story-section .v3-program-story-media img {
        border-radius: 20px;
        aspect-ratio: 4 / 4.5;
    }

    .v30-program-page .v30-priorities-intro h2,
    .v30-program-page .v32-gallery-section .v3-program-heading h2,
    .v30-program-page .v30-impact-heading h2 {
        font-size: 36px;
    }

    .v30-program-page .v30-priority-list {
        border-radius: 18px;
    }

    .v30-program-page .v30-priority-item {
        grid-template-columns: 32px 40px minmax(0, 1fr);
        gap: 10px;
        padding: 20px 16px;
    }

    .v30-program-page .v30-priority-icon {
        width: 38px;
        height: 38px;
    }

    .v30-program-page .v3-program-gallery {
        width: calc(100% - 28px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 185px;
        gap: 10px;
    }

    .v30-program-page .v3-program-gallery .v32-gallery-item,
    .v30-program-page .v3-program-gallery .v32-gallery-item:nth-child(2),
    .v30-program-page .v3-program-gallery .v32-gallery-item:nth-child(3) {
        grid-column: span 1;
        grid-row: span 1;
        border-radius: 16px;
    }

    .v30-program-page .v3-program-gallery .v32-gallery-item:first-child {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 230px;
    }

    .v30-program-page .v30-impact-grid {
        grid-template-columns: 1fr 1fr;
        border-radius: 17px;
    }

    .v30-program-page .v30-impact-metric {
        min-height: 148px;
        padding: 19px 17px 20px;
    }
}

@media (max-width: 480px) {
    .v30-program-page .v3-program-gallery {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        scrollbar-width: thin;
    }

    .v30-program-page .v3-program-gallery .v32-gallery-item,
    .v30-program-page .v3-program-gallery .v32-gallery-item:first-child,
    .v30-program-page .v3-program-gallery .v32-gallery-item:nth-child(2),
    .v30-program-page .v3-program-gallery .v32-gallery-item:nth-child(3) {
        flex: 0 0 84%;
        min-height: 240px;
        scroll-snap-align: start;
    }

    .v30-program-page .v30-impact-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .v30-program-page .v30-impact-metric,
    .v30-program-page .v30-impact-metric:nth-child(2n) {
        border-top: 0;
        border-bottom: 1px solid rgba(255,255,255,.14);
    }

    .v30-program-page .v30-impact-metric:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}
