/* Homepage-led palette rhythm shared by every Everklin page family. */

body.everklin-transformed {
    --ek-home-white: #ffffff;
    --ek-home-cream: #f5f2ea;
    --ek-home-sage: #7a9439;
    --ek-home-sage-strong: #6f862d;
    --ek-home-olive: #7a9439;
    --ek-home-olive-deep: #7a9439;
    --ek-olive: #7a9439;
    --ekp-olive: #7a9439;
    --theme-olive: #7a9439;
    --everklin-olive: #7a9439;
    --ek-home-ink: #26362b;
    --ek-home-copy: #5a675f;
    --ek-home-line: #d5debf;
    background: var(--ek-home-white) !important;
}

body.everklin-transformed main {
    color: var(--ek-home-ink);
    background: var(--ek-home-white) !important;
}

/* Restore the homepage palette roles after global-white-canvas normalises them. */
body.everklin-transformed :is(
    .corp-home,
    .solutions-flagship,
    .solutions-hub,
    .sfh-page,
    .wtfl-page,
    .water-treatment-family,
    .sp-page,
    .shared-solution-page,
    .fpp-page,
    .fph,
    .iic-flagship,
    .iic-industry-flagship,
    .industrial-care-flagship,
    .industries-hub,
    .industry-page,
    .room-hub,
    .room-care-product-hub,
    .brewery-page,
    .industrial-glass-page,
    .flagship-journey,
    .anchor-page,
    .sustainability-nova,
    .sustainability-tesla,
    .sustainability-flagship,
    .resource-flagship,
    .resources-flagship,
    .knowledge-flagship,
    .downloads-flagship,
    .contact-ultra,
    .th-home,
    .ek-system,
    .ek-prototype,
    .lpd
) {
    --ch-olive: #7a9439 !important;
    --sfh-olive: #7a9439 !important;
    --fpi-olive: #7a9439 !important;
    --fw-olive: #7a9439 !important;
    --iic-olive: #7a9439 !important;
    --industry-olive: #7a9439 !important;
    --ih-olive: #7a9439 !important;
    --sn-olive: #7a9439 !important;
    --rf-olive: #7a9439 !important;
    --contact-olive: #7a9439 !important;
    --ch-cream: var(--ek-home-cream) !important;
    --ch-warm-white: var(--ek-home-white) !important;
    --sf-cream: var(--ek-home-cream) !important;
    --sfh-cream: var(--ek-home-cream) !important;
    --sfh-soft-cream: var(--ek-home-sage) !important;
    --wtfl-cream: var(--ek-home-cream) !important;
    --sp-cream: var(--ek-home-cream) !important;
    --wsp-cream: var(--ek-home-cream) !important;
    --fpp-cream: var(--ek-home-cream) !important;
    --fpi-cream: var(--ek-home-cream) !important;
    --fpi-cream-strong: var(--ek-home-sage) !important;
    --fw-cream: var(--ek-home-cream) !important;
    --iic-cream: var(--ek-home-cream) !important;
    --iic-ref-cream: var(--ek-home-sage) !important;
    --industry-cream: var(--ek-home-cream) !important;
    --ih-cream: var(--ek-home-cream) !important;
    --room-cream: var(--ek-home-cream) !important;
    --brew-cream: var(--ek-home-cream) !important;
    --ii-cream: var(--ek-home-cream) !important;
    --fj-cream: var(--ek-home-cream) !important;
    --sn-cream: var(--ek-home-cream) !important;
    --st-cream: var(--ek-home-cream) !important;
    --resource-cream: var(--ek-home-cream) !important;
    --rf-cream: var(--ek-home-cream) !important;
    --re-cream: var(--ek-home-cream) !important;
    --ke-cream: var(--ek-home-cream) !important;
    --rg-cream: var(--ek-home-cream) !important;
    --contact-cream: var(--ek-home-cream) !important;
    --pc-cream: var(--ek-home-cream) !important;
    --th-cream: var(--ek-home-cream) !important;
    --lpd-cream: var(--ek-home-cream) !important;
    --lpd-paper: var(--ek-home-white) !important;
    --ekd-cream-100: var(--ek-home-cream) !important;
}

