/* NIAMR hero — uniform navy wash over the slide photos so the white
 * hero text stays legible across the whole image. Painted on the image
 * layer (below the text + the theme's left-side gradient), so it only
 * darkens the photo, never the content. Uses the HIRI primary navy. */
.hero.hero-slider-layout .hero-slide .hero-slider-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(7, 35, 77, 0.45);
    pointer-events: none;
}

/* NIAMR header carries two buttons (Visit HIRI + Search). Center them on
 * one line with even spacing so they sit at the same level. */
.header-btn {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Section-spacing consistency: the theme collapses the gap when an
 * .about-us intro directly precedes a .our-services listing (meant for
 * main-site intro+cards blocks). On the NIAMR home those are distinct full
 * sections (Engagement → Outputs & Resources), so restore the standard
 * section padding to match every other section transition. (The hubs'
 * .about-us + .page-case-study collapse is left intact.) */
.about-us + .our-services { padding-top: 100px; }
.about-us:has(+ .our-services) { padding-bottom: 100px; }
.about-us:has(+ .our-services) .section-row { margin-bottom: 80px; }

/* Platform coming-soon page. */
.niamr-coming-soon__badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 6px 16px;
    background: var(--secondary-color);
    color: var(--accent-color);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
}
.niamr-coming-soon__actions {
    margin-top: 28px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Platform CTA band — pre-footer section on every page (text + robotic-hand
 * image split, Explore button, "18+ Researchers" badge). Ported from the
 * reference home hero design, re-skinned to HIRI. */
.niamr-platform-cta {
    background: var(--bg-color, #f5f6f8);
    padding: 70px 0;
}
.niamr-platform-cta__title {
    font-family: var(--accent-font, "Sora", sans-serif);
    color: var(--primary-color);
    margin: 0 0 16px;
}
.niamr-platform-cta__text {
    max-width: 540px;
    margin: 0 0 28px;
    color: rgba(7, 35, 77, 0.75);
}
.niamr-platform-cta__actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.niamr-platform-cta__badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 18px 10px 12px;
    box-shadow: 0 8px 24px rgba(7, 35, 77, 0.08);
}
.niamr-platform-cta__avatars {
    display: inline-flex;
}
.niamr-platform-cta__avatars img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid #ffffff;
    margin-left: -10px;
}
.niamr-platform-cta__avatars img:first-child {
    margin-left: 0;
}
.niamr-platform-cta__badge-label {
    font-weight: 700;
    color: var(--primary-color);
}
.niamr-platform-cta__image {
    text-align: center;
}
.niamr-platform-cta__image img {
    max-width: 100%;
    height: auto;
}
@media (max-width: 991px) {
    .niamr-platform-cta__image { margin-top: 30px; }
}

/* Home "What NIAMR is building" — full-width One Health figure + caption. */
.niamr-onehealth {
    margin-top: 24px;
}
.niamr-onehealth figure {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
}
.niamr-onehealth img {
    width: 100%;
    height: auto;
    display: block;
}
.niamr-onehealth__caption {
    text-align: center;
    margin: 16px 0 0;
    font-size: 14px;
    color: rgba(7, 35, 77, 0.7);
}

/* Team photos — portrait crop aligned to the top so headshots aren't
 * zoomed in / cut off at the forehead (cards + detail page). */
.researcher-card-photo {
    aspect-ratio: 4 / 5;
}
.researcher-card-photo img,
.researcher-detail-photo img {
    object-fit: cover;
    object-position: center top;
}

/* Team card group tag — shown in the card body (below the photo, above the
 * name) so it never covers the headshot. Shows each member's position on a
 * single ungrouped team grid. */
.researcher-card-tags {
    margin: 0 0 10px;
}
.researcher-card-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--secondary-color);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 999px;
}

/* Partner & funder grid — NIAMR reference "niamr-partners" style:
 * an open-ended 4x2 divider grid (internal lines only, open outer edges).
 * Each cell = logo + bold name + short description. 2-col on tablet,
 * 1-col on mobile. Re-skinned to the HIRI navy. */
