/* Extracted from ui/templates/components/breadcrumb_banner/breadcrumb_banner.html. Linked via sekizai so a page loads it once,
   however many instances it renders. */

.breadcrumb-banner-shell,
.breadcrumb-banner-shell * {
    box-sizing: border-box;
    font-family: "NYU Perstare", system-ui, sans-serif;
}

.breadcrumb-banner-shell {
    --breadcrumb-banner-cut-size: 30px;
    position: relative;
    width: 100%;
    background: #F7F7F7;
    overflow: hidden;
    clip-path: polygon(
        0 0,
        100% 0,
        100% calc(100% - var(--breadcrumb-banner-cut-size)),
        calc(100% - var(--breadcrumb-banner-cut-size)) 100%,
        0 100%
    );
}

.breadcrumb-banner-shell--cut-none {
    clip-path: none;
}

.breadcrumb-banner-shell--cut-small {
    --breadcrumb-banner-cut-size: 18px;
}

.breadcrumb-banner-shell--cut-medium {
    --breadcrumb-banner-cut-size: 30px;
}

.breadcrumb-banner-shell--cut-large {
    --breadcrumb-banner-cut-size: 52px;
}

.breadcrumb-banner-inner {
    width: 100%;
    padding: 48px 24px 56px;
}

.breadcrumb-banner-content {
    width: 100%;
    max-width: 920px;
}

.breadcrumb-banner-content.is-centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.breadcrumb-banner-content.is-split {
    max-width: 780px;
}

.breadcrumb-banner-content.is-left {
    text-align: left;
}

.breadcrumb-banner-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.breadcrumb-banner-content.is-centered .breadcrumb-banner-topline {
    justify-content: center;
}

.breadcrumb-banner-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 7px 16px;
    border-radius: 9999px;
    background: #FFFFFF;
}

.breadcrumb-banner-pill > ol {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #767676;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.breadcrumb-banner-pill li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-banner-pill a {
    color: inherit;
    text-decoration: none;
    transition: color 200ms ease;
}

.breadcrumb-banner-pill a:hover,
.breadcrumb-banner-pill a:focus-visible {
    color: #57068C;
    outline: none;
}

/* A size container, so the phone size below scales to the width the title
   actually gets wherever the header sits: inside a contained Row Container
   a phone gives it 88px less than the screen, at the top level 40px less. */
.breadcrumb-banner-heading {
    margin: 0;
    container-type: inline-size;
}

/* Size ramp and uppercase restored to their pre-74b19c2 values (42/56/60,
   text-transform: uppercase). That commit rewrote this rule from
   .breadcrumb-banner-title and dropped the uppercase while raising the ramp
   to 48/72/86; the change was not intentional. Colour (#161616) and
   line-height (0.98) are left at the newer values.

   On phones 42px is a ceiling, not the size. A word cannot wrap, and at 42px
   REIMBURSEMENTS (9.3em in these capitals, the widest word any current title
   uses) is wider than the 287px a contained Row Container leaves on a 375px
   phone, so the shell's overflow:hidden cut it off. 10cqw sets the type at a
   tenth of the heading's width, so any word up to 10em fits on one line:
   24px at 320px, about 29px at 375px, and 42px again once the heading is
   420px wide. The 28px line is the fallback for browsers without container
   units.

   Kept in CSS rather than offered as an editor font-size option on purpose:
   the size is responsive across three breakpoints, and CKEditor's fontSize
   emits a fixed inline style="font-size:..." on a span, which would beat
   every media query below and pin the title to one size at all widths. */
.breadcrumb-banner-heading > :is(h1, h2, h3, h4, h5, h6, p, div) {
    margin: 0;
    color: #161616;
    font-size: 28px;
    font-size: clamp(24px, 10cqw, 42px);
    line-height: 0.98;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.04em;
}

/* Last resort for a word wider than 10em, or a screen narrow enough to hit
   the 24px floor: break the word rather than let the shell clip it. The
   extra class outranks row-container.css, which resets overflow-wrap on
   every h1-h4 inside a row on phones, whichever sheet loads last. */
.breadcrumb-banner-shell .breadcrumb-banner-heading > :is(h1, h2, h3, h4, h5, h6, p, div) {
    overflow-wrap: break-word;
}

.breadcrumb-banner-heading strong,
.breadcrumb-banner-heading b {
    color: #57068C;
    font-weight: 800;
}

.breadcrumb-banner-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 28px;
    color: #161616;
}

.breadcrumb-banner-content.is-centered .breadcrumb-banner-meta {
    justify-content: center;
}

.breadcrumb-banner-meta-label {
    color: #161616;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: 0;
}

.breadcrumb-banner-description {
    max-width: 760px;
    margin-top: 28px;
    color: #555555;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: 0;
}

