/**
 * === Fonts for Beringin Malay (ms-Brgn) ===
 * Everything: MNH48 Beringin PUA (fallback: Nunito Sans, sans-serif)
 * Note: Twemoji Mozilla must be one of fallback so that emoji would appear
 *
 * This file is written by Yaya MNH48 and licensed under MIT
 *
 */

/**
 * === Everything: MNH48 Beringin PUA ===
 *
 * Font is Copyright (c) 12 July 2020, Yaya MNH48 (https://meta.mnh48.moe),
 * with Reserved Font Name "MNH48 Beringin" and "MNH48".
 * This Font Software is licensed under the SIL Open Font License, Version 1.1.
 * 
 * The woff2 file loaded is compressed from the origin ttf file downloaded
 * from GitHub repository https://github.com/beringin-mnh48/mnh48-beringin/
 * as at commit 6ae6b97, using the woff2_compress code that were built from
 * source as at the commit fb9c337 from https://github.com/google/woff2/
 *
 * CSS code below loads normal regular (weight 400) font
 * This font does not exist in italic font style.
 *
 */

@font-face {
  font-family: 'MNH48 Beringin PUA';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+EBA0-EBFF;
  src: url('../fonts/MNH48BeringinPUA/web/MNH48BeringinPUA.woff2') format('woff2');
}

/**
 * === Applies font to the theme ===
 *
 * These codes apply the font to the theme components when the language matches
 *
 * Order of the CSS codes:
 * - Set default font for everything
 * - Override font for page headings (h1, h2, h3, h4, h5)
 * - Override font for website header (.websitetitle and .webpagetitle)
 * - Override font for codes (code, kbd, samp, pre)
 *
 */

*:lang(ms-Brgn) {
  font-family: 'MNH48 Beringin PUA', 'Nunito Sans', 'Twemoji Mozilla', sans-serif;
  font-size: 18px;
  writing-mode: vertical-rl;
}

h1:lang(ms-Brgn), h2:lang(ms-Brgn), h3:lang(ms-Brgn), h4:lang(ms-Brgn), h5:lang(ms-Brgn) {
  font-family: 'MNH48 Beringin PUA', 'Dancing Script', 'Twemoji Mozilla', cursive;
  direction: rtl;
  writing-mode: vertical-rl;
}

.websitetitle:lang(ms-Brgn), .webpagetitle:lang(ms-Brgn) {
  font-family: 'MNH48 Beringin PUA', 'Kavoon', 'Twemoji Mozilla', fantasy;
  font-weight: 400;
  direction: rtl;
  writing-mode: vertical-rl;
}

code:lang(ms-Brgn), kbd:lang(ms-Brgn), samp:lang(ms-Brgn), pre:lang(ms-Brgn),
code *:lang(ms-Brgn), kbd *:lang(ms-Brgn), samp *:lang(ms-Brgn), pre *:lang(ms-Brgn) {
  font-family: 'Fira Code', 'MNH48 Beringin PUA', 'Twemoji Mozilla', ui-monospace, monospace;
  font-size: 0.9em;
  writing-mode: vertical-rl;
}

.highlight:lang(ms-Brgn) .s {
  direction: rtl;
  unicode-bidi: isolate;
}
