/**
 * CALIFB 字型載入
 * 僅應用於英文字母和數字（A-Z, a-z, 0-9）
 * unicode-range 確保中文字不受影響
 */

@font-face {
  font-family: 'CALIFB';
  src: url('/static/fonts/califb.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  /* 僅應用於英文字母、數字和基本標點符號 */
  /* U+0020-007F: 基本拉丁字母和數字 */
  /* U+00A0-00FF: 拉丁字母補充 */
  unicode-range: U+0020-007F, U+00A0-00FF;
}

/* 全局應用：將 CALIFB 放在字型列表最前面，優先於其他字型 */
/* 由於 unicode-range 的限制，中文字會自動使用後面的備用字型 */
body,
html {
  font-family: 'CALIFB', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
}

/* 確保所有文字元素都應用，但排除 icon 元素 */
h1, h2, h3, h4, h5, h6,
p, span, div, a, li, td, th,
input, textarea, select, button,
label, caption, strong, em, b,
article, section, header, footer, nav,
aside, main, blockquote, pre, code {
  font-family: 'CALIFB', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* 排除所有 icon 元素，讓它們使用原本的字型（Font Awesome 等） */
/* Font Awesome icons - 優先匹配 i 標籤 */
i[class*="fa-"],
i.fab, i.fas, i.far, i.fal, i.fad, i.fak,
/* 其他包含 fa- 類別的元素 */
[class*="fa-"]:not([class*="font"]):not([class*="social-text"]),
.fab, .fas, .far, .fal, .fad, .fak {
  font-family: "Font Awesome 5 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Caseicon icons */
i[class*="caseicon"],
[class*="caseicon"] {
  font-family: "caseicon", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

