/**
 * Unified navigation-family Hero layout system.
 *
 * This file controls shared desktop height, container width and floating
 * transparent media. Botanical decoration is intentionally kept in the
 * separate hero-background.css file so it can be edited independently.
 */

/* Internal-page Heroes used by the main navigation and product catalog. */
:is(
    .ahm-page-manufacturing .ahm-page-hero,
    .ahm-capsule-hero,
    .ahm-gummy-hero,
    .ahm-powder-hero,
    .ahm-softgel-hero,
    .ahm-tablet-hero,
    .ahm-liquid-hero,
    .dosage-hero,
    .product-hero,
    .ahm-services-hero,
    .ahm-formulation-hero,
    .ahm-packaging-hero,
    .ahm-about-hero,
    .ahm-cert-hero,
    .ahm-page-manufacturing-facilities .ahm-page-hero,
    .ahm-page-quality .ahm-page-hero,
    .ahm-page-contact .ahm-page-hero,
    .ahm-page-resources .ahm-page-hero,
    .ahm-faq-hero,
    .ahm-blog-hero,
    .dosage-form-archive-hero,
    .private-label-archive-hero
) {
    --ahm-internal-hero-height: 620px;
    position: relative;
    min-height: var(--ahm-internal-hero-height);
    isolation: isolate;
    overflow: hidden;
}

