/**
 * TYI MIS - Global Sarabun Typography Stylesheet
 * Self-hosted local Sarabun font integration for all views and components.
 */

@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../../../fonts/sarabun/Sarabun-Light.ttf') format('truetype');
}

@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../../fonts/sarabun/Sarabun-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Sarabun';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../../../fonts/sarabun/Sarabun-Italic.ttf') format('truetype');
}

@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../../../fonts/sarabun/Sarabun-Medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../../../fonts/sarabun/Sarabun-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../../../fonts/sarabun/Sarabun-Bold.ttf') format('truetype');
}

/* Universal Typography Override */
html, body,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
p, span, a, li, dt, dd, th, td,
input, button, select, textarea,
.form-control, .btn, .label, .badge,
.main-header, .navbar, .main-sidebar, .sidebar, .sidebar-menu,
.box, .box-title, .box-header, .box-body, .box-footer,
.card, .card-title, .card-header, .card-body, .card-footer,
.modal, .modal-title, .modal-body, .modal-footer,
.dropdown-menu, .alert, .callout,
.dataTables_wrapper, table.dataTable,
.select2, .select2-container, .select2-selection, .select2-results,
.datepicker, .datepicker table,
.content-header, .breadcrumb {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Protect Icon Fonts from being overridden by Sarabun */
.main-header .sidebar-toggle,
.main-header .sidebar-toggle:before,
.sidebar-toggle,
.sidebar-toggle:before,
.treeview-menu > li > a > .fa-angle-left,
.treeview-menu > li > a > .fa-angle-down {
  font-family: fontAwesome, 'FontAwesome' !important;
}

/* Font Awesome 5 (Free/Solid/Regular) + Font Awesome 4 Fallback */
.fa, .fas, .far, .fal,
.fa:before, .fas:before, .far:before, .fal:before,
[class^="fa-"], [class*=" fa-"],
[class^="fa-"]:before, [class*=" fa-"]:before,
i[class*="fa"], i[class*="icon"] {
  font-family: "Font Awesome 5 Free", fontAwesome, 'FontAwesome' !important;
}

/* Font Awesome 5 Brands (Facebook, Google, etc.) */
.fab, .fab:before {
  font-family: "Font Awesome 5 Brands", fontAwesome, 'FontAwesome' !important;
}

.glyphicon,
[class^="glyphicon-"], [class*=" glyphicon-"] {
  font-family: 'Glyphicons Halflings' !important;
}

.ion,
[class^="ion-"], [class*=" ion-"] {
  font-family: 'Ionicons' !important;
}

body {
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600 !important;
}

b, strong {
  font-weight: 600 !important;
}

.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th {
  font-weight: 600;
}

.btn {
  font-weight: 500;
}

/* Select2 Thai Font Tuning */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  font-family: 'Sarabun', sans-serif !important;
  line-height: 28px;
}

.select2-results__option {
  font-family: 'Sarabun', sans-serif !important;
}
