/* ==========================================================================
   Thmanyah Typeface Family — Local Typography System
   Includes:
     1. Thmanyah Sans (الرقمي / Digital UI)
     2. Thmanyah Serif Display (العناوين / Display Headings & Branding)
     3. Thmanyah Serif Text (النصوص / Editorial & Body)
     4. Local offline fallbacks for 'Readex Pro' and 'Tajawal'
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Thmanyah Sans (الرقمي)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Thmanyah';
  src: url("fonts/thmanyah/thmanyahsans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah';
  src: url("fonts/thmanyah/thmanyahsans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah';
  src: url("fonts/thmanyah/thmanyahsans-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah';
  src: url("fonts/thmanyah/thmanyahsans-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah';
  src: url("fonts/thmanyah/thmanyahsans-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Alias 'Thmanyah Sans' */
@font-face {
  font-family: 'Thmanyah Sans';
  src: url("fonts/thmanyah/thmanyahsans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url("fonts/thmanyah/thmanyahsans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url("fonts/thmanyah/thmanyahsans-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url("fonts/thmanyah/thmanyahsans-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Sans';
  src: url("fonts/thmanyah/thmanyahsans-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Thmanyah Serif Display (العناوين)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Alias 'Thmanyah Display' */
@font-face {
  font-family: 'Thmanyah Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Display';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   3. Thmanyah Serif Text (النصوص)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url("fonts/thmanyah/thmanyahseriftext-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url("fonts/thmanyah/thmanyahseriftext-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url("fonts/thmanyah/thmanyahseriftext-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url("fonts/thmanyah/thmanyahseriftext-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url("fonts/thmanyah/thmanyahseriftext-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   4. Local Offline Aliases for 'Readex Pro' and 'Tajawal'
   Ensures sandbox environment renders Thmanyah without network or external fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Readex Pro';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Readex Pro';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Readex Pro';
  src: url("fonts/thmanyah/thmanyahserifdisplay-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url("fonts/thmanyah/thmanyahsans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url("fonts/thmanyah/thmanyahsans-Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url("fonts/thmanyah/thmanyahsans-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tajawal';
  src: url("fonts/thmanyah/thmanyahsans-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   5. Design Tokens & Universal Rules
   -------------------------------------------------------------------------- */
:root {
  --font-family: 'Thmanyah', 'Thmanyah Sans', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-sans: 'Thmanyah', 'Thmanyah Sans', 'Tajawal', Arial, sans-serif;
  --font-display: 'Thmanyah Serif Display', 'Thmanyah Display', 'Thmanyah', 'Readex Pro', sans-serif;
  --font-text: 'Thmanyah Serif Text', 'Thmanyah', serif;
  --bs-body-font-family: var(--font-family);
  --bs-font-sans-serif: var(--font-family);
}

/* Global Application */
html, body {
  font-family: var(--font-family) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings & Prominent Titles */
h1, h2, h3,
.brand,
.site-header .brand,
.landing-hero h1,
.tenant-lockup strong,
.panel-heading h2,
.role-heading h1,
.official-form-header h1,
.official-form-header h2,
.official-form-title h2,
.document-title h2,
.reports-heading h1 {
  font-family: var(--font-display) !important;
  letter-spacing: -0.02em;
}

/* Form Controls & Standard UI */
button, input, optgroup, select, textarea {
  font-family: var(--font-family) !important;
}

/* Protect Icon Fonts from Typography Overrides */
.fa-solid, .fas {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
}
.fa-regular, .far {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 400 !important;
  font-style: normal !important;
}
.fa-brands, .fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
  font-style: normal !important;
}
i[class*="fa-"]:not(.fa-brands):not(.fab):not(.fa-regular):not(.far) {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
}
.bi, [class*="bi-"] {
  font-family: "bootstrap-icons" !important;
  font-style: normal !important;
}
[class*="material-icons"] {
  font-family: "Material Icons" !important;
  font-style: normal !important;
}
[class*="material-symbols"] {
  font-family: "Material Symbols Outlined" !important;
  font-style: normal !important;
}

i:not([class*="fa"]):not([class*="bi"]):not([class*="material"]):not([class*="icon"]):not([class*="glyphicon"]) {
  font-family: var(--font-family) !important;
}

/* Print Specific Rules */
@media print {
  html, body, .print-sheet, .document-table, .official-agency, .official-form-title, .signature-block {
    font-family: var(--font-family) !important;
  }
  h1, h2, h3, .official-form-title h2, .document-title h2 {
    font-family: var(--font-display) !important;
  }
}

