/* An institution's hero (item 851, HERO SET 15318:7633) in the three looks its editor chooses -- the photo as a banner
   under the card, the photo behind the words, the photo on two thirds beside them -- each with its no-photo and
   loading state. Moved out of org-page.css (item 863), which keeps the page's buttons, menu and placeholders; the
   look's custom properties (--orgp-gutter, --orgp-teal) are set there on .cil-orgp. Logical properties throughout;
   colours are the brand's tokens (design-system/palette.css). */

/* ---- The hero: the trail ---- */
.cil-orgp-hero { position: relative; overflow: hidden; }
.cil-orgp-hero__crumbs { position: relative; z-index: 2; padding: 16px var(--orgp-gutter); font-size: 14px; }
.cil-orgp-hero__crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cil-orgp-hero__crumbs li { display: flex; align-items: center; gap: 8px; color: var(--cil-white); }
.cil-orgp-hero__crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--cil-blue-light-3); }
.cil-orgp .cil-orgp-hero__crumbs a:is(:hover, :focus) { color: var(--cil-white); text-decoration: underline; }
.cil-orgp-hero__crumbs svg { color: var(--cil-blue-light-3); }

/* ---- The card: the logo, the kind, the name, its line and the two ways on ---- */
.cil-orgp-hero__identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 24px; }
.cil-orgp-hero__identity:not(:has(.cil-orgp-hero__plate)) { grid-template-columns: minmax(0, 1fr); }
.cil-orgp-hero__words { display: contents; }
.cil-orgp-hero__plate {
    grid-row: 1 / span 2; display: grid; place-items: center; width: 144px; height: 144px; padding: 14px;
    border: 1px solid var(--cil-black-light-3); border-radius: 16px; background: var(--cil-white);
}
/* The logo fills the plate's inner box and is fitted inside it (item 854): its width and height attributes never
   set its box, so a wide, tall or square logo stays on the plate and off the numbers under it. */