.breadcrumb-banner-content.is-centered .breadcrumb-banner-description {
    margin-left: auto;
    margin-right: auto;
}

.breadcrumb-banner-description > :first-child {
    margin-top: 0;
}

.breadcrumb-banner-description > :last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .breadcrumb-banner-inner {
        padding: 56px 44px 66px;
    }

    .breadcrumb-banner-heading > :is(h1, h2, h3, h4, h5, h6, p, div) {
        font-size: 56px;
    }
}

@media (min-width: 1024px) {
    .breadcrumb-banner-inner {
        padding: 72px 68px 82px;
    }

    .breadcrumb-banner-content.is-split {
        width: 56%;
    }

    .breadcrumb-banner-heading > :is(h1, h2, h3, h4, h5, h6, p, div) {
        font-size: 60px;
    }
}

@media (max-width: 640px) {
    .breadcrumb-banner-inner {
        padding: 40px 20px 48px;
    }

    .breadcrumb-banner-topline {
        margin-bottom: 22px;
    }

    .breadcrumb-banner-meta {
        margin-top: 22px;
        gap: 12px;
    }

    .breadcrumb-banner-meta-label {
        font-size: 20px;
    }

    .breadcrumb-banner-description {
        margin-top: 22px;
        font-size: 18px;
    }
}

/* --- Image header ------------------------------------------------------
   An image replaces the flat banner from 768px up. Below that the image is
   not rendered at all and the header falls back to the plain banner with a
   visible title. That mobile rendering is also what Google indexes
   (mobile-first), so the H1 it sees is real visible text, not clipped. */
.breadcrumb-banner-shell--has-image {
    background: #FFFFFF;
}

.breadcrumb-banner-media {
    display: none;
    width: 100%;
    line-height: 0;
}

.breadcrumb-banner-media-img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Clipped rather than display:none, so it stays in the accessibility
   tree. Never swap this for display:none or visibility:hidden — that
   removes the heading from screen readers and defeats the whole point. */
.breadcrumb-banner-heading--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 768px) {
    .breadcrumb-banner-shell--has-image .breadcrumb-banner-media {
        display: block;
    }

    .breadcrumb-banner-shell--has-image .breadcrumb-banner-heading {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    /* Nothing but the clipped heading left in the text block, so drop its
       padding and let the image sit flush. */
    .breadcrumb-banner-shell--has-image .breadcrumb-banner-inner--empty {
        padding: 0;
    }
}

/* --- Split image header ------------------------------------------------
   Layout "Split with Image": the title block on the left, the photo on the
   right behind a slanted edge, from 1024px up. Below that the image is not
   rendered (the template's <source> skips the download) and the shell is a
   plain left-aligned banner, breadcrumbs and title included.

   The text column is a three-row grid, 1fr / auto / 1fr: breadcrumbs pinned
   to the top left of the first row, title + badge + description in the
   middle row, centred or left-aligned by the Title alignment setting. Equal outer rows put the middle block at the true vertical centre of
   the banner, not just the centre of the space under the breadcrumbs, and a
   tall breadcrumb pill can only grow its own row rather than overlap.

   The banner height is a minimum (--breadcrumb-banner-split-height, set
   inline from the Header image height choice), so a title that wraps onto
   extra lines grows the banner instead of being cut off. The image fills
   whatever height that comes to. */
@media (min-width: 1024px) {
    .breadcrumb-banner-shell--image-split {
        display: grid;
        grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
        min-height: var(--breadcrumb-banner-split-height, 420px);
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-inner {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        padding: 40px 56px 40px 64px;
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-content {
        flex: 1 1 auto;
        display: grid;
        grid-template-rows: 1fr auto 1fr;
        max-width: none;
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-topline {
        grid-row: 1;
        align-self: start;
        margin-bottom: 0;
        padding-bottom: 24px;
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-body {
        grid-row: 2;
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-description {
        max-width: 560px;
        margin-top: 20px;
        font-size: 20px;
    }

    /* Title alignment "Center" (the default): the title block is centred
       across its column as well as down it. "Left" lines it up under the
       breadcrumbs. The breadcrumb pill stays top left either way. */
    .breadcrumb-banner-content.is-body-centered .breadcrumb-banner-body {
        text-align: center;
    }

    .breadcrumb-banner-content.is-body-centered .breadcrumb-banner-meta {
        justify-content: center;
    }

    .breadcrumb-banner-content.is-body-centered .breadcrumb-banner-description {
        margin-left: auto;
        margin-right: auto;
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-media {
        display: block;
        grid-column: 2;
        grid-row: 1;
        position: relative;
        clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
    }

    .breadcrumb-banner-shell--image-split .breadcrumb-banner-media picture,
    .breadcrumb-banner-shell--image-split .breadcrumb-banner-media-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }
}
