/* global-font.css — one consistent UI font (Noto Sans JP) across the app.
 *
 * Loaded once per request via the shared includes (top_bar / sidebar_navigation /
 * admin_top). Sets the base body font AND overrides hardcoded per-page font-family
 * with !important, while EXCLUDING icon + monospace elements via :not() so each page's
 * own FontAwesome / Material Symbols / code fonts are left completely untouched
 * (important because the codebase mixes FA5 and FA6 — we must not pin a family name).
 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
    --font-stack: 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
}

/* Baseline (inherited): every element without its own font-family gets Noto Sans JP. */
body {
    font-family: var(--font-stack);
}

/* Consistency override: beat hardcoded page font-family, but never touch icon glyph
 * fonts (FontAwesome <i>, Material Symbols) or monospace/code elements.
 * NOTE: the :not() chain MUST stay on one line — whitespace between compounds would
 * become a descendant combinator and break the selector. */
body,
body *:not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.fad):not(.fass):not(.fasr):not([class^="fa-"]):not([class*=" fa-"]):not(.material-symbols-outlined):not(.material-symbols-rounded):not(.material-symbols-sharp):not(.material-icons):not(.bi):not([class^="bi-"]):not([class*=" bi-"]):not(.glyphicon):not([class*="glyphicon"]):not(code):not(pre):not(kbd):not(samp):not(tt):not(.mono):not([class*="monospace"]) {
    font-family: var(--font-stack) !important;
}

/* Re-assert a clean monospace stack for code-ish elements (in case a page set none). */
code, pre, kbd, samp, tt, .mono, [class*="monospace"] {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Courier New', monospace !important;
}
