/*
 * Food & Beverage uses the Company's image-and-panel composition.
 *
 * The legacy styles contain high-specificity, unlayered !important rules.
 * Important declarations in this named layer deliberately take precedence
 * over them. Keep every selector route-scoped and every layout value here
 * together, so desktop and mobile cannot inherit different hero systems.
 */
body.route-food-beverage {
    --fb-ink: #20362a;
    --fb-copy: #4c6052;
    --fb-olive: #819b37;
    --fb-olive-deep: #637a2d;
    --fb-mist: #edf2dc;
    --fb-line: rgba(99, 122, 45, .24);
    --fb-stage-height: 700px;
    --fb-gutter: max(40px, calc((100vw - 1360px) / 2));
}

@layer food-beverage-hero {
    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) {
        position: relative !important;
        isolation: isolate !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: var(--fb-stage-height) !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        border-bottom: 1px solid var(--fb-line) !important;
        border-radius: 0 !important;
        background-color: var(--fb-mist) !important;
        color: var(--fb-ink) !important;
    }

    body.route-food-beverage #main :is(.sfh-hero__grid, .fpp-hero__grid, .iic-product-hero__grid, .sample-hero__grid) {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: none !important;
        min-height: var(--fb-stage-height) !important;
        margin: 0 !important;
        padding: 48px var(--fb-gutter) !important;
        gap: 32px !important;
    }

    body.route-food-beverage #main :is(.sfh-hero__copy, .fpp-hero__copy, .iic-hero__content, .iic-product-hero__copy, .sample-hero__copy) {
        position: relative !important;
        z-index: 2 !important;
        display: block !important;
        flex: 0 1 660px !important;
        width: min(660px, 54vw) !important;
        max-width: min(660px, 54vw) !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: clamp(30px, 3.75vw, 54px) !important;
        overflow: visible !important;
        border: 1px solid var(--fb-line) !important;
        border-left: 5px solid var(--fb-olive) !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, .95) !important;
        box-shadow: 0 26px 66px rgba(32, 54, 42, .14) !important;
        color: var(--fb-ink) !important;
        text-align: left !important;
        text-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        backdrop-filter: blur(12px) !important;
    }

    /* Photos fill the hero from the header down, as on the Company page.
       The old photo card's rounded corners and pale outer gutters are removed. */
    body.route-food-beverage #main :is(.sfh-hero__media, .fpp-hero__media) {
        position: absolute !important;
        z-index: 0 !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    body.route-food-beverage #main :is(.sfh-hero__media, .fpp-hero__media) :is(picture, img) {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: var(--fpp-hero-position, center) !important;
        filter: none !important;
        transform: none !important;
    }

    body.route-food-beverage #main :is(.sfh-hero__media, .fpp-hero__media)::after {
        content: "" !important;
        position: absolute !important;
        display: block !important;
        inset: 0 !important;
        background: linear-gradient(90deg, rgba(248,250,241,.7), rgba(248,250,241,.3) 48%, transparent 78%) !important;
        pointer-events: none !important;
    }

    body.route-food-beverage #main > .iic-hero {
        display: flex !important;
        align-items: center !important;
        padding: 48px var(--fb-gutter) !important;
        background-image: var(--iic-hero-image) !important;
        background-size: cover !important;
        background-position: center !important;
    }

    body.route-food-beverage #main > .iic-hero::before {
        background: linear-gradient(90deg, rgba(248,250,241,.7), rgba(248,250,241,.3) 48%, transparent 78%) !important;
    }

    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero)::before,
    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero)::after {
        display: none !important;
    }

    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) h1 {
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 0 22px !important;
        padding: 0 !important;
        font-size: clamp(2.4rem, 3.6vw, 3.65rem) !important;
        font-weight: 700 !important;
        line-height: 1.06 !important;
        letter-spacing: -.04em !important;
        color: var(--fb-ink) !important;
        -webkit-text-fill-color: var(--fb-ink) !important;
        text-shadow: none !important;
        text-wrap: pretty !important;
        overflow-wrap: break-word !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.route-food-beverage #main .sfh-hero h1 span {
        display: inline !important;
        color: inherit !important;
    }

    body.route-food-beverage #main :is(.sfh-hero .sfh-kicker, .fpp-hero .fpp-eyebrow, .iic-hero .iic-kicker, .iic-product-hero .iic-kicker, .sample-hero .sample-kicker) {
        display: block !important;
        margin: 0 0 18px !important;
        color: var(--fb-olive-deep) !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        line-height: 1.5 !important;
        letter-spacing: .13em !important;
        text-transform: uppercase !important;
    }

    body.route-food-beverage #main :is(.sfh-hero__lead, .fpp-hero__copy > p, .iic-hero .iic-lead, .iic-product-hero .iic-lead, .sample-hero .sample-lead) {
        max-width: 35rem !important;
        margin: 0 !important;
        color: var(--fb-copy) !important;
        font-size: 17px !important;
        font-weight: 400 !important;
        line-height: 1.65 !important;
    }

    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px 9px !important;
        margin: 0 0 28px !important;
        font-size: 12px !important;
        line-height: 1.6 !important;
    }

    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) nav :is(a, span, strong) {
        color: var(--fb-copy) !important;
        -webkit-text-fill-color: var(--fb-copy) !important;
    }

    body.route-food-beverage #main :is(.sfh-hero .sfh-actions, .fpp-hero__actions, .iic-hero .iic-actions, .iic-product-hero .iic-actions, .sample-hero .sample-actions) {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        margin: 28px 0 0 !important;
    }

    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) :is(.sfh-button, .page-button, .iic-button, .sample-button) {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        min-height: 50px !important;
        padding: 14px 22px !important;
        border: 1px solid #5c7427 !important;
        border-radius: 7px !important;
        background: #5c7427 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        text-decoration: none !important;
    }

    body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) :is(.sfh-button, .page-button, .iic-button, .sample-button):is(:hover, :focus-visible) {
        background: #4d6320 !important;
        border-color: #4d6320 !important;
        outline-color: var(--fb-olive-deep) !important;
    }

    /* Standalone product templates keep the actual packshot beside the copy. */
    body.route-food-beverage #main :is(.iic-product-hero__grid, .sample-hero__grid) {
        display: grid !important;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) !important;
    }

    body.route-food-beverage #main :is(.iic-product-hero__copy, .sample-hero__copy) {
        width: 100% !important;
        max-width: 660px !important;
    }

    body.route-food-beverage #main :is(.iic-product-hero .iic-packshot, .sample-hero__packshot) {
        width: 100% !important;
        min-height: 420px !important;
        margin: 0 !important;
    }

    body.route-food-beverage #main :is(.iic-product-hero .iic-packshot, .sample-hero__packshot) img {
        width: 100% !important;
        height: 440px !important;
        max-height: 440px !important;
        object-fit: contain !important;
    }

    @media (max-width: 900px) {
        body.route-food-beverage {
            --fb-gutter: 28px !important;
            --fb-stage-height: 620px !important;
        }
        body.route-food-beverage #main :is(.sfh-hero__copy, .fpp-hero__copy, .iic-hero__content) {
            width: min(600px, 75vw) !important;
            max-width: min(600px, 75vw) !important;
        }
        body.route-food-beverage #main :is(.iic-product-hero__grid, .sample-hero__grid) {
            grid-template-columns: 1fr !important;
        }
    }

    @media (max-width: 680px) {
        body.route-food-beverage {
            --fb-gutter: 18px !important;
            --fb-stage-height: 0px !important;
        }
        body.route-food-beverage #main :is(.sfh-hero__grid, .fpp-hero__grid) {
            padding: 56px 18px 24px !important;
        }
        body.route-food-beverage #main :is(.sfh-hero__copy, .fpp-hero__copy, .iic-hero__content, .iic-product-hero__copy, .sample-hero__copy) {
            width: 100% !important;
            max-width: 100% !important;
            flex-basis: auto !important;
            padding: 24px 20px !important;
            border-left-width: 4px !important;
            border-radius: 12px !important;
            backdrop-filter: none !important;
        }
        body.route-food-beverage #main :is(.sfh-hero__media, .fpp-hero__media) {
            height: 310px !important;
            bottom: auto !important;
        }
        body.route-food-beverage #main :is(.sfh-hero__media, .fpp-hero__media)::after {
            background: linear-gradient(180deg, transparent 55%, var(--fb-mist)) !important;
        }
        body.route-food-beverage #main > .iic-hero {
            padding: 56px 18px 24px !important;
            background-size: auto 310px !important;
            background-position: center top !important;
            background-repeat: no-repeat !important;
        }
        body.route-food-beverage #main > .iic-hero::before {
            background: linear-gradient(180deg, transparent 170px, var(--fb-mist) 310px) !important;
        }
        body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) h1 {
            font-size: clamp(34px, 8.8vw, 42px) !important;
            max-width: none !important;
            line-height: 1.08 !important;
            letter-spacing: -.03em !important;
        }
        body.route-food-beverage #main :is(.sfh-hero__lead, .fpp-hero__copy > p, .iic-hero .iic-lead, .iic-product-hero .iic-lead, .sample-hero .sample-lead) {
            font-size: 16px !important;
        }
        body.route-food-beverage #main :is(.iic-product-hero__grid, .sample-hero__grid) {
            padding: 28px 18px !important;
        }
        body.route-food-beverage #main > :is(.sfh-hero, .fpp-hero, .iic-hero, .iic-product-hero, .sample-hero) :is(.sfh-button, .page-button, .iic-button, .sample-button) {
            width: 100% !important;
        }
    }
}
