/*
 * INFRA-269: undo the serif font that O2B's support-site CSS causes.
 *
 * O2B's support_home.css sets `body { font-family: 'Inter', sans-serif !important }`
 * on every page, and knowledge_theme.css then sets
 * `body:not(.o_knowledge_active) { font-family: inherit !important }`. Nothing sets a
 * font on <html>, so every page that loads them falls back to the browser's default
 * serif: the backend, the login pages and the website pages.
 *
 * Each rule below puts back the font the page itself asks for. Themed Knowledge pages
 * (o_knowledge_active) are left alone. All three selectors are more specific than O2B's,
 * so they win whatever order the stylesheets load in (/slides loads support_home.css
 * twice, once after this file).
 */

/* 1. Backend pages (the web client's <body> has class o_web_client).
 *    --body-font-family is Odoo's own font variable; the fallback is the stack
 *    Odoo 18 compiles into it, in case the variable is ever missing. */
body.o_web_client:not(.o_knowledge_active) {
    font-family: var(--body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Ubuntu, "Noto Sans", Arial, "Odoo Unicode Support Noto", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji") !important;
}

/* 2. Login and website pages. On website pages --body-font-family carries the
 *    website's own body font (Inter on the main website, Odoo's system stack on the
 *    NYC website), so this restores exactly what each site is configured to show. */
body:not(.o_web_client):not(.o_knowledge_active) {
    font-family: var(--body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Ubuntu, "Noto Sans", Arial, "Odoo Unicode Support Noto", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji") !important;
}

/* 3. NYC portal pages. evi_nyc_portal sets its body font with `body:has(.evi-nyc)`
 *    (nyc_theme.scss, $nyc-font-body), which O2B's !important rule overrides. This is
 *    the same stack, as compiled. */
body:not(.o_web_client):not(.o_knowledge_active):has(.evi-nyc) {
    font-family: "NYC Roboto", Roboto, Arial, Helvetica, sans-serif !important;
}
