/* resources/css/myanmar-unicode.css */
/*
 * Myanmar Unicode face, shared by the frontend and the admin.
 *
 * This replaces Zawgyi-One, which was pulled from mmwebfonts.comquas.com. Zawgyi
 * is not a Unicode encoding: it reuses codepoints the Unicode standard assigns to
 * Shan, Mon and Rumai Palaung (U+1060-U+109F) for its own Burmese glyph variants,
 * so Zawgyi text sorts, searches and reads wrong everywhere outside a Zawgyi font.
 * Myanmar switched to Unicode on 1 October 2019 and Zawgyi has had no maintainer
 * since. The stored content was converted with the Rabbit rule set; see
 * App\Console\Commands\ConvertZawgyiToUnicode.
 *
 * Self-hosted rather than served from a font CDN: the previous setup put a single
 * third-party host in the critical rendering path of every page.
 *
 * One file covers every weight - it is a variable font, hence `font-weight: 100
 * 900`. The URL is root-absolute because this file is concatenated into bundles
 * that sit at two different directory depths under public/, and Apache's document
 * root is public/ (see Procfile).
 */
@font-face {
    font-family: 'Noto Sans Myanmar';
    src: url('/fonts/myanmar/noto-sans-myanmar-variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    /* Keeps this face off Latin text, which stays on the theme's own fonts. */
    unicode-range: U+1000-109F, U+200C-200D, U+25CC, U+A92E, U+A9E0-A9FE, U+AA60-AA7F;
}

/*
 * Base stack. This is what actually puts Myanmar text on the face declared
 * above, instead of letting it fall through to whatever the reader's machine has
 * installed - which on a lot of Myanmar machines is still Zawgyi-One.
 *
 * The frontend overrides this from design/style.css, which names Proxima Nova
 * for Latin; what is left here is the admin, where the Myanmar content is
 * actually written.
 *
 * The tail of this stack is ArchitectUI's own body font, restated verbatim so the
 * theme's Latin rendering is unchanged. Because the @font-face above declares a
 * unicode-range, the leading entry only ever claims Myanmar codepoints.
 * Pyidaungsu, Myanmar Text and Padauk are locally-installed Unicode fallbacks for
 * the case where the woff2 fails to load.
 */
body {
    font-family: 'Noto Sans Myanmar', 'Pyidaungsu', 'Myanmar Text', 'Padauk',
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
        "Segoe UI Symbol", "Noto Color Emoji";
}

/*
 * Form controls do not inherit the document font by default, and these are
 * exactly the fields Myanmar content is typed into.
 */
input,
textarea,
select,
button,
.trumbowyg-editor {
    font-family: inherit;
}
