/*
 * Stable public hero contract.
 *
 * This is the last hero layer loaded by the layout. It restores a predictable
 * desktop frame without clipping copy and keeps the public palette readable.
 * Helper text is intentionally not styled or rendered here.
 */

:root {
    --copp-hero-hotfix-home-height: 392px;
    --copp-hero-hotfix-page-height: 360px;
    --copp-hero-hotfix-media-height: 300px;
    --copp-hero-hotfix-ink: #123e56;
    --copp-hero-hotfix-red: var(--copp-red);
}

@media (min-width: 768px) {
    /* Homepage slider. Keep every nested slider layer on the same geometry. */
    html body :is(
        .copp-hero,
        .copp-hero__slides,
        .copp-hero__track,
        .copp-hero__slide,
        .copp-hero__inner
    ) {
        box-sizing: border-box !important;
        height: var(--copp-hero-hotfix-home-height) !important;
        max-height: var(--copp-hero-hotfix-home-height) !important;
        min-height: var(--copp-hero-hotfix-home-height) !important;
    }

    html body .copp-hero {
        overflow: hidden !important;
    }

    html body .copp-hero__inner {
        align-items: center !important;
        gap: 42px !important;
        padding: 20px clamp(28px, 7vw, 108px) 24px !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,
    html body .copp-hero__copy > p {
        color: var(--copp-hero-hotfix-ink) !important;
        -webkit-text-fill-color: var(--copp-hero-hotfix-ink) !important;
        mix-blend-mode: normal !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    html body .copp-hero__copy h1 {
        font-size: clamp(36px, 3.1vw, 42px) !important;
        line-height: 1.05 !important;
        margin: 0 0 12px !important;
        max-width: 560px !important;
        min-height: 0 !important;
    }

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

    html body .copp-hero__copy > p {
        font-size: 16px !important;
        line-height: 1.4 !important;
        margin: 0 0 16px !important;
        max-width: 520px !important;
        min-height: 0 !important;
    }

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

    html body .copp-hero__btn {
        box-sizing: border-box !important;
        height: 44px !important;
        min-height: 44px !important;
    }

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

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

    /* Full-width public 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;
        height: var(--copp-hero-hotfix-page-height) !important;
        max-height: var(--copp-hero-hotfix-page-height) !important;
        min-height: var(--copp-hero-hotfix-page-height) !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;
        height: 100% !important;
        min-height: 0 !important;
        padding: 24px clamp(28px, 7vw, 108px) !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,
        .copp-news-hero__subtitle,
        .copp-news-hero__lead,
        .copp-gallery-hero__subtitle,
        .copp-knowledge-hero__subtitle,
        .copp-knowledge-hero__lead,
        [class$="__lead-copy"]
    ) {
        color: var(--copp-hero-hotfix-ink) !important;
        -webkit-text-fill-color: var(--copp-hero-hotfix-ink) !important;
        mix-blend-mode: normal !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    html body :is(.copp-news-hero__title, .copp-gallery-hero__title, .copp-knowledge-hero__title) {
        font-size: clamp(30px, 3vw, 42px) !important;
        line-height: 1.05 !important;
        margin: 0 0 12px !important;
        min-height: 0 !important;
    }

    html body :is(.copp-news-hero__title, .copp-gallery-hero__title, .copp-knowledge-hero__title) span {
        color: var(--copp-hero-hotfix-red) !important;
        -webkit-text-fill-color: var(--copp-hero-hotfix-red) !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"]
    ) {
        font-size: 15px !important;
        line-height: 1.4 !important;
        margin: 0 0 12px !important;
    }

    html body :is(.copp-news-hero__actions, .copp-gallery-hero__actions) {
        flex: 0 0 auto !important;
        margin: 12px 0 0 !important;
    }

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

    html body :is(.copp-news-hero__media, .copp-gallery-hero__media) img {
        height: var(--copp-hero-hotfix-media-height) !important;
        max-height: var(--copp-hero-hotfix-media-height) !important;
        min-height: 0 !important;
    }
}

/* Article and catalog hero cards must grow with their copy. */
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;
}

html body :is(
    .copp-programs-archive__hero h1,
    .copp-program-article__hero h1,
    .copp-news-article__hero h1,
    .copp-project-article__hero h1,
    .copp-equipment-article__hero h1,
    .copp-contest-article__hero h1,
    .copp-knowledge-item__hero h1,
    .copp-resources-archive__hero h1,
    .copp-resource-article__hero h1,
    .copp-programs-archive__hero p,
    .copp-program-article__hero p,
    .copp-news-article__hero p,
    .copp-project-article__hero p,
    .copp-equipment-article__hero p,
    .copp-contest-article__hero p,
    .copp-knowledge-item__hero p,
    .copp-resources-archive__hero p,
    .copp-resource-article__hero p
) {
    color: var(--copp-hero-hotfix-ink) !important;
    -webkit-text-fill-color: var(--copp-hero-hotfix-ink) !important;
    mix-blend-mode: normal !important;
    opacity: 1 !important;
    visibility: visible !important;
}

@media (max-width: 767.98px) {
    html body :is(
        .copp-hero,
        .copp-hero__slides,
        .copp-hero__track,
        .copp-hero__slide,
        .copp-hero__inner,
        .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: 20px 18px 24px !important;
    }

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

    html body .copp-hero__copy > p {
        font-size: 14px !important;
        line-height: 1.45 !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;
    }
}
