/* MARBLE STORY V3.8.37 — centralized TH/EN typography
   Thai pages and Admin: Noto Sans Thai; English pages: Kanit.
   Load this stylesheet LAST in <head> to override legacy page typography.
   Do not apply font-family to icon elements or pseudo-elements. */
:root { --ms-font-th: 'Noto Sans Thai', 'Tahoma', sans-serif; --ms-font-en: 'Kanit', sans-serif; }
html[lang="th"] { --ms-active-font: var(--ms-font-th); }
html[lang="en"] { --ms-active-font: var(--ms-font-en); }
html[lang="th"] body, html[lang="en"] body {
  font-family: var(--ms-active-font) !important;
}
/* Common text elements and form controls, including Bootstrap components.
   More specific rules for the language take precedence over older declarations. */
html[lang="th"] :is(h1,h2,h3,h4,h5,h6,p,a,span,small,strong,em,b,label,button,input,textarea,select,option,table,thead,tbody,th,td,li,dt,dd,blockquote,figcaption,legend,summary),
html[lang="en"] :is(h1,h2,h3,h4,h5,h6,p,a,span,small,strong,em,b,label,button,input,textarea,select,option,table,thead,tbody,th,td,li,dt,dd,blockquote,figcaption,legend,summary) {
  font-family: var(--ms-active-font) !important;
}
/* Existing layout typography classes (including hero titles and admin headings). */
html[lang="th"] :is(.display-1,.display-2,.display-3,.display-4,.display-5,.display-6,.lead,.btn,.form-control,.form-select,.nav-link,.dropdown-item,.card-title,.modal-title,.accordion-button,.page-title,.section-title),
html[lang="en"] :is(.display-1,.display-2,.display-3,.display-4,.display-5,.display-6,.lead,.btn,.form-control,.form-select,.nav-link,.dropdown-item,.card-title,.modal-title,.accordion-button,.page-title,.section-title) {
  font-family: var(--ms-active-font) !important;
}
/* Keep Bootstrap and third-party icon glyphs working. */
html .bi { font-family: bootstrap-icons !important; }
html :is(.fa,.fas,.far,.fab,[class^="fa-"],[class*=" fa-"]) { font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important; }
html .material-icons { font-family: 'Material Icons' !important; }
html .material-symbols-outlined { font-family: 'Material Symbols Outlined' !important; }
/* Explicit [lang] nested content can select the appropriate script font. */
html[lang="th"] [lang="en"]:not(.bi), html[lang="en"] [lang="th"]:not(.bi) { font-family: var(--ms-font-en) !important; }
html[lang="en"] [lang="th"]:not(.bi) { font-family: var(--ms-font-th) !important; }