.cil-orgp-hero__plate > :is(picture, img) { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.cil-orgp-hero__plate img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cil-orgp-hero__kind { align-self: end; margin-bottom: 6px; color: var(--orgp-teal); font-size: 16px; font-weight: 600; }
.cil-orgp-hero__plate ~ .cil-orgp-hero__words .cil-orgp-hero__kind,
.cil-orgp-hero__plate ~ .cil-orgp-hero__words .cil-orgp-hero__name { grid-column: 2; }
.cil-orgp .cil-orgp-hero__name { align-self: start; color: var(--cil-black); font-size: clamp(2rem, 1.6vw + 1.25rem, 3rem); font-weight: 700; line-height: 1.2; text-wrap: balance; }
.cil-orgp-hero__name:only-child, .cil-orgp-hero__plate ~ .cil-orgp-hero__words .cil-orgp-hero__name:first-child { grid-row: 1 / span 2; align-self: center; }
.cil-orgp-hero__text { grid-column: 1 / -1; margin-top: 24px; color: var(--cil-black); font-size: 18px; line-height: 1.4; max-width: 1100px; }
/* Its editors' paragraphs, kept apart; links in its own colour (item 871). */
.cil-orgp .cil-orgp-hero__text p { margin: 0; }
.cil-orgp .cil-orgp-hero__text p + p { margin-top: 0.6em; }
.cil-orgp .cil-orgp-hero__text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cil-orgp-hero__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.cil-orgp-hero__actions:empty { display: none; }

/* ---- The foot: the partnership mark, then the numbers ---- */
.cil-orgp-hero__footInner { display: flex; align-items: center; padding-top: 28px; border-top: 1px solid var(--cil-blue-light-3); }
.cil-orgp-hero__partner { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-inline-end: 32px; color: var(--cil-black-regular-6); font-size: 16px; }
.cil-orgp-hero__partner img { display: block; width: 168px; height: auto; }
.cil-orgp-hero__stats { flex: 1; display: flex; }
/* Under .cil-orgp: the page's list reset (.cil-orgp :is(ol, ul) > li, org-page.css) took the padding away (item 867). */
/* Each number takes a quarter of the row whether one or four show, from the row's start: two numbers stand where the
   first two of four would, never spread across it (item 868). Four is the most the page shows (templates/page.php). */
.cil-orgp .cil-orgp-stat {
    position: relative; flex: 0 0 25%; display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center;
    column-gap: 16px; padding-inline: clamp(20px, 2.5vw - 4px, 32px); min-width: 0;   /* 32 from 1440, less where four share a narrow row */
}
.cil-orgp-stat::after {
    content: ''; position: absolute; inset-inline-start: 0; top: 50%; width: 1px; height: 48px;
    background: var(--cil-black-light-3); transform: translateY(-50%);
}
/* No divider before the first number when no partnership mark opens the row. */
.cil-orgp-hero__footInner > .cil-orgp-hero__stats:first-child > .cil-orgp-stat:first-child::after { display: none; }
.cil-orgp-stat__mark { grid-row: 1 / span 2; color: var(--orgp-teal); }
.cil-orgp-stat__mark svg { width: 32px; height: 32px; }
.cil-orgp-stat__value { color: var(--cil-black); font-size: clamp(1.75rem, 1vw + 1.25rem, 2.5rem); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cil-orgp-stat__label { color: var(--cil-black-regular-6); font-size: 16px; }
/* On the teal band the words go light (Photo behind, Photo two-thirds, and every look without a photo). */
.cil-orgp-hero__foot.is-band .cil-orgp-hero__partner,
.cil-orgp-hero__foot.is-band .cil-orgp-stat__label { color: var(--cil-blue-light-3); }
.cil-orgp-hero__foot.is-band .cil-orgp-stat__value { color: var(--cil-white); }
.cil-orgp-hero__foot.is-band .cil-orgp-stat__mark { color: var(--cil-blue); }
.cil-orgp-hero__foot.is-band .cil-orgp-stat::after { background: var(--cil-blue-light-3); }

/* ---- Photo banner (the default): the trail on a teal bar, the photo, the card over the photo's foot ---- */
.cil-orgp-hero--photo_banner .cil-orgp-hero__crumbs { background: var(--orgp-teal); }
.cil-orgp-hero--photo_banner .cil-orgp-hero__photo { height: clamp(280px, 31.25vw, 600px); }
.cil-orgp-hero__photo :is(picture, img) { display: block; width: 100%; height: 100%; object-fit: cover; }
.cil-orgp-hero--photo_banner .cil-orgp-hero__card {
    position: relative; margin: -160px var(--orgp-gutter) 56px; padding: 40px 48px;
    display: flex; flex-direction: column; gap: 32px;
    border-top: 6px solid var(--orgp-teal); border-radius: 16px; background: var(--cil-white);
    box-shadow: 0 12px 20px color-mix(in srgb, var(--cil-black) 12%, transparent);
}
/* No photo: a teal ground the card stands on in its place. */
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__stage { background: linear-gradient(var(--orgp-teal) 0 160px, transparent 160px); padding-top: 40px; }
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__card { margin-top: 0; }
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__foot.is-band .cil-orgp-hero__footInner { border-color: var(--cil-blue-light-3); }
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__foot.is-band :is(.cil-orgp-hero__partner, .cil-orgp-stat__label) { color: var(--cil-black-regular-6); }
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__foot.is-band .cil-orgp-stat__value { color: var(--cil-black); }
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__foot.is-band .cil-orgp-stat__mark { color: var(--orgp-teal); }
.cil-orgp-hero--photo_banner.is-bare .cil-orgp-hero__foot.is-band .cil-orgp-stat::after { background: var(--cil-black-light-3); }
.cil-orgp-hero__foot.is-band { position: relative; z-index: 1; padding-bottom: 40px; background: var(--orgp-teal);
    box-shadow: 0 0 0 100vmax var(--orgp-teal); clip-path: inset(0 -100vmax); }
.cil-orgp-hero--photo_banner:not(.is-bare) .cil-orgp-hero__foot.is-band { box-shadow: none; clip-path: none; }
.cil-orgp-hero--photo_banner .cil-orgp-hero__foot { padding-bottom: 0; background: none; box-shadow: none; clip-path: none; }

/* ---- Photo behind and Photo two-thirds: the words light on teal, the photo in its own cells (item 863) ----
   The hero is a grid: the stage and the card let their parts into it, so the photo takes only the cells the design
   gives it -- the trail and the words behind, or the end column beside them -- and the band of numbers is a row of its
   own under it. The photo's height never depends on whether the numbers show, and its picture never sizes the hero. */
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) {
    --orgp-split-gap: clamp(24px, 3.333vw, 64px);
    display: grid; grid-template-columns: minmax(0, 1fr); background: var(--orgp-teal);
}
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__stage, .cil-orgp-hero__card) { display: contents; }
/* Every part names its cells: one left to find a free cell would open a column of its own beside the photo. */
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__crumbs, .cil-orgp-hero__identity) { position: relative; z-index: 1; grid-column: 1 / -1; }
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__photo { position: relative; z-index: 0; overflow: hidden; grid-column: 1 / -1; }
/* The picture fills the photo's cells; shown whole (fit), it stands over a blurred copy of itself (hero.php). */
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__photo :is(picture, img, .cil-orgp-skel) { position: absolute; inset: 0; }
.cil-orgp-hero--photo_behind:not(.is-loading) .cil-orgp-hero__photo::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__name, .cil-orgp-hero__text) { color: var(--cil-white); }
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__kind { color: var(--cil-blue-light-3); }
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__plate { border-color: transparent; }
.cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__text { margin-top: 24px; }
/* The band is a row of the hero's own teal, the full width. */
.cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__foot.is-band {
    grid-column: 1 / -1; padding-inline: var(--orgp-gutter); background: none; box-shadow: none; clip-path: none;
}

