/* =============================================================================
   Devanagari headings — synthetic bold
   -----------------------------------------------------------------------------
   Loaded last, after hindi-fix.css.

   The heading face, Tiro Devanagari Hindi, exists in one weight only: 400.
   Headings here are 700. When a browser is asked for a weight a font does not
   have, it fakes one — for most engines by drawing the glyph several times at
   small horizontal offsets, or by applying a synthetic stroke.

   On Latin that produces a slightly clumsy bold and nothing worse. On
   Devanagari it is destructive: the combining vowel signs are positioned by
   the font's mark-attachment tables relative to an exact glyph origin, and
   the synthetic offset moves the base without moving the mark. The matra ends
   up beside the wrong consonant, or floating before the syllable — which is
   precisely what "निःशुल्क" rendering as "ांनःशुल्क" is.

   Body text was never affected because Mukta ships real 300/400/600/700 cuts,
   so nothing had to be synthesised.

   Two defences, because either alone would do but both together cannot fail:
   a face with real bold weights, and synthesis switched off so a future
   missing weight degrades to lighter text rather than to broken text.
   ========================================================================== */

:root {
    /* Serif, to sit beside Tiro without changing the design language, but with
       genuine 400/600/700 cuts. */
    --font-devanagari-display:
        "Noto Serif Devanagari",
        "Tiro Devanagari Hindi",
        "Noto Sans Devanagari",
        "Nirmala UI",
        "Kohinoor Devanagari",
        serif;
}

[lang="hi"] h1, :lang(hi) h1,
[lang="hi"] h2, :lang(hi) h2,
[lang="hi"] h3, :lang(hi) h3,
[lang="hi"] h4, :lang(hi) h4,
[lang="hi"] .display,     :lang(hi) .display,
[lang="hi"] .grad-text,   :lang(hi) .grad-text,
[lang="hi"] .brand__text, :lang(hi) .brand__text,
[lang="hi"] figcaption,   :lang(hi) figcaption,
[lang="hi"] legend,       :lang(hi) legend {
    font-family: var(--font-devanagari-display) !important;

    /* The whole point. Never let a weight or slant be faked on this script. */
    font-synthesis: none !important;
    -webkit-font-synthesis: none !important;
    font-synthesis-weight: none;
    font-synthesis-style: none;
}

/* Nothing above 700 — Noto Serif Devanagari stops there, and asking for 800
   would put us straight back to synthesis. */
[lang="hi"] h1, :lang(hi) h1,
[lang="hi"] .display, :lang(hi) .display,
[lang="hi"] .grad-text, :lang(hi) .grad-text {
    font-weight: 700;
}

[lang="hi"] h2, :lang(hi) h2,
[lang="hi"] h3, :lang(hi) h3 { font-weight: 600; }

/* Interface text — labels, buttons, badges, nav — takes the sans face, which
   also has real weights. A UI label in a serif display face reads as content
   rather than as a control. */
[lang="hi"] .label,   :lang(hi) .label,
[lang="hi"] .btn,     :lang(hi) .btn,
[lang="hi"] .badge,   :lang(hi) .badge,
[lang="hi"] .eyebrow, :lang(hi) .eyebrow,
[lang="hi"] .nav__link, :lang(hi) .nav__link,
[lang="hi"] th,       :lang(hi) th {
    font-family: "Noto Sans Devanagari", "Mukta", "Nirmala UI", sans-serif !important;
    font-synthesis: none !important;
    -webkit-font-synthesis: none !important;
}

/* Synthesis off everywhere in Hindi, including text we have not thought of. */
[lang="hi"], :lang(hi),
[lang="hi"] *, :lang(hi) * {
    font-synthesis: none;
    -webkit-font-synthesis: none;
}

/* A Devanagari line needs vertical room for the shirorekha above and the
   hanging matras below. Gradient text clips to the glyph outline, so a tight
   line-height shears the top and bottom off. */
[lang="hi"] .grad-text, :lang(hi) .grad-text {
    line-height: 1.5;
    padding-block: 0.08em;
    display: inline-block;
}

[lang="hi"] h1, :lang(hi) h1 { line-height: 1.42; }
[lang="hi"] h2, :lang(hi) h2 { line-height: 1.4; }
[lang="hi"] h3, :lang(hi) h3 { line-height: 1.4; }

/* Hinglish is Latin throughout, so it keeps the display face and is untouched
   by any of this. Said explicitly so its absence does not look accidental. */
