/* fonts-montserrat.css — Pro-level Montserrat self-host CSS module
 *
 * ITER 683 (2026-05-23): Reusable BS-paralel Montserrat font system.
 * Source: BS canlı audit — BS .m-header font-family: "Montserrat, Arial, Helvetica, sans-serif"
 *
 * Features:
 *  1. SELF-HOST   — Variable font (font-weight 400..700 single file per subset)
 *  2. SUBSET      — Latin + Latin-Ext (Turkish ç,ğ,ı,İ,ö,ş,ü full support)
 *  3. PRELOAD     — Critical font file preloaded (separate <link rel="preload"> in HTML)
 *  4. CLS FIX     — Arial fallback metric-matched (size-adjust + ascent-override)
 *  5. QUALITY     — kerning + ligatures + optimizeLegibility
 *  6. ROBUSTNESS  — font-display: swap + local() fallback
 *
 * Usage (opt-in any page):
 *   <link rel="stylesheet" href="/assets/css/fonts-montserrat.css">
 *   <link rel="preload" href="/assets/fonts/montserrat-latin.woff2" as="font" type="font/woff2" crossorigin>
 *   <link rel="preload" href="/assets/fonts/montserrat-latin-ext.woff2" as="font" type="font/woff2" crossorigin>
 *
 * Then in your CSS:
 *   body { font-family: var(--font-bs-ui); }
 *   .my-class { font-family: var(--font-bs-ui); font-weight: 600; }
 *
 * Total transfer: ~108KB woff2 (latin 38KB + latin-ext 70KB) for ALL weights 400-700.
 * Compare: Google Fonts CDN 3 weights = ~150KB + 3 HTTP requests + 3rd-party.
 */

/* ─────── 1. SELF-HOST VARIABLE FONT (Latin) ─────── */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;                       /* Variable axis: any weight in this range */
  font-display: swap;                         /* No FOIT — fallback shows immediately */
  src: local("Montserrat"),                   /* Use system Montserrat if installed */
       url("/assets/fonts/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;
}

/* ─────── 2. SELF-HOST VARIABLE FONT (Latin Extended — Turkish) ─────── */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local("Montserrat"),
       url("/assets/fonts/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;
}

/* ─────── 3. CLS-FIX FALLBACK (Arial metric-matched to Montserrat) ─────── */
/* Arial'in cap-height/x-height/ascender metric'lerini Montserrat'a uyarlar.
 * Layout shift (CLS) önler — font yüklenmeden öncesi + sonrası aynı satır
 * height ve box width. size-adjust + ascent-override + descent-override
 * + line-gap-override 4'lü combo en hassas metric match. */
@font-face {
  font-family: "Montserrat-Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 88%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* ─────── 4. CSS VARIABLE (global brand font stack) ─────── */
:root {
  --font-bs-ui: "Montserrat", "Montserrat-Fallback", Arial, Helvetica, sans-serif;
  /* BS canlı extract'le aynı zincir + Montserrat-Fallback metric-matched */
}

/* ─────── 5. QUALITY DEFAULTS (opt-in via class) ─────── */
/* Sayfada her yerde aktif olması istenen tipografi quality'leri.
 * .bs-typo class ile element'lere uygulanır, ya da body'ye verilir. */
.bs-typo,
.bs-typo * {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────── 6. UTILITY CLASSES (hızlı font-weight aktarma) ─────── */
.font-bs        { font-family: var(--font-bs-ui); }
.font-bs-light  { font-family: var(--font-bs-ui); font-weight: 400; }
.font-bs-medium { font-family: var(--font-bs-ui); font-weight: 500; }
.font-bs-semi   { font-family: var(--font-bs-ui); font-weight: 600; }
.font-bs-bold   { font-family: var(--font-bs-ui); font-weight: 700; }