.niamr-partners {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.niamr-partners__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    color: inherit;
    text-decoration: none;
    transition: background-color 200ms ease;
    border-right: 1px solid rgba(7, 35, 77, 0.1);
    border-bottom: 1px solid rgba(7, 35, 77, 0.1);
}
.niamr-partners__cell:hover {
    background: rgba(7, 35, 77, 0.025);
    color: inherit;
    text-decoration: none;
}
.niamr-partners__cell:nth-child(4n) { border-right: 0; }
.niamr-partners__cell:nth-child(n+5) { border-bottom: 0; }
.niamr-partners__logo {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.niamr-partners__logo img {
    max-height: 70px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
}
.niamr-partners__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 10px;
}
.niamr-partners__description {
    font-size: 13px;
    line-height: 1.55;
    color: rgba(7, 35, 77, 0.75);
    margin: 0;
    max-width: 240px;
}
/* Tablet: 2 across */
@media (max-width: 991px) {
    .niamr-partners { grid-template-columns: repeat(2, 1fr); }
    .niamr-partners__cell { border-right: 1px solid rgba(7, 35, 77, 0.1); border-bottom: 1px solid rgba(7, 35, 77, 0.1); }
    .niamr-partners__cell:nth-child(2n) { border-right: 0; }
    .niamr-partners__cell:nth-last-child(-n+2) { border-bottom: 0; }
}
/* Mobile: 1 across */
@media (max-width: 575px) {
    .niamr-partners { grid-template-columns: 1fr; }
    .niamr-partners__cell { border-right: 0 !important; border-bottom: 1px solid rgba(7, 35, 77, 0.1); }
    .niamr-partners__cell:last-child { border-bottom: 0; }
}

/* ============================================================
 * NIAMR bespoke component styles — ported to HIRI token palette.
 *
 * KEPT: Phase timeline only (.niamr-phases*) — the 5-phase zig-zag
 * is one of the two bespoke visuals retained for the microsite.
 *
 * REMOVED (replaced by main-site Labrix components in page templates):
 *   .niamr-ooi*          — outputs/outcomes/impact pillars
 *   .niamr-partners*     — partners grid
 *   .medolia-service-box / .medolia-left-icon-box — icon overrides
 *   .v2-partners*        — partner logo strip
 *   .hub-chip, .hub-clamp-* — hub filter chips / text clamp helpers
 *   .content-placeholder — editorial in-progress marker
 *   .nihr-disclaimer     — footer disclaimer strip (now inline in footer partial)
 *   .niamr-preloader-logo — preloader logo pulse (uses main Labrix preloader)
 *
 * Colour mapping (NIAMR → HIRI tokens):
 *   #042657 / #1B1B3A (navy-ish) → var(--primary-color)
 *   #be0c23 / #D4351C (red)      → var(--accent-color)
 * ============================================================ */


/* ============================================================
   PHASE TIMELINE (.niamr-phases)
   5-phase zig-zag: horizontal spine, alternating up/down cards,
   icon medallion dot-markers on the spine.
   ============================================================ */
.niamr-phases {
    position: relative;
    padding: 40px 0;
}
/* Explicit grid rows: upper card zone / spine zone / lower card zone */
.niamr-phases__items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: minmax(170px, auto) 96px minmax(170px, auto);
    gap: 0;
    position: relative;
}
/* Central horizontal spine — sits in row 2, spans all columns */
.niamr-phases__items::before {
    content: "";
    grid-row: 2;
    grid-column: 1 / -1;
    align-self: center;
    height: 8px;
    background: linear-gradient(
        to right,
        var(--primary-color)  0%,  var(--primary-color)  40%,
        var(--primary-color) 40%,  var(--primary-color) 70%,
        var(--accent-color)  70%,  var(--accent-color) 100%
    );
    border-radius: 2px;
    z-index: 1;
}
/* Each .niamr-phases__item is `display: contents` so its children (card +
   marker) are placed directly into the grid by row/column rules. */
.niamr-phases__item {
    display: contents;
}

