/*
 * Final compact/readable hero guard.
 *
 * This is intentionally a new asset name. The public template previously
 * accumulated several hero layers and a stale cached layer could turn the
 * next-step copy white on the light background. Keep this file last in the
 * layout so the visual contract is explicit and cache-busted.
 */

@media (min-width: 768px) {
    /* Homepage slider: compact fixed frame for the track calculations. */
    html body .copp-hero,
    html body .copp-hero__slides,
    html body .copp-hero__track,
    html body .copp-hero__slide,
    html body .copp-hero__inner {
        box-sizing: border-box !important;
        height: 260px !important;
        max-height: 260px !important;
        min-height: 260px !important;
    }

    html body .copp-hero__inner {
        align-items: center !important;
        gap: 34px !important;
        padding: 10px clamp(24px, 7vw, 96px) 12px !important;
    }

    html body .copp-hero__copy {
        align-self: center !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        justify-content: center !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    html body .copp-hero__copy h1 {
        color: #263746 !important;
        font-size: clamp(32px, 3vw, 40px) !important;
        line-height: 1.04 !important;
        margin: 0 0 7px !important;
        max-width: 560px !important;
        min-height: 0 !important;
        -webkit-text-fill-color: #263746 !important;
    }

    html body .copp-hero__copy h1 span {
        color: var(--copp-red) !important;
        -webkit-text-fill-color: var(--copp-red) !important;
    }

    html body .copp-hero__copy > p {
        color: #263746 !important;
        font-size: 15px !important;
        line-height: 1.32 !important;
        margin: 0 0 8px !important;
        max-width: 520px !important;
        min-height: 0 !important;
        -webkit-text-fill-color: #263746 !important;
    }

    html body .copp-hero__actions {
        display: flex !important;
        flex: 0 0 auto !important;
        gap: 10px !important;
        grid-row: auto !important;
        height: 40px !important;
        margin: 0 !important;
        max-width: 500px !important;
    }

    html body .copp-hero__btn {
        box-sizing: border-box !important;
        height: 40px !important;
        min-height: 40px !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    html body .copp-hero__visual,
    html body .copp-visual {
        min-height: 0 !important;
    }

    html body .copp-hero__people {
        bottom: -4px !important;
        height: calc(100% + 4px) !important;
        right: -8px !important;
        transform: none !important;
        width: min(70%, 410px) !important;
    }

    /* Full-width public entry heroes. */
    html body :is(
        .copp-news-hero,
        .copp-gallery-hero,
        .copp-knowledge-hero,
        .copp-opportunity-hero,
        .copp-about-subpage-hero,
        .copp-programs-page-hero,
        .copp-partners-hero,
        .copp-resume-bank-hero,
        .copp-school-hero,
        .copp-students-hero,
        .copp-stories-hero,
        .copp-edu-orgs-hero,
        .copp-events-hero,
        .copp-contacts-hero,
        .copp-contests-hero,
        .copp-projects-hero
    ) {
        box-sizing: border-box !important;
        min-height: 260px !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    html body :is(
        .copp-news-hero,
        .copp-gallery-hero
    ) > :is(.copp-news-hero__inner, .copp-gallery-hero__inner) {
        align-items: center !important;
        box-sizing: border-box !important;
        gap: 28px !important;
        min-height: 260px !important;
        padding: 10px clamp(24px, 7vw, 96px) 12px !important;
    }

    html body :is(.copp-news-hero__copy, .copp-gallery-hero__copy, .copp-knowledge-hero__copy) {
        align-self: center !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        min-height: 0 !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    html body :is(.copp-news-hero__title, .copp-gallery-hero__title, .copp-knowledge-hero__title) {
        color: #263746 !important;
        font-size: clamp(30px, 3vw, 42px) !important;
        line-height: 1.04 !important;
        margin: 0 0 7px !important;
        min-height: 0 !important;
        -webkit-text-fill-color: #263746 !important;
    }

    html body :is(
        .copp-news-hero__subtitle,
        .copp-news-hero__lead,
        .copp-gallery-hero__subtitle,
        .copp-knowledge-hero__subtitle,
        .copp-knowledge-hero__lead,
        [class$="__lead-copy"]
    ) {
        color: #263746 !important;
        font-size: 15px !important;
        line-height: 1.32 !important;
        margin: 0 0 7px !important;
        opacity: 1 !important;
        -webkit-text-fill-color: #263746 !important;
    }

    html body :is(.copp-news-hero__media, .copp-gallery-hero__media, .copp-gallery-hero__frame) {
        height: 220px !important;
        max-height: 220px !important;
        min-height: 220px !important;
        overflow: hidden !important;
    }

    html body :is(.copp-news-hero__media, .copp-gallery-hero__media) img {
        height: 220px !important;
        max-height: 220px !important;
        min-height: 0 !important;
    }
}

/* Article/catalog heroes: compact padding without clipping long titles. */
html body :is(
    .copp-programs-archive__hero,
    .copp-program-article__hero,
    .copp-news-article__hero,
    .copp-project-article__hero,
    .copp-equipment-article__hero,
    .copp-contest-article__hero,
    .copp-knowledge-item__hero,
    .copp-resources-archive__hero,
    .copp-resource-article__hero
) {
    box-sizing: border-box !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 18px 24px 20px !important;
}

@media (max-width: 767.98px) {
    html body .copp-hero,
    html body .copp-hero__slides,
    html body .copp-hero__track,
    html body .copp-hero__slide,
    html body .copp-hero__inner,
    html body :is(
        .copp-news-hero,
        .copp-gallery-hero,
        .copp-knowledge-hero,
        .copp-opportunity-hero,
        .copp-about-subpage-hero,
        .copp-programs-page-hero,
        .copp-partners-hero,
        .copp-resume-bank-hero,
        .copp-school-hero,
        .copp-students-hero,
        .copp-stories-hero,
        .copp-edu-orgs-hero,
        .copp-events-hero,
        .copp-contacts-hero,
        .copp-contests-hero,
        .copp-projects-hero
    ) {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    html body .copp-hero__inner,
    html body :is(.copp-news-hero, .copp-gallery-hero) > :is(.copp-news-hero__inner, .copp-gallery-hero__inner) {
        height: auto !important;
        min-height: 0 !important;
        padding: 16px 18px 20px !important;
    }

    html body .copp-hero__copy h1 {
        font-size: 34px !important;
    }

    html body .copp-hero__copy > p {
        font-size: 14px !important;
    }

    html body :is(.copp-news-hero__media, .copp-gallery-hero__media, .copp-gallery-hero__frame) {
        height: 180px !important;
        max-height: 180px !important;
        min-height: 180px !important;
    }

    html body :is(.copp-news-hero__media, .copp-gallery-hero__media) img {
        height: 180px !important;
        max-height: 180px !important;
    }

}