/* Remove old rings, circles and hard split decorations. */
:is(
    .ahm-services-hero,
    .ahm-formulation-hero,
    .ahm-packaging-hero,
    .ahm-faq-hero,
    .product-hero,
    .dosage-hero,
    .ahm-blog-hero
)::before,
:is(
    .ahm-services-hero,
    .ahm-formulation-hero,
    .ahm-packaging-hero,
    .ahm-faq-hero,
    .product-hero,
    .dosage-hero
)::after {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.ahm-packaging-hero::before {
    display: none;
}

/* Hero content always sits above the decorative layer. */
:is(
    .ahm-page-hero-grid,
    .ahm-capsule-hero-grid,
    .ahm-gummy-hero-grid,
    .ahm-powder-hero-grid,
    .ahm-softgel-hero-grid,
    .ahm-tablet-hero-grid,
    .ahm-liquid-hero-grid,
    .dosage-hero > .container,
    .product-hero-grid,
    .ahm-services-hero__grid,
    .ahm-formulation-hero__grid,
    .ahm-packaging-hero__inner,
    .ahm-about-hero > .container,
    .ahm-cert-hero > .container,
    .ahm-faq-hero > .container,
    .ahm-blog-hero > .container,
    .dosage-form-archive-hero-grid,
    .private-label-archive-hero > .container
) {
    position: relative;
    z-index: 1;
}

/* Never let a late Hero component override the global container width. */
:is(
    .ahm-page-hero-grid,
    .ahm-capsule-hero-grid,
    .ahm-gummy-hero-grid,
    .ahm-powder-hero-grid,
    .ahm-softgel-hero-grid,
    .ahm-tablet-hero-grid,
    .ahm-liquid-hero-grid,
    .product-hero-grid,
    .ahm-services-hero__grid,
    .ahm-formulation-hero__grid,
    .ahm-packaging-hero__inner,
    .dosage-form-archive-hero-grid
) {
    max-width: var(--container);
    margin-inline: auto;
}

/*
 * One desktop rhythm for the standard internal-page Hero grids.
 * Text-only and archive Heroes retain their own internal spacing while the
 * section itself still receives the same 620px minimum height.
 */
:is(
    .ahm-page-manufacturing .ahm-page-hero-grid,
    .ahm-capsule-hero-grid,
    .ahm-gummy-hero-grid,
    .ahm-powder-hero-grid,
    .ahm-softgel-hero-grid,
    .ahm-tablet-hero-grid,
    .ahm-liquid-hero-grid,
    .dosage-hero-content,
    .product-hero-grid,
    .ahm-services-hero__grid,
    .ahm-formulation-hero__grid,
    .ahm-packaging-hero__inner,
    .ahm-about-hero-grid,
    .ahm-cert-hero-grid,
    .ahm-page-manufacturing-facilities .ahm-page-hero-grid,
    .ahm-page-quality .ahm-page-hero-grid,
    .ahm-page-contact .ahm-page-hero-grid,
    .ahm-page-resources .ahm-page-hero-grid,
    .dosage-form-archive-hero-grid
) {
    min-height: var(--ahm-internal-hero-height);
}

.ahm-packaging-hero__inner {
    display: flex;
    align-items: center;
}

.ahm-faq-hero > .container,
.private-label-archive-hero > .container {
    min-height: var(--ahm-internal-hero-height);
    display: flex;
    align-items: center;
}

.ahm-faq-hero-copy,
.private-label-hero-layout {
    width: 100%;
}

/* Transparent/floating Hero media. */
:is(
    .ahm-page-hero-media,
    .ahm-capsule-hero-media,
    .ahm-gummy-hero-media,
    .ahm-powder-hero-media,
    .ahm-softgel-hero-media,
    .ahm-tablet-hero-media,
    .ahm-liquid-hero-media,
    .dosage-hero-visual,
    .product-hero-media,
    .ahm-services-hero__media,
    .ahm-formulation-hero__media,
    .ahm-about-hero-media,
    .ahm-cert-hero-media
) {
    position: relative;
    display: flex;
    min-height: 430px;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Remove former rings, cards and glow shapes around product cut-outs. */
:is(
    .ahm-capsule-hero-media,
    .ahm-gummy-hero-media,
    .ahm-powder-hero-media,
    .ahm-softgel-hero-media,
    .ahm-tablet-hero-media,
    .ahm-liquid-hero-media,
    .dosage-hero-visual,
    .product-hero-media,
    .ahm-services-hero__media,
    .ahm-formulation-hero__media,
    .ahm-about-hero-media,
    .ahm-cert-hero-media
)::before,
:is(.dosage-hero-visual, .product-hero-media)::after {
    display: none;
}

:is(
    .ahm-page-hero-image,
    .ahm-capsule-hero-media > img,
    .ahm-gummy-hero-media > img,
    .ahm-powder-hero-media > img,
    .ahm-softgel-hero-media > img,
    .ahm-tablet-hero-media > img,
    .ahm-liquid-hero-media > img,
    .dosage-hero-visual > img,
    .product-hero-image,
    .ahm-services-hero__media > img,
    .ahm-formulation-hero__media > img,
    .ahm-about-hero-media > img,
    .ahm-cert-hero-media > img
) {
    display: block;
    width: 100%;
    max-width: 620px;
    height: auto;
    min-height: 0;
    max-height: 500px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    object-position: center;
    box-shadow: none;
    filter: drop-shadow(0 25px 30px rgba(11, 29, 58, .16));
}

@media (max-width: 1180px) {
    :is(
        .ahm-page-manufacturing .ahm-page-hero,
        .ahm-capsule-hero,
        .ahm-gummy-hero,
        .ahm-powder-hero,
        .ahm-softgel-hero,
        .ahm-tablet-hero,
        .ahm-liquid-hero,
        .ahm-services-hero,
        .ahm-formulation-hero,
        .ahm-packaging-hero,
        .ahm-about-hero,
        .ahm-cert-hero,
        .ahm-page-manufacturing-facilities .ahm-page-hero,
        .ahm-page-quality .ahm-page-hero,
        .ahm-page-contact .ahm-page-hero,
        .ahm-page-resources .ahm-page-hero,
        .ahm-faq-hero,
        .ahm-blog-hero,
        .dosage-hero,
        .product-hero,
        .dosage-form-archive-hero,
        .private-label-archive-hero
    ),
    :is(
        .ahm-page-hero-grid,
        .ahm-capsule-hero-grid,
        .ahm-gummy-hero-grid,
        .ahm-powder-hero-grid,
        .ahm-softgel-hero-grid,
        .ahm-tablet-hero-grid,
        .ahm-liquid-hero-grid,
        .dosage-hero-content,
        .product-hero-grid,
        .ahm-services-hero__grid,
        .ahm-formulation-hero__grid,
        .ahm-packaging-hero__inner,
        .ahm-about-hero-grid,
        .ahm-cert-hero-grid,
        .ahm-faq-hero > .container,
        .ahm-blog-hero-grid,
        .dosage-form-archive-hero-grid,
        .private-label-archive-hero > .container
    ) {
        min-height: auto;
    }

    .ahm-faq-hero > .container,
    .private-label-archive-hero > .container {
        display: block;
    }
}

@media (max-width: 960px) {
    :is(
        .ahm-page-hero-grid,
        .ahm-capsule-hero-grid,
        .ahm-gummy-hero-grid,
        .ahm-powder-hero-grid,
        .ahm-softgel-hero-grid,
        .ahm-tablet-hero-grid,
        .ahm-liquid-hero-grid,
        .ahm-services-hero__grid,
        .ahm-formulation-hero__grid,
        .ahm-about-hero-grid,
        .ahm-cert-hero-grid,
        .dosage-hero-content,
        .product-hero-grid
    ) {
        grid-template-columns: 1fr;
    }

    :is(
        .ahm-page-hero-media,
        .ahm-capsule-hero-media,
        .ahm-gummy-hero-media,
        .ahm-powder-hero-media,
        .ahm-softgel-hero-media,
        .ahm-tablet-hero-media,
        .ahm-liquid-hero-media,
        .dosage-hero-visual,
        .product-hero-media,
        .ahm-services-hero__media,
        .ahm-formulation-hero__media,
        .ahm-about-hero-media,
        .ahm-cert-hero-media
    ) {
        min-height: 360px;
        justify-self: center;
    }

    :is(
        .ahm-page-hero-image,
        .ahm-capsule-hero-media > img,
        .ahm-gummy-hero-media > img,
        .ahm-powder-hero-media > img,
        .ahm-softgel-hero-media > img,
        .ahm-tablet-hero-media > img,
        .ahm-liquid-hero-media > img,
        .dosage-hero-visual > img,
        .product-hero-image,
        .ahm-services-hero__media > img,
        .ahm-formulation-hero__media > img,
        .ahm-about-hero-media > img,
        .ahm-cert-hero-media > img
    ) {
        max-height: 410px;
    }
}

@media (max-width: 767px) {
    :is(
        .ahm-page-hero-media,
        .ahm-capsule-hero-media,
        .ahm-gummy-hero-media,
        .ahm-powder-hero-media,
        .ahm-softgel-hero-media,
        .ahm-tablet-hero-media,
        .ahm-liquid-hero-media,
        .dosage-hero-visual,
        .product-hero-media,
        .ahm-services-hero__media,
        .ahm-formulation-hero__media,
        .ahm-about-hero-media,
        .ahm-cert-hero-media
    ) {
        min-height: 280px;
    }

    :is(
        .ahm-page-hero-image,
        .ahm-capsule-hero-media > img,
        .ahm-gummy-hero-media > img,
        .ahm-powder-hero-media > img,
        .ahm-softgel-hero-media > img,
        .ahm-tablet-hero-media > img,
        .ahm-liquid-hero-media > img,
        .dosage-hero-visual > img,
        .product-hero-image,
        .ahm-services-hero__media > img,
        .ahm-formulation-hero__media > img,
        .ahm-about-hero-media > img,
        .ahm-cert-hero-media > img
    ) {
        max-height: 320px;
        filter: drop-shadow(0 17px 20px rgba(11, 29, 58, .13));
    }

}

@media (prefers-reduced-motion: reduce) {
    :is(
        .ahm-page-hero-image,
        .ahm-capsule-hero-media > img,
        .ahm-gummy-hero-media > img,
        .ahm-powder-hero-media > img,
        .ahm-softgel-hero-media > img,
        .ahm-tablet-hero-media > img,
        .ahm-liquid-hero-media > img,
        .dosage-hero-visual > img,
        .product-hero-image,
        .ahm-services-hero__media > img,
        .ahm-formulation-hero__media > img,
        .ahm-about-hero-media > img,
        .ahm-cert-hero-media > img
    ) {
        transition: none;
    }
}