/* Phase content card: number pill, title, short description */
.niamr-phases__card {
    background: #ffffff;
    border: 1px solid rgba(4, 38, 87, 0.08);
    border-radius: 8px;
    padding: 16px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    max-width: 220px;
    margin: 0 auto;
    text-align: center;
    z-index: 2;
}
.niamr-phases__item--up   > .niamr-phases__card { grid-row: 1; align-self: end;   margin-bottom: 20px; }
.niamr-phases__item--down > .niamr-phases__card { grid-row: 3; align-self: start; margin-top: 20px; }
/* Per-column placement — each item's children share the same column index */
.niamr-phases__item:nth-child(1) > * { grid-column: 1; }
.niamr-phases__item:nth-child(2) > * { grid-column: 2; }
.niamr-phases__item:nth-child(3) > * { grid-column: 3; }
.niamr-phases__item:nth-child(4) > * { grid-column: 4; }
.niamr-phases__item:nth-child(5) > * { grid-column: 5; }
.niamr-phases__num {
    display: inline-block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-color);
    margin-bottom: 6px;
}
.niamr-phases__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 8px;
    line-height: 1.25;
}
.niamr-phases__desc {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(7, 35, 77, 0.75);   /* primary-color at 75% opacity */
    margin: 0;
}

/* Connecting dashed line from card to the spine marker */
.niamr-phases__item--up   .niamr-phases__card::after,
.niamr-phases__item--down .niamr-phases__card::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 2px;
    height: 24px;
    background: repeating-linear-gradient(to bottom, rgba(7,35,77,0.25) 0 4px, transparent 4px 8px);
    transform: translateX(-50%);
}
.niamr-phases__item--up   .niamr-phases__card::after  { top: 100%; }
.niamr-phases__item--down .niamr-phases__card::before { bottom: 100%; }

/* Circular icon medallion sitting on the spine (grid row 2) */
.niamr-phases__marker {
    grid-row: 2;
    justify-self: center;
    align-self: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 28px;
    box-shadow: 0 6px 16px rgba(7, 35, 77, 0.15);
    z-index: 3;
}
/* Later phases use accent colour for marker ring + icon */
.niamr-phases__item:nth-child(4) > .niamr-phases__marker,
.niamr-phases__item:nth-child(5) > .niamr-phases__marker { border-color: var(--accent-color); color: var(--accent-color); }

/* Responsive — below lg, swap to a vertical stack with a left spine */
@media (max-width: 991px) {
    .niamr-phases__items {
        grid-template-columns: 80px 1fr;
        grid-template-rows: repeat(5, auto);
        gap: 16px 0;
        padding-left: 0;
        position: relative;
    }
    /* Spine becomes vertical, sitting in column 1 */
    .niamr-phases__items::before {
        grid-row: 1 / -1;
        grid-column: 1;
        align-self: stretch;
        justify-self: center;
        width: 6px; height: auto;
        background: linear-gradient(
            to bottom,
            var(--primary-color)  0%,  var(--primary-color) 70%,
            var(--accent-color)  70%,  var(--accent-color) 100%
        );
    }
    /* Reset per-column placement from desktop and place each item on its own row */
    .niamr-phases__item:nth-child(n) > * { grid-column: auto; }
    .niamr-phases__item > .niamr-phases__marker { grid-column: 1; justify-self: center; align-self: start; }
    .niamr-phases__item > .niamr-phases__card   { grid-column: 2; align-self: start; text-align: left; margin: 0; max-width: 100%; }
    .niamr-phases__item:nth-child(1) > * { grid-row: 1; }
    .niamr-phases__item:nth-child(2) > * { grid-row: 2; }
    .niamr-phases__item:nth-child(3) > * { grid-row: 3; }
    .niamr-phases__item:nth-child(4) > * { grid-row: 4; }
    .niamr-phases__item:nth-child(5) > * { grid-row: 5; }
    .niamr-phases__item--up   > .niamr-phases__card,
    .niamr-phases__item--down > .niamr-phases__card { margin: 0; }
    .niamr-phases__item--up   .niamr-phases__card::after,
    .niamr-phases__item--down .niamr-phases__card::before { display: none; }
    .niamr-phases__marker { width: 56px; height: 56px; font-size: 22px; }
}
