/* ════════════════════════════════════════════════════════════════════
   Self-hosted webfonts — Fontsource (fontsource.org)
   Replaces the Google Fonts <link> that used to sit in includes/header.php.

   WHY SELF-HOST
   The old setup cost two extra DNS lookups + two TLS handshakes
   (fonts.googleapis.com, then fonts.gstatic.com) before a single glyph
   could render — on 4G in Ahilyanagar that is most of the delay before
   text appears. Serving from our own origin removes both round-trips,
   lets the fonts share the site's HTTP/2 connection, and means the
   Content-Security-Policy no longer has to allow two Google domains.

   WEIGHTS
   Poppins ships 400/500/600/700 only. The old Google URL requested
   300 and 800 as well; nothing in the CSS uses them, and each unused
   weight was ~8 KB on every first visit.

   Fraunces and Noto Sans Devanagari are variable fonts — one file each
   covers the whole weight range, which is why they are worth their size.
   ════════════════════════════════════════════════════════════════════ */

/* ── Fraunces — display / headings (variable, wght 100–900) ───────── */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/fraunces-latin-wght-normal.woff2') format('woff2-variations');
  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+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/fraunces-latin-wght-italic.woff2') format('woff2-variations');
  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+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Poppins — body / UI ──────────────────────────────────────────── */
@font-face { font-family:'Poppins'; font-style:normal; font-weight:400; font-display:swap;
  src:url('/assets/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Poppins'; font-style:normal; font-weight:500; font-display:swap;
  src:url('/assets/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'Poppins'; font-style:normal; font-weight:600; font-display:swap;
  src:url('/assets/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Poppins'; font-style:normal; font-weight:700; font-display:swap;
  src:url('/assets/fonts/poppins-latin-700-normal.woff2') format('woff2'); }

/* ── Noto Sans Devanagari — Marathi (variable, wght 100–900) ──────── */
@font-face {
  font-family: 'Noto Sans Devanagari';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/noto-sans-devanagari-wght-normal.woff2') format('woff2-variations');
  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;
}


/* ════════════════════════════════════════════════════════════════════
   MARATHI TYPOGRAPHY FIX

   Every Marathi line on the site was being set in Fraunces *italic*.
   Fraunces has no Devanagari glyphs, so the browser fell back to
   whatever it had (this is where the stray Times New Roman in the
   computed font list came from) and then synthesised an oblique,
   because Devanagari has no true italic form. The result was skewed,
   wrong-weight Devanagari on every page.

   Devanagari must never be italicised. These rules force the correct
   face and upright style wherever Marathi is marked up.

   Markup required:  <span lang="mr" class="mr">तुमच्या बजेटनुसार घर शोधा.</span>
   ════════════════════════════════════════════════════════════════════ */
:lang(mr),
[lang="mr"],
.mr,
/* The per-page Marathi classes. Each of these sets font-style:italic in
   its own page's CSS, which is the whole bug: Fraunces has no Devanagari,
   so the browser falls back and then fakes an oblique. Listing them here
   means the fix lands even where the markup has no lang attribute yet. */
.hw-mr, .ld-mr, .hood-mr, .af-mr, .cc-mr, .gt-takeaway span:lang(mr) {
  font-family: 'Noto Sans Devanagari', 'Noto Sans', system-ui, sans-serif;
  font-style: normal !important;   /* never synthesise an oblique */
  font-synthesis-style: none;      /* belt and braces on modern engines */
}

/* The orange used for Marathi accent lines was #FF8C42 on white = 2.31:1,
   which fails WCAG AA badly. This is the same hue darkened to 5.01:1.
   Use it for any accent TEXT; the bright orange is fine for large fills. */
:lang(mr).ng-accent,
[lang="mr"].ng-accent,
.mr.ng-accent {
  color: #B3540F;
}
