.centers-section {
    padding: clamp(40px, 4vw, 72px) 0 var(--section-gap);
}

.centers-intro {
    margin-block-start: 16px;
    font-size: clamp(15px, 1.6vw, var(--font-size-24));
    line-height: 1.55;
    color: #3d3d3d;
    font-weight: var(--font-weight-regular);
    width: max-content;
    max-width: 100%;
}

/*.center-feature__photo,
.center-wide__photo,
.center-card__photo {
    mix-blend-mode: multiply;
}*/

.center-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(7px, .62vw, 11px) clamp(13px, 1.15vw, 19px);
    border: 1px solid var(--pill-border, transparent);
    border-radius: 999px;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(31, 49, 99, .07);
    font-size: clamp(14px, .85vw, 14px);
    font-weight: 600;
    line-height: 1;
    /*    color: var(--accent, var(--navy));*/
    white-space: nowrap;
}

.center-pill__icon {
    width: 1.25em;
    height: 1.25em;
    object-fit: contain;
}

.center-links {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(6px, .55vw, 10px);
    margin-top: clamp(10px, 1vw, 18px);
}

.center-link {
    display: inline-flex;
    align-items: center;
    gap: clamp(7px, .6vw, 11px);
    padding: clamp(6px, .55vw, 10px) clamp(11px, 1vw, 17px);
    border: 1px solid var(--accent, var(--navy));
    border-radius: 999px;
    background: var(--white);
    font-size: clamp(10px, .8vw, 13px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--accent, var(--navy));
    text-decoration: none;
    transition: background .2s, color .2s;
}

    .center-link:hover {
        background: var(--accent, var(--navy));
        color: var(--white);
    }

    /* An explicit width, not the glyph's own: how many unit pills fit on a row
   is decided by the pill's width, and a font-based arrow measures zero
   until the icon font arrives. Reserving the space up front means the rows
   wrap the same way before and after the font loads, and the same way here
   as on the server. */
    .center-link i {
        flex-shrink: 0;
        width: 1em;
        font-size: .92em;
        text-align: center;
    }

/* ---- top block: 2 x 3, with the flagship spanning two rows ---------- */

.centers-top {
    position: relative;
    margin-block-start: 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* The only placement rule on the page: everything after it lands in the
   remaining cells by source order. */
.center-feature {
    position: relative;
    /* min-height: 420px; */
    padding: 32px;
    border-radius: var(--radius-16);
    border: var(--border-width-1) solid var(--color-border-slate);
    background: var(--color-bg-card-slate);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1100px) {
    .coe-feature {
        grid-column: auto;
        grid-row: 1 / span 2;
        /* height: 595px; */
        min-height: 0;
        padding: 40px;
    }
}

@media (min-width: 640px) {
    .coe-feature {
        grid-column: 1 / -1;
    }
}

.center-feature__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    padding: clamp(16px, 1.6vw, 30px);
}

.center-feature__title {
    position: relative;
    z-index: 1;
    margin: clamp(14px, 1.4vw, 26px) 0 0;
    font-size: clamp(20px, 1.9vw, 30px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy);
    max-width: 50%;
}

/* One unit per row in the flagship's narrow column. A column beats a
   narrow wrapping row here: the longest pill ("Post-Transplant Follow-up
   Clinics") is wider than the text column, and a width cap would break it
   onto two lines inside its own pill instead of letting it run on. */
.center-feature .center-links {
    flex-direction: column;
    align-items: flex-start;
}

/* The illustration bleeds off the trailing edge, so it is positioned
   rather than laid out — otherwise it would dictate the card's height and
   the text column would never fill it. Its width is a share of the card,
   not of the viewport, because the card's own width is what it has to
   leave room in. */
.center-feature__photo {
    height: 100%;
    object-fit: cover;
    margin-inline-start: auto;
}

.btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 32px;
    border: var(--border-width-1) solid var(--color-button-border-green);
    border-radius: var(--radius-36);
    background: var(--color-white);
    box-shadow: var(--shadow-chip);
    color: var(--color-chip-text-green);
    /* font-size: var(--font-size-18);*/
    /*    font-weight: var(--font-weight-bold);*/
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s var(--ease-premium), box-shadow 0.2s var(--ease-premium);
}

.btn-solid__chevron {
    /*    width: 24px;
    height: 24px;*/
    transform: rotate(-90deg) scaleX(-1);
}

.coe-card--green, .center-card--green, .coe-chip--green {
    border: var(--border-width-1) solid var(--color-chip-border-green);
    color: var(--color-chip-text-green);
}

.coe-card--purple, .center-card--purple, .coe-chip--purple {
    border: var(--border-width-1) solid var(--color-chip-border-purple);
    color: var(--color-chip-text-purple);
}

.coe-card--red, .center-card--red, .coe-chip--red {
    border: var(--border-width-1) solid var(--color-chip-border-red);
    color: var(--color-chip-text-red);
}