/*
 * Template fallback: older and product-specific pages do not all share the
 * same section class names. Keep the homepage's authored rhythm intact, then
 * give every other direct content chapter the same white / cream / sage flow.
 */
body.everklin-transformed main:not(.corp-home) > section:not([class*="hero"]):nth-of-type(3n + 1) {
    background: var(--ek-home-white) !important;
}

body.everklin-transformed main:not(.corp-home) > section:not([class*="hero"]):nth-of-type(3n + 2) {
    background: var(--ek-home-cream) !important;
}

body.everklin-transformed main:not(.corp-home) > section:not([class*="hero"]):nth-of-type(3n) {
    background: var(--ek-home-sage) !important;
}

/* White is the primary canvas, including every light hero copy panel. */
body.everklin-transformed main :is(
    .corp-hero__content,
    .solutions-hero__copy,
    .industries-hub__hero-copy,
    .sfh-hero__copy,
    .fpp-hero__copy,
    .iic-hero__content,
    .ek-inner-home-hero__panel,
    .contact-hero__copy
) {
    background: rgba(255, 255, 255, .96) !important;
}

body.everklin-transformed main :is(
    .solutions-workflow,
    .solutions-industries,
    .sfh-proof,
    .sfh-selector,
    .sfh-evidence,
    .industries-hub__intro,
    .industries-hub__connection,
    .iic-intro,
    .iic-selection,
    .iic-why-everklin,
    .sn-intro,
    .sn-impact-dashboard,
    .knowledge-featured,
    .contact-section--channels,
    .iic-room-facility,
    .fsv2-reference,
    .fpp-documents,
    .iic-hub-highlights
) {
    background: var(--ek-home-white) !important;
}

/* Warm cream separates editorial chapters without tinting the whole page. */
body.everklin-transformed main :is(
    .solutions-selection,
    .business-operating-profile,
    .sfh-documents,
    .industries-hub__portfolio,
    .iic-category-map,
    .iic-industry-controls,
    .knowledge-filter,
    .knowledge-library,
    .contact-section--inquiry,
    .contact-support-chapter,
    .room-hub-faq,
    .ich-category-faq,
    .fph,
    .lpd
) {
    background: var(--ek-home-cream) !important;
}

/* Pale green is reserved for guidance, selection and support moments. */
body.everklin-transformed main :is(
    .solutions-review,
    .sfh-method,
    .sfh-final,
    .industries-hub__selection,
    .industries-hub__review,
    .iic-environments,
    .iic-product-docs,
    .iic-close,
    .sn-orbit-section,
    .sn-trustrow,
    .sn-final,
    .knowledge-pathways,
    .anchor-final-cta,
    .contact-close-chapter
) {
    color: #ffffff !important;
    background: var(--ek-home-sage) !important;
}

/* Company and document pages use the same repeating three-surface cadence. */
body.everklin-transformed main .anchor-content {
    background: var(--ek-home-white) !important;
}

body.everklin-transformed main .anchor-content > .anchor-section:nth-child(3n + 1) {
    background: var(--ek-home-white) !important;
}

body.everklin-transformed main .anchor-content > .anchor-section:nth-child(3n + 2) {
    background: var(--ek-home-cream) !important;
}

body.everklin-transformed main .anchor-content > .anchor-section:nth-child(3n) {
    background: var(--ek-home-sage) !important;
}

body.everklin-transformed main :is(
    .download-control-panel,
    .resource-control-panel,
    .download-two-section-library
) {
    background: var(--ek-home-cream) !important;
}

/* Repeated items stay white so the section color remains calm and readable. */
body.everklin-transformed main :is(
    article,
    .card,
    .resource-card,
    .download-card,
    .contact-channel,
    .contact-document-card,
    .fph-product-card,
    .fph-product-summary,
    .fph-technical,
    .fph-info-pairs article,
    .fph-property-list div
):not(.sn-statement):not(.iic-close):not(.anchor-final-card) {
    --ek-card-surface: var(--ek-home-white);
}

body.everklin-transformed main :is(
    .contact-channel,
    .contact-document-card,
    .download-card,
    .resource-card
) {
    background: var(--ek-home-white) !important;
    border-color: var(--ek-home-line) !important;
}

