/* =====================================================================
 * Bundled render fonts (P5 §3.1, task #54) — the SAME-ORIGIN font source for both the
 * headless-Chromium render worker and the web Studio preview. Loaded from files next to this
 * stylesheet; never from Google Fonts at render time.
 *
 * WHY THIS EXISTS. Before this file, neither drawn font was actually present. `fonts.ts`'s
 * `ensureGoogleFont()` deliberately no-ops for Montserrat ("bundled, per v1's ensureFont skip")
 * — but nothing bundled it, and the host page only had `<link rel="preconnect">`, which opens a
 * connection and fetches nothing. Measured in the render worker's own Chromium:
 *
 *     width("Handgloves Wq" @ 800 60px Montserrat)          = 408px
 *     width("Handgloves Wq" @ 800 60px 'zzz-nonexistent')   = 408px   ← identical
 *     width("स्वादिष्ट चाय" @ 'Noto Sans Devanagari')          = 266px
 *     width("स्वादिष्ट चाय" @ 'No Such XYZ')                  = 266px   ← identical
 *
 * Both families were resolving to Chromium's default face. Every published image was drawn in a
 * font the templates never specified, and auto-fit measured that fallback, so the fit was
 * "correct" for the wrong typeface. (`document.fonts.check()` returns TRUE in this state — it
 * reports whether text CAN be painted, fallback included — which is why nothing caught it.)
 *
 * VARIABLE fonts, weight 400..900 in one file per subset: the renderer draws at 500 (body),
 * 800 (bold) and 900 (logo chip). A static Regular+Bold pair would leave the browser to
 * synthesise 500/900, which is exactly the drift this file exists to remove.
 *
 * `unicode-range` keeps the cost honest — Chromium downloads the 118KB Devanagari face ONLY
 * when a post actually contains Devanagari codepoints. A Latin-only brand never fetches it.
 *
 * Provenance + licences: see FONTS.md in this directory. Both families are SIL OFL 1.1.
 * ===================================================================== */

/* ---- Montserrat (DEFAULT_LATIN_FONT) ---- */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 900;
  font-display: block; /* block, not swap: a screenshot taken mid-swap would bake the fallback */
  src: url('montserrat-latin.woff2') format('woff2');
  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;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 900;
  font-display: block;
  src: url('montserrat-latin-ext.woff2') format('woff2');
  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;
}

/* ---- Twinkle Star — a TEMPLATE-OWNED DISPLAY FACE, and deliberately NOT a brand font --------
 *
 * Found by Sajel, 2026-07-30, for the festive greeting line ("Happy Diwali") the occasion
 * families are built around. It is bundled here for exactly the reason the two above are: R7 says
 * a family is bundled or it is not supported, and a <link> to fonts.googleapis.com at render time
 * puts a third party in the path of every published image and silently yields Chromium's default
 * face when it is slow or blocked.
 *
 * ⛔ IT IS NOT IN `SUPPORTED_FONT_STACKS`, AND MUST NOT BE ADDED TO IT.
 * That list is the set of fonts a BRAND may be drawn in — the customer's own typography. This one
 * belongs to a handful of festive templates and is named only inside their CSS block. Adding it to
 * the list would make a decorative script offerable as a business's identity typeface, and would
 * also break `fonts-bundled.test.ts`, which pins that list to exactly two on purpose.
 *
 * ⚠️ IT IS NOT A VARIABLE FACE. Google ships Twinkle Star at ONE weight (400). The two families
 * above span 400..900 so the renderer never asks the browser to synthesise a weight; this one
 * would be synthesised the moment a rule sets font-weight above 400, producing a smeared fake
 * bold. The festive families therefore set `font-weight: 400` explicitly wherever they use it.
 *
 * ⚠️ LATIN ONLY — there is no Devanagari cut, and `unicode-range` is what makes that safe rather
 * than broken: a Devanagari greeting falls through to Noto Sans Devanagari per-character instead
 * of rendering as tofu. The festive designs are composed so that fallback still looks deliberate.
 */
@font-face {
  font-family: 'Twinkle Star';
  font-style: normal;
  font-weight: 400;
  font-display: block; /* block, not Google's `swap`: a screenshot taken mid-swap bakes the fallback */
  src: url('twinklestar-latin.woff2') format('woff2');
  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;
}

@font-face {
  font-family: 'Twinkle Star';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('twinklestar-latin-ext.woff2') format('woff2');
  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;
}

/* ---- Noto Sans Devanagari (DEVANAGARI_FONT) ---- */
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 400 900;
  font-display: block;
  src: url('noto-devanagari-devanagari.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}

/* The Latin slice of the Devanagari family — §3.1's "subset to Devanagari + Latin digits".
   Hindi copy routinely carries Latin digits and a Latin brand name; without this they would
   fall out of the family mid-line. */
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-weight: 400 900;
  font-display: block;
  src: url('noto-devanagari-latin.woff2') format('woff2');
  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;
}