.coe-card--blue, .center-card--blue, .coe-chip--blue {
    border: var(--border-width-1) solid var(--color-chip-border-blue);
    color: var(--color-chip-text-blue);
}

.coe-card--pink, .center-card--pink, .coe-chip--pink {
    border: var(--border-width-1) solid var(--color-chip-border-pink);
    color: var(--color-chip-text-pink);
}

.center-card--pink, .center-card--lilac, .coe-chip--lilac {
    border: var(--border-width-1) solid var(--color-chip-border-purple);
    color: var(--color-chip-text-purple);
    --tint: linear-gradient(105deg, #FAF7FD 0%, #F3ECFB 100%);
    --accent: "";
}

.coe-feature__cta {
    position: relative;
    z-index: 1;
    margin-block-start: 0px;
    align-self: flex-start;
    margin-bottom: 12px;
    font-weight: 400;
}

@media (min-width: 1100px) {
    .coe-feature__cta {
        margin-block-start: 0px;
    }
}
/* ---- the four wide cards -------------------------------------------- */

.center-wide {
    position: relative;
    display: flex;
    overflow: hidden;
    border-radius: 20px;
    background: var(--tint);
}

.center-wide__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(8px, .8vw, 14px);
    flex: 1 1 auto;
    padding: clamp(13px, 1.3vw, 24px);
    /* The illustration is positioned, not laid out, so the text column keeps
     clear of it with padding rather than a character-count cap — which
     would wrap the title early and differently in every translation. A
     percentage, not a viewport clamp: these cards come in two widths, and
     how many unit pills fit per row has to follow the card, not the
     window. */
    padding-inline-end: 24%;
}

.center-wide__title {
    font-size: clamp(15px, 1.42vw, 25px);
    font-weight: 500;
    line-height: 1.3;
    color: var(--navy);
}

/* The units sit at the foot of the card, under whatever space the title
   leaves — which is what keeps a one-line and a two-line title looking
   like the same card. */
.center-wide .center-links {
    margin-top: auto;
}

/* Inset rather than flush: the supplied artwork nearly matches the box's
   own aspect ratio, so at `inset-block: 0` it fills the card edge to edge
   and the tint stops reading as a card. */
.center-wide__photo {
    position: absolute;
    z-index: 0;
    inset-block: clamp(6px, .6vw, 11px);
    inset-inline-end: clamp(5px, .5vw, 10px);
    width: 24%;
    height: auto;
    max-height: calc(100% - 2 * clamp(6px, .6vw, 11px));
    object-fit: contain;
    object-position: center;
}

/* ---- the bottom row -------------------------------------------------- */

.centers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 1vw, 17px);
    margin-top: clamp(10px, 1vw, 17px);
}


