/* Food & Beverage content surfaces. Keep the approved hero system separate.
 * Layered important rules win over legacy unlayered palette overrides.
 * Text follows the nearest surface, not the outer section's background.
 */
@layer food-beverage-content {
    body.route-food-beverage #main > :where(section:not([class*="hero"])) {
        --fb-content-ink: #20362a;
        --fb-content-copy: #485c4e;
        --fb-content-accent: #526b28;
        color: var(--fb-content-ink) !important;
    }

    body.route-food-beverage #main > section:not([class*="hero"]) :is(h2, h3, h4, h5, h6, strong, dt, summary) {
        color: var(--fb-content-ink) !important;
        -webkit-text-fill-color: currentColor !important;
        text-shadow: none !important;
    }
    body.route-food-beverage #main > section:not([class*="hero"]) :is(p, li, small, dd, td) {
        color: var(--fb-content-copy) !important;
        -webkit-text-fill-color: currentColor !important;
        text-shadow: none !important;
    }
    body.route-food-beverage #main > section:not([class*="hero"]) :is(.fpp-eyebrow, .sfh-kicker, .sfh-final__kicker, .iic-kicker, .lpd__eyebrow, .lpd__rail-title, .sfh-evidence-card__programme, .fpp-system-card__label) {
        color: var(--fb-content-accent) !important;
        -webkit-text-fill-color: currentColor !important;
        opacity: 1 !important;
    }

    /* Match the existing Request Technical Review brand green exactly. */
    body.route-food-beverage #main :is(.fpp-challenges, .sfh-method, .sfh-documents, .sfh-final, .iic-selection, .iic-application-planes, .iic-product-docs, .iic-close, .fpp-documents__inner) {
        --fb-content-ink: #ffffff;
        --fb-content-copy: #ffffff;
        --fb-content-accent: #ffffff;
        background: #5c7427 !important;
        color: #ffffff !important;
    }

    /* White cards remain distinct from the surrounding leaf-green band. */
    body.route-food-beverage #main :is(.fpp-challenges__grid > article, .fpp-monitoring__grid > article, .fpp-system-card, .sfh-method__steps > li, .sfh-document-card, .sfh-evidence-card, .iic-selection__grid > div:last-child > article, .iic-application-planes__grid > article, .iic-product-docs__grid > div:last-child > a, .iic-product-card, .fph-category-brief, .fph-product-summary, .fph-technical, .fph-common-faq) {
        --fb-content-ink: #20362a;
        --fb-content-copy: #485c4e;
        --fb-content-accent: #526b28;
        background: #ffffff !important;
        color: var(--fb-content-ink) !important;
    }

    body.route-food-beverage #main :is(.fpp-monitoring, .fpp-system-navigation, .iic-product-gallery, .sfh-evidence) {
        background: #f3f6eb !important;
    }
    body.route-food-beverage #main :is(.fpp-documents, .fpp-cta, .lpd, .fph, .sfh-selector, .iic-product-review) {
        background: #ffffff !important;
    }

    /* Comfortable editorial scale and clear separation between cards. */
    body.route-food-beverage #main :is(.fpp-challenges, .fpp-monitoring, .fpp-system-navigation) {
        padding: clamp(52px, 5.5vw, 80px) 0 !important;
    }
    body.route-food-beverage #main :is(.fpp-section-heading, .fpp-system-navigation__heading) {
        max-width: none !important;
        margin-bottom: 32px !important;
    }
    body.route-food-beverage #main :is(.fpp-section-heading h2, .fpp-monitoring__intro h2, .fpp-documents h2, .fpp-cta h2) {
        max-width: 27ch !important;
        font-size: clamp(2rem, 3.15vw, 3rem) !important;
        line-height: 1.12 !important;
        letter-spacing: -.035em !important;
        text-wrap: pretty !important;
    }
    body.route-food-beverage #main :is(.fpp-challenges__grid, .fpp-monitoring__grid, .fpp-system-navigation__grid, .sfh-method__steps) {
        gap: 18px !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }
    body.route-food-beverage #main :is(.fpp-challenges__grid, .fpp-monitoring__grid, .fpp-system-navigation__grid) {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    body.route-food-beverage #main :is(.fpp-challenges__grid > article, .fpp-monitoring__grid > article, .fpp-system-card, .sfh-method__steps > li) {
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 28px !important;
        border: 1px solid #d8e2cb !important;
        border-radius: 14px !important;
        box-shadow: 0 8px 24px rgba(24, 48, 33, .06) !important;
    }
    body.route-food-beverage #main .fpp-challenges__grid > article::before {
        display: none !important;
    }
    body.route-food-beverage #main .fpp-challenges__grid > article > span {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 32px !important;
        margin: 0 0 24px !important;
        border-radius: 6px !important;
        background: #edf2df !important;
        color: #526b28 !important;
        -webkit-text-fill-color: currentColor !important;
        font-size: .8125rem !important;
        font-weight: 700 !important;
    }
    body.route-food-beverage #main :is(.fpp-challenges__grid, .fpp-monitoring__grid, .fpp-system-navigation__grid) h3 {
        margin: 0 !important;
        font-size: 1.375rem !important;
        line-height: 1.3 !important;
        letter-spacing: -.02em !important;
    }
    body.route-food-beverage #main :is(.fpp-challenges__grid, .fpp-monitoring__grid, .fpp-system-navigation__grid) p {
        margin: 12px 0 0 !important;
        font-size: 1rem !important;
        line-height: 1.65 !important;
    }
    body.route-food-beverage #main .fpp-monitoring > .container {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    body.route-food-beverage #main .fpp-monitoring__intro h2 {
        max-width: 30ch !important;
    }
    body.route-food-beverage #main .fpp-documents {
        padding: 48px 0 !important;
    }
    body.route-food-beverage #main .fpp-documents__inner {
        gap: 32px !important;
        padding: clamp(26px, 3.2vw, 46px) !important;
        border: 0 !important;
        border-radius: 16px !important;
    }
    body.route-food-beverage #main .fpp-documents__inner :is(.fpp-inline-action, .fpp-inline-action span) {
        color: #ffffff !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main .fpp-system-navigation__heading {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important;
        gap: 18px 48px !important;
    }
    body.route-food-beverage #main .fpp-system-navigation__heading h2 {
        max-width: 24ch !important;
    }
    body.route-food-beverage #main .fpp-system-card__label {
        margin: 24px 0 12px !important;
        font-size: .75rem !important;
    }
    body.route-food-beverage #main .fpp-system-card__action {
        color: #526b28 !important;
        -webkit-text-fill-color: currentColor !important;
        margin-top: auto !important;
        padding-top: 24px !important;
        font-size: .875rem !important;
    }
    body.route-food-beverage #main .fpp-system-card:is(:hover, :focus-visible) {
        border-color: #637a2d !important;
        box-shadow: 0 12px 28px rgba(24, 48, 33, .12) !important;
    }

    /* Controls set both their own text and nested numbers/icons. */
    body.route-food-beverage #main > section:not([class*="hero"]) :is(.page-button, .iic-button, .sfh-button--primary) {
        background: #5c7427 !important;
        border-color: #5c7427 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main > section:not([class*="hero"]) :is(.page-button, .iic-button, .sfh-button--primary) :is(span, b, strong) {
        color: #ffffff !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.sfh-final, .iic-close) :is(.sfh-button, .iic-button) {
        background: #ffffff !important;
        border-color: #ffffff !important;
        color: #20362a !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.sfh-final, .iic-close) :is(.sfh-button, .iic-button) :is(span, b, strong) {
        color: #20362a !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.lpd__challenge, .lpd__stage, .lpd__parameter, .sfh-selector button, .fph-category-tabs button, .fph-technical-tabs button) {
        --fb-content-ink: #20362a;
        --fb-content-copy: #485c4e;
        color: #20362a !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.lpd__challenge, .lpd__stage, .lpd__parameter, .sfh-selector button, .fph-category-tabs button, .fph-technical-tabs button) span,
    body.route-food-beverage #main :is(.lpd__solution-mark, .lpd__toolbar > span) {
        color: #526b28 !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.lpd__challenge.is-active, .sfh-selector button[aria-selected="true"], .fph-category-tabs button[aria-selected="true"], .fph-technical-tabs button[aria-selected="true"]) {
        --fb-content-ink: #ffffff;
        --fb-content-copy: #ffffff;
        background: #5c7427 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.lpd__challenge.is-active, .sfh-selector button[aria-selected="true"], .fph-category-tabs button[aria-selected="true"], .fph-technical-tabs button[aria-selected="true"]) :is(span, strong) {
        color: #ffffff !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main .fph-category-tabs button[aria-selected="true"] span {
        background: #ffffff !important;
        color: #526b28 !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main .fph-product-card small {
        background: #edf2df !important;
        color: #526b28 !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(.lpd__mode-label span, .iic-gallery-head > span) {
        color: #485c4e !important;
        -webkit-text-fill-color: currentColor !important;
    }
    body.route-food-beverage #main :is(a, button, summary):focus-visible {
        outline: 3px solid #819b37 !important;
        outline-offset: 4px !important;
    }

    @media (max-width: 1000px) {
        body.route-food-beverage #main .fpp-challenges__grid {
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        }
    }
    @media (max-width: 760px) {
        body.route-food-beverage #main :is(.fpp-challenges__grid, .fpp-monitoring__grid, .fpp-system-navigation__grid, .fpp-system-navigation__heading) {
            grid-template-columns: minmax(0, 1fr) !important;
        }
        body.route-food-beverage #main :is(.fpp-challenges__grid > article, .fpp-monitoring__grid > article, .fpp-system-card) {
            padding: 24px !important;
        }
        body.route-food-beverage #main .fpp-documents__inner {
            flex-direction: column !important;
            align-items: flex-start !important;
        }
        body.route-food-beverage #main .fpp-challenges__grid > article { padding: 16px 20px !important; }
        body.route-food-beverage #main .fpp-challenges__grid > article > span { display: none !important; }
        body.route-food-beverage #main .fpp-challenges__grid { gap: 10px !important; }
    }
}
