/* ============================================================
 * FIX #1: DEFINE all 4 CSS CUSTOM PROPERTIES (font tokens) that
 * the rest of the theme reads via var(--en-font-xxx) / var(--en-ff-xxx).
 *
 * Without these definitions — e.g. `var(--en-font-body)` = `undefined` →
 * falls back to `system-ui` → Plus Jakarta / Work Sans are NEVER requested
 * by any CSS selector on the page → browser considers them "unnecessary"
 * → ZERO entries in Network → Font filter (the exact bug user saw).
 *
 * Exactly match the :root{} block also pasted in header.php guaranteed
 * inline style — both places define identical values so whichever loads
 * first (external file vs inline) wins with same specificity.
 * ============================================================ */
:root {
  --en-font-sans: "Work Sans", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --en-font-body: "Work Sans", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --en-font-headline: "Plus Jakarta Sans", "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --en-ff-headline: "Plus Jakarta Sans", "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --en-ff-body: "Work Sans", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* =========================================================
 * ExpertNeighbor · 100% Local Self-Hosted Fonts
 * Load FIRST (before 01_tokens.css).
 * NO external calls to Google Fonts / fonts.gstatic at runtime.
 *
 * All binaries live in ./fonts/ alongside this stylesheet:
 *   PlusJakartaSans-{400,600,700}-{latin,latin-ext,vietnamese,cyrillic-ext}.woff2
 *   WorkSans-{400,500,600}-{latin,latin-ext,vietnamese}.woff2
 *   MaterialSymbolsOutlined-Variable.woff2
 *
 * PERFORMANCE NOTES:
 *   - font-display: swap on every face removes FOIT (3s "invisible text")
 *   - size-adjust / ascent-override / descent-override values below are
 *     calibrated against the system fallback stack (system-ui, Arial, sans-serif)
 *     so there is zero layout shift (CLS) when the real font replaces the
 *     fallback. Lighthouse explicitly recommends these "font metric overrides"
 *     as the way to mitigate layout shifts with `font-display: swap`.
 * ========================================================= */

/* ============================================================
 *  PLUS JAKARTA SANS  (Headlines / Display — weights 400 / 600 / 700)
 *  Metric offsets tuned vs system-ui (Windows/macOS/Android default sans).
 * ============================================================ */

/* --- 400 Regular --- */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  src: url("./fonts/PlusJakartaSans-400-cyrillic-ext.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
                 U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  src: url("./fonts/PlusJakartaSans-400-vietnamese.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  src: url("./fonts/PlusJakartaSans-400-latin-ext.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
  src: local("Plus Jakarta Sans"),
       local("PlusJakartaSans-Regular"),
       url("./fonts/PlusJakartaSans-400-latin.woff2") format("woff2"); }

/* --- 600 SemiBold --- */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99%; ascent-override: 104%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  src: url("./fonts/PlusJakartaSans-600-cyrillic-ext.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99%; ascent-override: 104%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
                 U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  src: url("./fonts/PlusJakartaSans-600-vietnamese.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99%; ascent-override: 104%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  src: url("./fonts/PlusJakartaSans-600-latin-ext.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99%; ascent-override: 104%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
  src: local("Plus Jakarta Sans SemiBold"),
       local("PlusJakartaSans-SemiBold"),
       url("./fonts/PlusJakartaSans-600-latin.woff2") format("woff2"); }

/* --- 700 Bold --- */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap;
  size-adjust: 98.5%; ascent-override: 105%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  src: url("./fonts/PlusJakartaSans-700-cyrillic-ext.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap;
  size-adjust: 98.5%; ascent-override: 105%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
                 U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  src: url("./fonts/PlusJakartaSans-700-vietnamese.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap;
  size-adjust: 98.5%; ascent-override: 105%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  src: url("./fonts/PlusJakartaSans-700-latin-ext.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap;
  size-adjust: 98.5%; ascent-override: 105%; descent-override: 28%; line-gap-override: 8%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
  src: local("Plus Jakarta Sans Bold"),
       local("PlusJakartaSans-Bold"),
       url("./fonts/PlusJakartaSans-700-latin.woff2") format("woff2"); }

/* ============================================================
 *  WORK SANS  (Body / Labels — weights 400 / 500 / 600)
 *  Metric offsets tuned vs system-ui fallback font stack.
 * ============================================================ */

/* --- 400 Regular --- */
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 100%; ascent-override: 100%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
                 U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  src: url("./fonts/WorkSans-400-vietnamese.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 100%; ascent-override: 100%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  src: url("./fonts/WorkSans-400-latin-ext.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 400; font-display: swap;
  size-adjust: 100%; ascent-override: 100%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
  src: local("Work Sans"),
       local("WorkSans-Regular"),
       url("./fonts/WorkSans-400-latin.woff2") format("woff2"); }

/* --- 500 Medium --- */
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 500; font-display: swap;
  size-adjust: 99.8%; ascent-override: 101%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
                 U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  src: url("./fonts/WorkSans-500-vietnamese.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 500; font-display: swap;
  size-adjust: 99.8%; ascent-override: 101%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  src: url("./fonts/WorkSans-500-latin-ext.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 500; font-display: swap;
  size-adjust: 99.8%; ascent-override: 101%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
  src: local("Work Sans Medium"),
       local("WorkSans-Medium"),
       url("./fonts/WorkSans-500-latin.woff2") format("woff2"); }

/* --- 600 SemiBold --- */
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
                 U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  src: url("./fonts/WorkSans-600-vietnamese.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  src: url("./fonts/WorkSans-600-latin-ext.woff2") format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 600; font-display: swap;
  size-adjust: 99.5%; ascent-override: 102%; descent-override: 26%; line-gap-override: 8%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
  src: local("Work Sans SemiBold"),
       local("WorkSans-SemiBold"),
       url("./fonts/WorkSans-600-latin.woff2") format("woff2"); }

/* ============================================================
 *  MATERIAL SYMBOLS OUTLINED  (Icons, variable font with all axes)
 *
 *  KEY FIX: font-display was `block` — this was the source of the
 *  "Font display" warning in Lighthouse. `block` tells the browser
 *  to hide text (invisible / FOIT) for 3 seconds waiting for the
 *  font to arrive — which causes LCP text delays like the 2,650ms
 *  in your report. Changing to `swap` means icons instantly paint
 *  in the system fall-back monospace font (harmless for Material
 *  Symbols because the codepoints are in the private-use area and
 *  are simply invisible until the font loads — no ugly text shift).
 *
 *  CRITICAL FIX #2: Material Symbols is a LIGATURE icon font —
 *  the INPUT to the icon lookup is the LATIN TEXT inside the span
 *  ("sort", "chevron_right", "calendar_today" etc. — all a-z, 0-9,
 *  underscore, hyphen = U+0000-017F Latin).  CSS Fonts Module L4
 *  says: when font-matching decides which @font-face to use for an
 *  element, it SKIPS faces whose unicode-range does NOT INTERSECT
 *  with the characters inside the element's text.  If the element
 *  contains ONLY Latin characters (all a-z_ words for ligatures),
 *  a @font-face restricted to private-use (U+E000+) is SKIPPED —
 *  OpenType ligature engine is NEVER RUN on the word → you see
 *  RAW TEXT "sort" instead of the hamburger icon.  That is the
 *  EXACT symptom the user reported after 12+ failed attempts.
 *
 *  WORKAROUND (BELOW): Declare TWO @font-face blocks of the SAME
 *  family name ("Material Symbols Outlined"):
 *    (a) WIDE unicode-range — covers Latin Basic, Latin-1, Latin
 *        Extended-A + diacritical marks + general punctuation +
 *        underscore/digits (the characters that actually appear
 *        inside ligature words: "sort", "calendar_today" etc.).
 *        → font-matching: PASS → font downloaded → ligature
 *        engine runs on Latin text → icons render as icons.
 *    (b) NARROW unicode-range — private-use plane U+E000-F8FF +
 *        FE0E/FE0F variation selectors → future-proof for any
 *        codepoint-style icons we add later.
 *
 *  Browser deduplicates the identical src URL — only ONE download.
 * ============================================================ */

/* Block (a): WIDE LATIN unicode-range — enables LIGATURE MATCH on a-z_0-9 */
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  size-adjust: 100%;
  ascent-override: 100%;
  descent-override: 25%;
  line-gap-override: 0%;
  unicode-range: U+0000-017F, U+0300-036F, U+2000-206F;
  src: local("Material Symbols Outlined"),
       local("MaterialSymbolsOutlined"),
       url("./fonts/MaterialSymbolsOutlined-Variable.woff2") format("woff2-variations"),
       url("./fonts/MaterialSymbolsOutlined-Variable.woff2") format("woff2");
}

/* Block (b): NARROW PRIVATE-USE unicode-range — codepoint icons */
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  size-adjust: 100%;
  ascent-override: 100%;
  descent-override: 25%;
  line-gap-override: 0%;
  unicode-range: U+E000-F8FF, U+FE0E-FE0F;
  src: local("Material Symbols Outlined"),
       local("MaterialSymbolsOutlined"),
       url("./fonts/MaterialSymbolsOutlined-Variable.woff2") format("woff2-variations"),
       url("./fonts/MaterialSymbolsOutlined-Variable.woff2") format("woff2");
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  /* ================================================================
   * MANDATORY: Material Symbols ship as STANDARD LIGATURES, NOT as
   * single-codepoint glyphs.  The inner text "sort", "chevron_right",
   * "person", "build" etc. MUST be passed through the ligature engine
   * of OpenType — if ligatures are disabled (page reset, parent CSS
   * font-variant-ligatures: none, browser default…), you see the RAW
   * TEXT "sort" instead of the hamburger icon.
   *
   * BOTH vendor-prefixed AND STANDARD names are required:
   *   - -webkit-font-feature-settings:  old Safari (≤16.1)
   *   -          font-feature-settings:  Chromium, modern Safari, Firefox
   *
   * font-variant-ligatures: normal; is the MODERN (CSS Fonts L4) way to
   * enable ligatures and is the preferred property — we set it too so
   * we are forward-proof against browsers removing low-level
   * font-feature-settings in the future.
   * ================================================================ */
  -webkit-font-feature-settings: "liga" 1, "calt" 1;
          font-feature-settings: "liga" 1, "calt" 1;
  font-variant-ligatures: normal;
  font-variant: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Default variable axes — authors override inline for FILL/weight. */
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