/* One typography hierarchy follows the homepage contrast rules. */
body.everklin-transformed main :is(
    .solutions-review,
    .sfh-final,
    .industries-hub__selection,
    .industries-hub__review,
    .iic-environments,
    .iic-product-docs,
    .iic-close,
    .sn-final,
    .knowledge-pathways,
    .anchor-final-cta,
    .contact-close-chapter
) :is(h1, h2, h3, h4, strong) {
    color: #ffffff !important;
}

body.everklin-transformed main :is(
    .solutions-review,
    .sfh-final,
    .industries-hub__selection,
    .industries-hub__review,
    .iic-environments,
    .iic-product-docs,
    .iic-close,
    .sn-final,
    .knowledge-pathways,
    .anchor-final-cta,
    .contact-close-chapter
) :is(p, li, dd) {
    color: rgba(255, 255, 255, .9) !important;
}

body.everklin-transformed main :is(
    .corp-kicker,
    .solutions-kicker,
    .industries-hub__kicker,
    .sfh-kicker,
    .iic-kicker,
    .fpp-eyebrow,
    .sn-kicker,
    .contact-eyebrow,
    .inner-kicker,
    .section-kicker,
    .eyebrow,
    .kicker
) {
    color: var(--ek-home-olive-deep) !important;
}

/* Olive remains the action color, rather than becoming a heavy page theme. */
body.everklin-transformed main :is(
    .page-button:not(.page-button-secondary):not(.page-button--secondary):not(.page-button--outline):not(.page-button--light),
    .solutions-button--olive,
    .industries-hub__button--olive,
    .sfh-button--primary,
    .iic-button:not(.iic-button--outline),
    .sn-button:not(.sn-button--quiet):not(.sn-button--light):not(.sn-button--line),
    .contact-button--primary,
    .contact-submit,
    .iic-hub-button--on-dark,
    .resource-action--request
) {
    color: #ffffff !important;
    border-color: var(--ek-home-olive-deep) !important;
    background: var(--ek-home-olive-deep) !important;
}

body.everklin-transformed main :is(
    .page-button-secondary,
    .page-button--secondary,
    .page-button--outline,
    .sfh-button--light,
    .iic-button--outline,
    .sn-button--quiet,
    .sn-button--light,
    .sn-button--line
) {
    color: var(--ek-home-ink) !important;
    border-color: #a8ba77 !important;
    background: var(--ek-home-white) !important;
}

/* Final visual enforcement for legacy templates with high-specificity skins. */
html body.everklin-transformed.everklin-transformed #main:not(.corp-home) > section:not([class*="hero"]):nth-of-type(3n + 1) {
    background: #ffffff !important;
}

html body.everklin-transformed.everklin-transformed #main:not(.corp-home) > section:not([class*="hero"]):nth-of-type(3n + 2) {
    background: #f5f2ea !important;
}

html body.everklin-transformed.everklin-transformed #main:not(.corp-home) > section:not([class*="hero"]):nth-of-type(3n) {
    color: #ffffff !important;
    background: #7a9439 !important;
}

html body.everklin-transformed.everklin-transformed #main#main :is(
    .solutions-workflow,
    .solutions-industries,
    .sfh-proof,
    .sfh-selector,
    .sfh-evidence,
    .industries-hub__intro,
    .industries-hub__connection,
    .iic-intro,
    .iic-selection,
    .iic-why-everklin,
    .sn-intro,
    .sn-impact-dashboard,
    .knowledge-featured,
    .contact-section--channels,
    .iic-room-facility,
    .fsv2-reference,
    .fpp-documents,
    .iic-hub-highlights
) {
    color: var(--ek-home-ink) !important;
    background: #ffffff !important;
}

html body.everklin-transformed.everklin-transformed #main#main :is(
    .solutions-selection,
    .business-operating-profile,
    .sfh-documents,
    .industries-hub__portfolio,
    .iic-category-map,
    .iic-industry-controls,
    .knowledge-filter,
    .knowledge-library,
    .contact-section--inquiry,
    .contact-support-chapter,
    .room-hub-faq,
    .ich-category-faq,
    .fph,
    .lpd
) {
    color: var(--ek-home-ink) !important;
    background: #f5f2ea !important;
}