.center-card {
    position: relative;
    /*  min-height: 320px;*/
    padding: 28px;
    padding-bottom: 10px;
    border-radius: var(--radius-16);
    border: var(--border-width-1) solid var(--color-border-slate);
    background: var(--color-white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    .center-card .center-pill {
        /* border-color: var(--accent);*/
    }



.center-card__photo {
    position: absolute;
    inset-block-start: 0px;
    inset-inline-end: 0px;
    width: 45%;
    height: calc(100% - 0px);
    object-fit: cover;
    border-radius: var(--radius-16);
    z-index: 0;
}

.img-box::after {
    content: '';
    position: absolute;
    inset-block-start: 0px;
    inset-inline-end: 0px;
    width: 53%;
    inset: 0;
    background: linear-gradient(89deg, #ffffff00 0%, #ffffffa6 6%, rgb(215 224 255 / 40%) 50%, rgb(14 29 82 / 0%) 100%, rgb(5 11 35 / 0%) 100%);
    pointer-events: none; /* clicks reach the image */
    margin-left: auto;
}

@media (min-width: 1100px) {
    .center-card {
        /* height: 320px;*/
        min-height: 0;
        padding: 30px;
        gap: 20px;
        padding-bottom: 5px;
    }

    .center-card__photo {
        inset-block-start: 0px;
        inset-inline-end: 0px;
        width: 50%;
        height: calc(100% - 0px);
    }
}

.center-card__title {
    font-size: clamp(19px, 1.42vw, 25px);
    font-weight: 400;
    line-height: 1.3;
    color: var(--navy);
    z-index: 55;
}

/* Pushes the links to the foot of the card so all three rows of pills line
   up even when one title runs to two lines and another to one. */
.center-card .center-links {
    margin-top: auto;
    padding-top: clamp(10px, 1vw, 18px);
}

/* ---- tints ----------------------------------------------------------- */

.center-wide--lilac {
    --tint: linear-gradient(105deg, #FAF7FD 0%, #F3ECFB 100%);
    --accent: #6C2BB9;
}

.center-wide--rose {
    --tint: linear-gradient(105deg, #FDF6F5 0%, #FBEDEC 100%);
    --accent: #C0392B;
}

.center-wide--blue {
    --tint: linear-gradient(105deg, #F6F9FE 0%, #EAF1FC 100%);
    --accent: #1F3163;
}

.center-wide--pink {
    --tint: linear-gradient(105deg, #FDF7F9 0%, #FBEEF2 100%);
    --accent: #D6336C;
}

.center-card--red {
    --tint: linear-gradient(160deg, #FDF5F5 0%, #FAEAEA 100%);
    --accent: #B11A18;
}

.center-card--sky {
    --tint: linear-gradient(160deg, #F7FAFE 0%, #EDF3FC 100%);
    --accent: #2C6FD1;
}

.center-card--teal {
    --tint: linear-gradient(160deg, #F6FAFB 0%, #EBF4F6 100%);
    --accent: #14808F;
}

/* The supplied figures-bar icons are drawn in slate, which all but vanishes
   on the navy bar. `brightness(0)` flattens each one to black whatever its
   own colours are, then `invert(1)` turns it white. Scoped by src so a
   coloured icon fed in from elsewhere is left alone. */
.stat__icon[src^="/assets/icons/stat-"] {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* ---- RTL -------------------------------------------------------------- */

/* Everything else mirrors on its own through the logical properties above;
   these only need the glyph itself turned round, and the illustrations
   flipped so they still lean into the card rather than off it. */
[dir="rtl"] .center-link i {
    transform: scaleX(-1);
}

[dir="rtl"] .center-feature__photo,
[dir="rtl"] .center-wide__photo {
    transform: scaleX(-1);
}

.coe-feature__media {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    width: 55%;
    height: 100%;
    border-radius: var(--radius-16);
    overflow: hidden;
    background: var(--color-bg-card-mint);
}

    .coe-feature__media::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to left, rgb(0 0 0 / 0%), rgb(255 255 255 / 88%));
        pointer-events: none; /* clicks reach the image */
    }

[dir="rtl"] .coe-feature__media::after {
    background: linear-gradient(to right, rgb(0 0 0 / 0%), rgb(255 255 255 / 88%));
}


/*.img-box {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

    .img-box img {
        display: block;
        width: 100%;
        height: auto;
    }*/


/* ---- responsive -------------------------------------------------------- */


.coe-card--lilac .coe-card__subcenter {
    max-width: 80%;
    flex-direction: row;
    display: flex;
    flex-wrap: wrap;
}

    .coe-card--lilac .coe-card__subcenter a {
        align-items: center;
    }


@media (max-width: 1399.98px) {
    /* The flagship's title fits one word per line once the column narrows,
     so the cap that holds it to two lines has to go. */
    .center-feature__title {
        max-width: none;
    }
}

@media (min-width: 640px) {
    .centers-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1100px) {
    .centers-top {
        margin-block-start: 80px;
        /* grid-template-columns: 1.41fr 1fr 1fr; */
        gap: 23px;
    }

    .center-feature {
        grid-column: auto;
        grid-row: 1 / span 2;
        /* height: 595px; */
        min-height: 0;
        padding: 40px;
    }
}

@media (max-width: 1199.98px) {
    .centers-top {
        margin-block-start: 80px;
        /*        grid-template-columns: 1.41fr 1fr 1fr;*/
        gap: 23px;
    }

    .center-feature {
        grid-column: auto;
        grid-row: 1 / span 2;
        /* height: 595px; */
        min-height: 0;
        padding: 40px;
    }

    .centers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .center-feature__body,
    .center-wide__body {
        min-height: clamp(150px, 16vw, 210px);
    }
}

@media (max-width: 767.98px) {
    /* Below this width there is no room for text beside an illustration, so
     the cards stack and the picture takes a row of its own. */
    .center-feature,
    .center-wide {
        flex-direction: column;
    }

    .center-feature__body,
    .center-wide__body {
        order: 2;
        min-height: 0;
        padding-inline-end: clamp(13px, 1.3vw, 24px);
    }

    .center-feature__title {
        max-width: none;
    }
}


@media (min-width: 1100px) {
    .coe-feature__media {
        width: 65%;
    }
}

@media (max-width: 600px) {
    .btn-solid {
        font-size: 0.8rem;
    }

    .centers-grid {
        grid-template-columns: 1fr;
    }

    .center-feature__photo {
        margin-left: 0px;
        margin-right: 0px;
    }

    .center-card > .coe-chip,
    .center-card > .center-card__title,
    .center-card > .coe-card__subcenter,
    .center-card--lilac > .coe-card__subcenter {
        /*   max-width: calc(58cqi - 24px);*/
    }

    .center-card > .center-card__title {
        width: auto;
    }

    .center-feature .center-pill {
        position: relative;
        order: -1;
        margin-bottom: 0px;
    }

    .center-card__photo, .coe-feature__media {
        position: relative;
        inset: auto;
        order: 0;
        width: 100%;
        height: 190px;
        margin-bottom: 15px;
    }

    .center-card > .coe-card__subcenter {
        max-width: none;
    }

    .center-card__title, .center-feature__title {
        max-width: 100%;
        order: -1;
    }

    .center-card .center-pill {
        position: relative;
        order: -1;
        margin-bottom: 0px;
    }
}
