/*
 * Bangla typography.
 *
 * The app's Latin stack (Source Sans Pro on POS, Inter on themed pages) carries
 * no Bengali glyphs, so every Bangla string fell through to whatever the OS
 * picked — which on Windows is usually Vrinda, and it looks awful.
 *
 * Rather than restate the Latin stack in a dozen places, this declares one
 * family, `BanglaUI`, restricted by `unicode-range` to the Bengali block. Only
 * Bangla codepoints resolve through it; Latin, digits and punctuation fall
 * straight past to whatever font the page already used. That means `BanglaUI`
 * can be prepended anywhere without changing the Latin look at all.
 *
 * Loaded last in layouts/partials/css.blade.php so it wins over theme.css, and
 * unconditionally so the POS screen (which skips theme.css) is covered too.
 */

/* SolaimanLipi, as asked.
 *
 * `local()` comes first so a machine that already has the font (most shop PCs
 * do — it ships with Avro) uses it with no download at all. The bundled woff is
 * the same face, subsetted to the range below, for machines that do not.
 * The trailing local() names are a safety net if the woff ever goes missing:
 * Kalpurush ships with Avro, Nirmala UI and Shonar Bangla with Windows,
 * Bangla MN / Kohinoor Bangla with macOS.
 *
 * Only weight 400 is declared because SolaimanLipi has no bold face; leaving
 * 700 undeclared lets the browser synthesise bold, which is visible. Declaring
 * a 700 face that resolves back to the regular file just makes bold text look
 * exactly like body text.
 */
@font-face {
    font-family: 'BanglaUI';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('SolaimanLipi'),
         url('../fonts/solaimanlipi/solaimanlipi.woff') format('woff'),
         local('Kalpurush'),
         local('Noto Sans Bengali'),
         local('Hind Siliguri'),
         local('Nirmala UI'),
         local('Shonar Bangla'),
         local('Bangla MN'),
         local('Kohinoor Bangla');
    /* Bengali block + the danda (৷ ।, which lives in the Devanagari block),
       the joiners that drive যুক্তাক্ষর, and the dotted circle. */
    unicode-range: U+0980-09FF, U+0964-0965, U+200C-200D, U+25CC;
}

/* Themed pages read the stack from this token, so putting BanglaUI in front of
   it covers everything theme.css styles in one shot. */
:root {
    --font-ui: 'BanglaUI', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Hind Siliguri', 'Noto Sans Bengali', 'SolaimanLipi', sans-serif;
}

/* --font-ui already leads with BanglaUI, so these just reuse it. The var()
   fallback is what the POS screen gets: theme.css never loads there, so the
   token is undefined and the vendor stack (Source Sans Pro) survives intact
   with BanglaUI merely prepended. */
body {
    font-family: var(--font-ui, 'BanglaUI', 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif);
}

/* Bootstrap gives headings their own family, so they do not inherit from body. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-ui, 'BanglaUI', 'Source Sans Pro', sans-serif);
}

/* Tailwind's preflight sets a family on html and on .tw-font-sans; the POS
   screen and the newer partials lean on both. */
html,
.tw-font-sans {
    font-family: var(--font-ui, 'BanglaUI', Inter, ui-sans-serif, system-ui, sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji');
}

/* Bangla sits lower and taller than Latin at the same px size — matras and
   conjuncts clip against a tight line box. Give the help panel, which is all
   Bangla regardless of the chosen locale, a little more room. */
.page-help__block p,
.page-help__steps > li,
.page-help__links > li,
.page-help__tips > li {
    line-height: 1.9;
}
