/*
 * Final hero layout guard.
 *
 * This file is intentionally loaded after the legacy/public hero layers. It
 * keeps the shared heroes compact and prevents audience helper text from
 * inheriting the white-on-light treatment used by dark promotional blocks.
 */

:root {
    --copp-page-hero-min-height: 320px;
}

/* Homepage slider */
.copp-hero {
    height: 392px !important;
    min-height: 392px !important;
}

.copp-hero__slides,
.copp-hero__track,
.copp-hero__slide,
.copp-hero__inner {
    height: 392px !important;
    min-height: 392px !important;
}

.copp-hero__inner {
    padding: 24px 108px 28px !important;
}

.copp-hero__copy {
    align-content: center !important;
    align-self: center !important;
    grid-template-rows: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
}

.copp-hero__copy h1,
.copp-hero__copy > p {
    min-height: 0 !important;
}

.copp-hero__copy h1 {
    margin-bottom: 18px !important;
}

.copp-hero__copy > p {
    margin-bottom: 16px !important;
}

.copp-hero__actions {
    grid-row: auto !important;
}

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

.copp-hero__people {
    bottom: -18px !important;
    height: calc(100% + 18px) !important;
    right: -18px !important;
    transform: none !important;
    width: min(80%, 500px) !important;
}

/* All public entry heroes use the same compact vertical rhythm. */
.copp-news-hero,
.copp-gallery-hero {
    padding-top: 20px !important;
    padding-bottom: 24px !important;
}

.copp-news-hero > .copp-news-hero__inner,
.copp-gallery-hero > .copp-gallery-hero__inner {
    min-height: var(--copp-page-hero-min-height) !important;
    gap: 32px !important;
}

.copp-news-hero .copp-news-hero__title,
.copp-gallery-hero .copp-gallery-hero__title {
    font-size: clamp(40px, 4.2vw, 60px) !important;
    line-height: 1.06 !important;
    margin-bottom: 16px !important;
}

.copp-news-hero [class$="__subtitle"],
.copp-gallery-hero [class$="__subtitle"] {
    font-size: 18px !important;
    line-height: 1.35 !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

.copp-news-hero .copp-news-hero__lead,
.copp-news-hero [class$="__lead-copy"],
.copp-gallery-hero .copp-gallery-hero__subtitle {
    font-size: 18px !important;
    line-height: 1.45 !important;
    margin-top: 14px !important;
}

.copp-news-hero .copp-news-hero__actions,
.copp-gallery-hero .copp-gallery-hero__actions {
    margin-top: 18px !important;
}

.copp-news-hero > .copp-news-hero__inner > .copp-news-hero__media,
.copp-gallery-hero > .copp-gallery-hero__inner > .copp-gallery-hero__media {
    min-height: 280px !important;
}

.copp-news-hero .copp-news-hero__media img {
    min-height: 280px !important;
}

/* Full-width public heroes */
.copp-news-hero,
.copp-gallery-hero {
    min-height: var(--copp-page-hero-min-height) !important;
}

.copp-news-hero > .copp-news-hero__inner,
.copp-gallery-hero > .copp-gallery-hero__inner {
    min-height: var(--copp-page-hero-min-height) !important;
    padding: 32px 72px 36px !important;
}

/* Article/catalog heroes inside the content area */
: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
) {
    min-height: var(--copp-page-hero-min-height) !important;
    padding: 32px 40px 36px !important;
}

:is(
    .copp-project-article__copy,
    .copp-equipment-article__copy,
    .copp-contest-article__copy
) {
    padding: 32px 40px 36px !important;
}

@media (max-width: 1199.98px) and (min-width: 992px) {
    .copp-hero,
    .copp-hero__slides,
    .copp-hero__track,
    .copp-hero__slide,
    .copp-hero__inner {
        height: 400px !important;
        min-height: 400px !important;
    }

    .copp-hero__inner,
    .copp-news-hero > .copp-news-hero__inner,
    .copp-gallery-hero > .copp-gallery-hero__inner {
        padding-left: 56px !important;
        padding-right: 56px !important;
    }
}

@media (max-width: 991.98px) {
    .copp-hero,
    .copp-hero__slides,
    .copp-hero__track,
    .copp-hero__slide,
    .copp-news-hero,
    .copp-gallery-hero {
        height: auto !important;
        min-height: 0 !important;
    }

    .copp-hero__inner,
    .copp-news-hero > .copp-news-hero__inner,
    .copp-gallery-hero > .copp-gallery-hero__inner {
        min-height: 0 !important;
        padding: 32px 36px 44px !important;
    }

    .copp-hero__inner {
        height: auto !important;
    }

    .copp-hero__copy {
        align-content: start !important;
        display: grid !important;
        grid-template-rows: auto !important;
        height: auto !important;
    }

    .copp-hero__visual,
    .copp-visual {
        min-height: 260px !important;
    }

    :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
    ) {
        min-height: 0 !important;
        padding: 32px 36px 44px !important;
    }
}

@media (max-width: 767.98px) {
    .copp-hero__inner,
    .copp-news-hero > .copp-news-hero__inner,
    .copp-gallery-hero > .copp-gallery-hero__inner {
        padding: 28px 20px 36px !important;
    }

    :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
    ) {
        padding: 28px 20px 36px !important;
    }
}

/* Final desktop sizing: media art must not dictate a tall hero. */
@media (min-width: 992px) {
    .copp-news-hero > .copp-news-hero__inner,
    .copp-gallery-hero > .copp-gallery-hero__inner {
        height: auto !important;
        min-height: 0 !important;
        padding: 16px 72px 20px !important;
    }

    .copp-news-hero > .copp-news-hero__inner > .copp-news-hero__media,
    .copp-gallery-hero > .copp-gallery-hero__inner > .copp-gallery-hero__media {
        height: 320px !important;
        min-height: 320px !important;
        max-height: 320px !important;
        overflow: hidden !important;
    }

    .copp-news-hero > .copp-news-hero__inner > .copp-news-hero__media img {
        height: 320px !important;
        min-height: 0 !important;
        max-height: 320px !important;
    }

    .copp-gallery-hero > .copp-gallery-hero__inner > .copp-gallery-hero__media,
    .copp-gallery-hero .copp-gallery-hero__frame {
        height: 320px !important;
        min-height: 320px !important;
        max-height: 320px !important;
        overflow: hidden !important;
    }

    .copp-news-hero .copp-news-hero__title,
    .copp-gallery-hero .copp-gallery-hero__title {
        font-size: clamp(38px, 3.6vw, 52px) !important;
        line-height: 1.06 !important;
        margin-bottom: 12px !important;
    }

    .copp-news-hero [class$="__subtitle"],
    .copp-gallery-hero [class$="__subtitle"] {
        font-size: 17px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }

    .copp-news-hero .copp-news-hero__lead,
    .copp-news-hero [class$="__lead-copy"],
    .copp-gallery-hero .copp-gallery-hero__subtitle {
        font-size: 17px !important;
        line-height: 1.4 !important;
        margin-top: 10px !important;
    }

    .copp-news-hero .copp-news-hero__actions,
    .copp-gallery-hero .copp-gallery-hero__actions {
        margin-top: 14px !important;
    }

    .copp-news-hero .copp-news-btn,
    .copp-gallery-hero .copp-news-btn {
        min-height: 48px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

}

/* Keep article/catalog heroes compact as well, without clipping their copy. */
: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
) {
    min-height: var(--copp-page-hero-min-height) !important;
    padding: 24px 32px 28px !important;
}
