/* 由 tools/build-font-css.mjs 產生,請不要手改(紀錄 0199)。
   字型自行託管(同源,符合 CSP font-src 'self'),SIL Open Font License 1.1,已子集化;只用 400 與 700 兩種字重。
   font-display: swap:字型下載前先用系統字型顯示文字。unicode-range:頁面用到該文字區塊(繁中、日文是該分片的字)才下載。 */
@font-face {
  font-family: "Roboto SG";
  src: url("/assets/fonts/roboto-latin-sg.woff2?v=90952434") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto SG";
  src: url("/assets/fonts/roboto-latin-ext-sg.woff2?v=db88002f") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-0301, U+0303, U+0309, U+0323, U+1D00-1DBF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans Devanagari SG";
  src: url("/assets/fonts/noto-sans-devanagari-sg.woff2?v=3f7a7574") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0900-097F, U+A8E0-A8FF, U+200C-200D, U+25CC, U+20B9;
}

html:is([lang="hi"]) { --font: "Roboto SG", "Noto Sans Devanagari SG", "Nirmala UI", "Kohinoor Devanagari", "Devanagari Sangam MN", "Noto Sans Devanagari", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
html:is([lang="hi"]) body { font-family: var(--font); }
html:is([lang="hi"]) body { line-height: 1.8; }

/* 標題行高:天城文上下符號、阿拉伯文字上下點與日文都需要比拉丁字更高的行高,1.1 會被切到 */
html[lang="hi"] :is(h1, h2, h3, h4, .h1, .h2, .h3) { line-height: 1.4; }
html[lang="ja"] :is(h1, h2, h3, h4, .h1, .h2, .h3) { line-height: 1.35; }
html[lang="ur"] :is(h1, h2, h3, h4, .h1, .h2, .h3) { line-height: 1.65; }

/* 字距:這三種文字不加字距(烏爾都文是連筆字,字距會把字母拆開;天城文與日文加字距也不自然) */
html:is([lang="hi"], [lang="ja"], [lang="ur"]) *,
html:is([lang="hi"], [lang="ja"], [lang="ur"]) *::before,
html:is([lang="hi"], [lang="ja"], [lang="ur"]) *::after { letter-spacing: normal; }

/* 長字、長按鈕不撐出畫面(同 de、pl、fr、vi 的處理) */
html:is([lang="hi"], [lang="ja"], [lang="ur"]) .page-hero--media > * { min-width: 0; }
html:is([lang="hi"], [lang="ja"], [lang="ur"]) :is(h1, h2, h3, .h1, .h2, .h3, dt) { overflow-wrap: break-word; }
@media (max-width: 47.99rem) {
  html:is([lang="hi"], [lang="ja"], [lang="ur"]) .btn { white-space: normal; text-align: center; }
}

/* 日文斷行:禁則處理(標點不放行首、「」不放行尾)、標題依詞組斷行(支援的瀏覽器),其餘瀏覽器退回一般斷行 */
html[lang="ja"] body { line-break: strict; overflow-wrap: break-word; }
html[lang="ja"] :is(h1, h2, h3, .h1, .h2, .h3) { word-break: auto-phrase; overflow-wrap: anywhere; text-wrap: balance; }

/* 烏爾都文(右到左):夾在文字中的 Email、電話連結維持由左到右顯示,不會被反轉 */
html[lang="ur"] :is(a[href^="mailto:"], a[href^="tel:"], .ltr, bdi, code) { unicode-bidi: isolate; direction: ltr; }
html[lang="ur"] input[type="email"], html[lang="ur"] input[type="tel"], html[lang="ur"] input[type="url"] { direction: ltr; text-align: right; }

/* 規格表:這三種文字沒有空白可以斷行(日文)或字較寬,欄寬下限放寬到 12rem */
html:is([lang="hi"], [lang="ja"], [lang="ur"]) .spec-table td { min-width: 12rem; }
