﻿/*
 * Our Institutions page — ported unchanged from site.legacy.css. Loaded
 * only on this page via inc/enqueue/styles.php's page-slug matching
 * (page-institutions.php -> institutions.css).
 *
 * .ecosystem-grid's base declaration here is the FINAL cascade value from
 * the legacy stylesheet (a 6-column track with cards spanning 3, visually
 * identical to a 2-column grid) — the earlier, superseded repeat(2, 1fr)
 * declaration is intentionally not ported since it's dead code once the
 * later rule is in effect. Several legacy rules scoped to
 * `details.ecosystem-card.is-future` are also intentionally not ported:
 * the current markup uses plain <article> cards, not a <details>
 * accordion, so those selectors never match.
 */

.architecture-row { display: grid; grid-template-columns: 1fr 2.1fr; gap: 50px; align-items: center; }
.architecture-diagram { display: grid; gap: 12px; }
.parent-node { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 18px; border-radius: 18px; background: var(--navy); color: var(--white); font-family: var(--serif); font-size: 1.1rem; text-align: center; }
.parent-node img { width: 32px; filter: brightness(0) invert(1); }
.child-nodes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.child-node { display: grid; min-height: 82px; place-items: center; align-content: center; gap: 7px; padding: 10px; border: 1px solid var(--stone); border-radius: 14px; background: var(--white); color: var(--navy); font-size: .72rem; font-weight: 800; text-align: center; transition: .3s var(--ease); }
.child-node:hover { transform: translateY(-4px); border-color: var(--green); box-shadow: var(--shadow-sm); }
.child-node .icon { width: 19px; height: 19px; color: var(--forest); }

.ecosystem-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px; }
.ecosystem-card { position: relative; overflow: hidden; grid-column: span 3; min-height: 360px; display: flex; flex-direction: column; padding: 30px; border: 1px solid var(--stone); border-radius: var(--radius); background: var(--white); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.ecosystem-card:hover { transform: translateY(-6px); border-color: var(--green); box-shadow: var(--shadow-lg); }
.ecosystem-card::after { content: attr(data-number); position: absolute; right: 14px; top: 10px; color: rgba(255,255,255,.35); font-family: var(--serif); font-size: 2.4rem; font-weight: 800; line-height: 1; }
.ecosystem-card .icon-wrap { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 12px; background: var(--forest); color: white; }
.ecosystem-card .icon { width: 24px; height: 24px; }
.ecosystem-card h2 { margin: auto 0 14px; font-size: clamp(1.65rem, 2.45vw, 2.15rem); text-decoration: none; }
.ecosystem-card p { max-width: 560px; color: var(--slate); text-decoration: none; }
.ecosystem-card .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.ecosystem-card .status { width: fit-content; margin-top: 0; padding: 7px 12px; border-radius: 999px; background: var(--sage); color: var(--forest); font-size: .72rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; }
.ecosystem-card .card-link { margin-top: 0; text-decoration: none; }
.ecosystem-card.is-active { grid-column: span 3; min-height: 300px; border: 0; background: var(--navy); color: rgba(255,255,255,.72); }
.ecosystem-card.is-active h2 { color: var(--white); }
.ecosystem-card.is-active p { color: rgba(255,255,255,.72); }
.ecosystem-card.is-active .status { background: rgba(141,197,174,.14); color: #add7c6; }
.ecosystem-card.is-active .icon-wrap { background: rgba(255,255,255,.1); color: #add7c6; }
.section-sage:has(.ecosystem-grid) { padding-block: clamp(82px, 8vw, 108px); }

/* --- Scale-down pass, same as home/about/vision/values/waqf/story/leadership/impact ---
   .ecosystem-card h2 (the 8 institution cards) already has its own
   smaller size above — this only targets the page's own section
   headings (main hero, sticky-title, section-head x2, closing
   service-photo-copy, FAQ), which are a different h2 context and
   otherwise inherit global/base.css's much larger default. */
.page-hero h1 {
    font-size: clamp(2.25rem, 3.4vw, 3.4rem);
}

.sticky-title h2,
.section-head h2,
.service-photo-copy h2,
.faq-intro h2,
.architecture-row h2 {
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
}

.section-head .lead {
    margin-top: 18px;
}

.service-photo-copy .button {
    margin-top: 22px;
}

@media (max-width: 820px) {
    .architecture-row { grid-template-columns: 1fr; }
    .ecosystem-grid { grid-template-columns: 1fr; }
    .ecosystem-grid .ecosystem-card,
    .ecosystem-grid .ecosystem-card.is-active { grid-column: span 1; }
    .child-nodes { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .ecosystem-grid .ecosystem-card,
    .ecosystem-grid .ecosystem-card.is-active { min-height: 0; padding: 24px; }
    .ecosystem-grid .ecosystem-card h2 { margin: 20px 0 10px; }
    .ecosystem-grid .ecosystem-card.is-active {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr);
        column-gap: 16px;
        min-height: 0;
    }
    .ecosystem-grid .ecosystem-card.is-active .icon-wrap { grid-row: 1 / span 4; }
    .ecosystem-grid .ecosystem-card.is-active h2 { margin: 0 0 10px; font-size: 1.45rem; }
    .ecosystem-grid .ecosystem-card.is-active p,
    .ecosystem-grid .ecosystem-card.is-active .card-footer { grid-column: 2; }
}