html body.everklin-transformed.everklin-transformed #main#main :is(
    .solutions-review,
    .sfh-method,
    .sfh-final,
    .industries-hub__selection,
    .industries-hub__review,
    .iic-environments,
    .iic-product-docs,
    .iic-close,
    .sn-orbit-section,
    .sn-trustrow,
    .sn-final,
    .knowledge-pathways,
    .anchor-final-cta,
    .contact-close-chapter
) {
    color: #ffffff !important;
    background: #7a9439 !important;
}

html body.everklin-transformed.everklin-transformed #main#main .anchor-content > .anchor-section:nth-child(3n + 1) {
    background: #ffffff !important;
}

html body.everklin-transformed.everklin-transformed #main#main .anchor-content > .anchor-section:nth-child(3n + 2) {
    background: #f5f2ea !important;
}

html body.everklin-transformed.everklin-transformed #main#main .anchor-content > .anchor-section:nth-child(3n) {
    color: #ffffff !important;
    background: #7a9439 !important;
}

/* Dark olive bands use light type; white content cards retain dark type. */
html body.everklin-transformed.everklin-transformed #main#main :is(
    .solutions-review,
    .sfh-method,
    .sfh-final,
    .industries-hub__selection,
    .industries-hub__review,
    .iic-environments,
    .iic-product-docs,
    .iic-close,
    .sn-orbit-section,
    .sn-trustrow,
    .sn-final,
    .knowledge-pathways,
    .anchor-final-cta,
    .contact-close-chapter,
    .anchor-content > .anchor-section:nth-child(3n)
) :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, strong, a) {
    color: #ffffff !important;
}

html body.everklin-transformed.everklin-transformed #main#main :is(
    .solutions-review,
    .sfh-method,
    .sfh-final,
    .industries-hub__selection,
    .industries-hub__review,
    .iic-environments,
    .iic-product-docs,
    .iic-close,
    .sn-orbit-section,
    .sn-trustrow,
    .sn-final,
    .knowledge-pathways,
    .anchor-final-cta,
    .contact-close-chapter,
    .anchor-content > .anchor-section:nth-child(3n)
) :is(.card, .resource-card, .download-card, .anchor-card, .contact-channel, .contact-document-card) :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, strong) {
    color: var(--ek-home-ink) !important;
}

html body.everklin-transformed.everklin-transformed #main#main :is(
    .solutions-workflow,
    .solutions-industries,
    .sfh-proof,
    .sfh-selector,
    .sfh-evidence,
    .industries-hub__intro,
    .industries-hub__connection,
    .iic-intro,
    .iic-selection,
    .iic-why-everklin,
    .sn-intro,
    .sn-impact-dashboard,
    .knowledge-featured,
    .contact-section--channels,
    .iic-room-facility,
    .fsv2-reference,
    .fpp-documents,
    .iic-hub-highlights,
    .solutions-selection,
    .business-operating-profile,
    .sfh-documents,
    .industries-hub__portfolio,
    .iic-category-map,
    .iic-industry-controls,
    .knowledge-filter,
    .knowledge-library,
    .contact-section--inquiry,
    .contact-support-chapter,
    .room-hub-faq,
    .ich-category-faq,
    .fph,
    .lpd
) :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, strong) {
    color: var(--ek-home-ink) !important;
}

html body.everklin-transformed.everklin-transformed #main#main a.iic-hub-button.iic-hub-button--on-dark,
html body.everklin-transformed.everklin-transformed #main#main a.page-button.resource-action.resource-action--request {
    color: #ffffff !important;
    border-color: #7a9439 !important;
    background: #7a9439 !important;
}

@media (max-width: 760px) {
    body.everklin-transformed main :is(
        .solutions-selection,
        .business-operating-profile,
        .sfh-documents,
        .industries-hub__portfolio,
        .iic-category-map,
        .knowledge-filter,
        .knowledge-library,
        .contact-section--inquiry,
        .contact-support-chapter
    ) {
        background: var(--ek-home-cream) !important;
    }
}