@media (min-width: 1080px) {
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__crumbs { grid-row: 1; padding: 32px var(--orgp-gutter) 0; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__identity { grid-row: 2; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__photo { grid-row: 1 / 3; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__foot { grid-row: 3; }
    /* No photo (both looks): the trail, 40 below it the logo beside the name, 56 below them the band. */
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds).is-bare .cil-orgp-hero__identity { margin-inline: var(--orgp-gutter); padding-block: 40px 56px; }

    /* Photo behind: the words, at most 760 wide, on the photo's start side over Figma's "Photo fade" -- near-solid teal
       under the words, clear beyond them. */
    .cil-orgp-hero--photo_behind:not(.is-bare) .cil-orgp-hero__identity {
        justify-self: start; width: min(760px, 100% - 2 * var(--orgp-gutter)); margin-inline-start: var(--orgp-gutter);
        padding-block: clamp(48px, 6.25vw, 120px);
    }
    .cil-orgp-hero--photo_behind:not(.is-loading) .cil-orgp-hero__photo::after {
        --orgp-words-end: calc(var(--orgp-gutter) + min(760px, 100% - 2 * var(--orgp-gutter)));
        background: linear-gradient(var(--orgp-fade-to, to left),
            color-mix(in srgb, var(--orgp-teal) 95%, transparent) 0,
            color-mix(in srgb, var(--orgp-teal) 93%, transparent) calc(var(--orgp-words-end) * .57),
            color-mix(in srgb, var(--orgp-teal) 85%, transparent) calc(var(--orgp-words-end) + 46px),
            transparent calc(var(--orgp-words-end) + 526px));
    }
    .lang-to-css-ltr .cil-orgp-hero--photo_behind .cil-orgp-hero__photo::after { --orgp-fade-to: to right; }

    /* Photo two-thirds: a panel of the words at the start (the gutter, 416, a gap), the photo on the rest from the top
       of the hero to the band, the logo above the name. */
    .cil-orgp-hero--photo_twothirds:not(.is-bare) { grid-template-columns: var(--orgp-gutter) calc(416px + var(--orgp-split-gap)) minmax(0, 1fr); }
    .cil-orgp-hero--photo_twothirds:not(.is-bare) :is(.cil-orgp-hero__crumbs, .cil-orgp-hero__identity) { grid-column: 2; padding-inline: 0 var(--orgp-split-gap); }
    .cil-orgp-hero--photo_twothirds:not(.is-bare) .cil-orgp-hero__photo { grid-column: 3; }
    .cil-orgp-hero--photo_twothirds:not(.is-bare) .cil-orgp-hero__identity { grid-template-columns: minmax(0, 1fr); padding-block: 40px 64px; }
    .cil-orgp-hero--photo_twothirds:not(.is-bare) .cil-orgp-hero__plate { grid-row: auto; margin-bottom: 24px; }
    .cil-orgp-hero--photo_twothirds:not(.is-bare) .cil-orgp-hero__identity .cil-orgp-hero__words > * { grid-column: 1; grid-row: auto; }
}

/* ---- Loading (Figma 14028:2 and each look's "Loading"): the shapes, one slow shimmer (org-page.css) ---- */
.cil-orgp-hero.is-loading .cil-orgp-hero__crumbs { background: none; }
.cil-orgp-hero.is-loading .cil-orgp-hero__photo { background: var(--cil-black-light-2); }
.cil-orgp-hero.is-loading:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) { background: var(--cil-black-light-1); }
.cil-orgp-hero.is-loading .cil-orgp-hero__plate { border-color: var(--cil-black-light-3); }

/* ---- Narrower screens ---- */
@media (max-width: 1079px) {
    .cil-orgp-hero__footInner { flex-direction: column; align-items: stretch; gap: 24px; }
    .cil-orgp-hero__partner { padding-inline-end: 0; }
    .cil-orgp-hero__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
    .cil-orgp .cil-orgp-stat { padding-inline: 0 12px; }
    .cil-orgp-stat::after { display: none; }

    /* Behind and two-thirds (the mobile frames 15318:7590, 7596): the logo beside the kind and the name, then the line,
       the ways on and the numbers. Rows: 1 the trail (behind) or the photo, 2 the room over the photo (behind) or the
       trail, 3 the kind, 4 the name, 5 the photo's foot under the name, 6 and 7 the line, 8 the ways on, 9 the band. */
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) {
        grid-template-columns: var(--orgp-gutter) auto var(--orgp-plate-gap, 16px) minmax(0, 1fr) var(--orgp-gutter);
    }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds):not(:has(.cil-orgp-hero__plate)) { --orgp-plate-gap: 0px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__identity { display: contents; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__plate, .cil-orgp-hero__words > *) { position: relative; z-index: 1; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__crumbs { grid-column: 1 / -1; font-size: 14px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__plate {
        grid-row: 3 / 5; grid-column: 2; align-self: center; width: 88px; height: 88px; padding: 8px; border-radius: 12px;
    }
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__kind, .cil-orgp-skel--kind) { grid-row: 3; grid-column: 4; }
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__name, .cil-orgp-skel--name) { grid-row: 4; grid-column: 4; }
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) :is(.cil-orgp-hero__text, .cil-orgp-skel--line) { grid-row: 6; grid-column: 2 / 5; margin-top: 20px; }
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-skel--short { grid-row: 7; margin-top: 10px; }
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__actions { grid-row: 8; grid-column: 2 / 5; margin-block: 20px 32px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__foot { grid-row: 9; }

    /* Photo behind: the trail on teal, then the photo with the logo and the name on its foot over a fade to teal. */
    .cil-orgp-hero--photo_behind { grid-template-rows: auto 300px auto auto 20px; }
    .cil-orgp-hero--photo_behind .cil-orgp-hero__crumbs { grid-row: 1; padding: 20px var(--orgp-gutter) 16px; }
    .cil-orgp-hero--photo_behind .cil-orgp-hero__photo { grid-row: 2 / 6; }
    .cil-orgp-hero--photo_behind:not(.is-loading) .cil-orgp-hero__photo::after {
        background: linear-gradient(transparent 35%, color-mix(in srgb, var(--orgp-teal) 90%, transparent) 72%,
            color-mix(in srgb, var(--orgp-teal) 97%, transparent));
    }
    /* Photo two-thirds: the photo on top, the trail under it, then the words. */
    .cil-orgp-hero--photo_twothirds { grid-template-rows: auto auto auto auto 0; }
    .cil-orgp-hero--photo_twothirds .cil-orgp-hero__photo { grid-row: 1; height: clamp(320px, 42vw, 440px); }
    .cil-orgp-hero--photo_twothirds .cil-orgp-hero__crumbs { grid-row: 2; padding: 20px var(--orgp-gutter); }
    /* No photo (both looks): the trail, then the words. */
    .cil-orgp-hero--photo_behind.is-bare { grid-template-rows: auto 0 auto auto 0; }
    .cil-orgp-hero--photo_behind.is-bare .cil-orgp-hero__crumbs { padding-bottom: 20px; }
}
@media (max-width: 767px) {
    .cil-orgp-hero__crumbs { padding-block: 12px; font-size: 13px; }
    .cil-orgp-hero__plate { width: 72px; height: 72px; padding: 8px; border-radius: 12px; }
    .cil-orgp-hero__text { margin-top: 16px; font-size: 16px; }
    .cil-orgp-hero__actions { flex-direction: column; align-items: stretch; margin-top: 20px; gap: 12px; }
    .cil-orgp-hero--photo_banner .cil-orgp-hero__photo { height: 240px; }
    .cil-orgp-hero--photo_banner .cil-orgp-hero__card { margin: -48px 16px 32px; padding: 24px 20px; gap: 24px; }
    .cil-orgp-hero__foot.is-band { padding-bottom: 28px; }

    /* Behind and two-thirds on a phone: the name at 28, the partnership mark in a row, the numbers smaller. */
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__name { font-size: 28px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__footInner { padding-top: 20px; gap: 20px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__partner { flex-direction: row; align-items: center; gap: 12px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__partner img { width: 112px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-hero__stats { column-gap: 16px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-stat { column-gap: 12px; }
    .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-stat__mark svg { width: 24px; height: 24px; }
    .cil-orgp .cil-orgp-hero:is(.cil-orgp-hero--photo_behind, .cil-orgp-hero--photo_twothirds) .cil-orgp-stat__value { font-size: 24px; }
}
