/**
 * === Fonts for Japanese (ja) ===
 * Website header: Yuji Syuku (fallback: Kavoon, fantasy)
 * Page headings: Kaisei HarunoUmi (fallback: Dancing Script, cursive)
 * Main content: Kiwi Maru (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
 *
 */

/**
 * === Website header: Yuji Syuku ===
 *
 * Font is Copyright 2021 The Yuji Project Authors
 * (https://github.com/Kinutafontfactory/Yuji)
 * 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/Kinutafontfactory/Yuji
 * as at commit 6d1fd97, 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: 'Yuji Syuku';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/YujiSyuku/web/YujiSyuku-Regular.woff2') format('woff2');
}

/**
 * === Page headings: Kaisei HarunoUmi ===
 *
 * Font is Copyright 2020 The Kaisei Project Authors
 * (https://github.com/Font-Kai/Kaisei)
 * This Font Software is licensed under the SIL Open Font License, Version 1.1.
 * 
 * The woff2 files loaded are compressed from the origin ttf files downloaded
 * from GitHub repository https://github.com/FontKai-Kaisei/Kaisei
 * as at commit 09011ac, using the woff2_compress code that were built from
 * source as at the commit fb9c337 from https://github.com/google/woff2/
 *
 * CSS codes below for loading the fonts are arranged in this order:
 * - normal regular (weight 400)
 * - normal medium (weight 500)
 * - normal bold (weight 700)
 *
 * This font does not exist in italic font style.
 *
 */

@font-face {
  font-family: 'Kaisei HarunoUmi';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/KaiseiHarunoUmi/web/KaiseiHarunoUmi-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Kaisei HarunoUmi';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/KaiseiHarunoUmi/web/KaiseiHarunoUmi-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Kaisei HarunoUmi';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/KaiseiHarunoUmi/web/KaiseiHarunoUmi-Bold.woff2') format('woff2');
}

/**
 * === Main content: Kiwi Maru ===
 *
 * Font is Copyright 2020 The Kiwi Maru Project Authors
 * (https://github.com/Kiwi-KawagotoKajiru/Kiwi-Maru)
 * This Font Software is licensed under the SIL Open Font License, Version 1.1.
 * 
 * The woff2 files loaded are compressed from the origin ttf files downloaded
 * from GitHub repository https://github.com/Kiwi-KawagotoKajiru/Kiwi-Maru
 * as at commit e0c73c2, using the woff2_compress code that were built from
 * source as at the commit fb9c337 from https://github.com/google/woff2/
 *
 * CSS codes below for loading the fonts are arranged in this order:
 * - normal light (weight 300)
 * - normal regular (weight 400)
 * - normal medium (weight 500)
 *
 * This font does not exist in italic font style.
 *
 */

@font-face {
  font-family: 'Kiwi Maru';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/KiwiMaru/web/KiwiMaru-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'Kiwi Maru';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/KiwiMaru/web/KiwiMaru-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Kiwi Maru';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/KiwiMaru/web/KiwiMaru-Medium.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(ja) {
  font-family: 'Kiwi Maru', 'Nunito Sans', 'Twemoji Mozilla', sans-serif;
  -webkit-font-feature-settings: 'dlig' 1, 'liga' 1, 'fwid' 1; 
  -moz-font-feature-settings: 'dlig' 1, 'liga' 1, 'fwid' 1; 
  font-feature-settings: 'dlig' 1, 'liga' 1, 'fwid' 1;
  font-size: 18px;
  letter-spacing: -0.1em;
}

h1:lang(ja), h2:lang(ja), h3:lang(ja), h4:lang(ja), h5:lang(ja) {
  font-family: 'Kaisei HarunoUmi', 'Dancing Script', 'Twemoji Mozilla', cursive;
  -webkit-font-feature-settings: 'dlig' 0, 'liga' 0, 'fwid' 0; 
  -moz-font-feature-settings: 'dlig' 0, 'liga' 0, 'fwid' 0; 
  font-feature-settings: 'dlig' 0, 'liga' 0, 'fwid' 0;
  letter-spacing: initial;
  font-weight: 400;
}

.websitetitle:lang(ja), .webpagetitle:lang(ja) {
  font-family: 'Yuji Syuku', 'Kavoon', 'Twemoji Mozilla', fantasy;
  -webkit-font-feature-settings: 'dlig' 1, 'liga' 1, 'fwid' 0; 
  -moz-font-feature-settings: 'dlig' 1, 'liga' 1, 'fwid' 0; 
  font-feature-settings: 'dlig' 1, 'liga' 1, 'fwid' 0;
  letter-spacing: initial;
  font-weight: 400;
}

code:lang(ja), kbd:lang(ja), samp:lang(ja), pre:lang(ja),
code *:lang(ja), kbd *:lang(ja), samp *:lang(ja), pre *:lang(ja) {
  font-family: 'Fira Code', 'Kiwi Maru', 'Twemoji Mozilla', ui-monospace, monospace;
  -webkit-font-feature-settings: 'fwid' 0; 
  -moz-font-feature-settings: 'fwid' 0; 
  font-feature-settings: 'fwid' 0;
  font-size: 0.9em;
  letter-spacing: initial;
}
