/**
 * ==============================================================================
 * ZIMAM TYPOGRAPHY SYSTEM
 * Official Arabic: Alyamama (اليمامة)
 * Latin & Numerals: Zimam Latin (Subbed IBM Plex Sans)
 * Crafted for optimal visual ergonomics, readability, and legibility across Zimam
 * ==============================================================================
 */

/* -------------------------------------------------------------------------- */
/* 1. Zimam Latin (Latin Characters, Numerals, Symbols & ASCII)               */
/* -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Zimam Latin';
    src: url('../fonts/zimam/zimam-latin/ZimamLatin-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-007F, U+00A0-00FF, U+0100-017F, U+0180-024F, U+02B0-02FF, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2150-218F, U+2200-22FF, U+FB00-FB4F;
}

@font-face {
    font-family: 'Zimam Latin';
    src: url('../fonts/zimam/zimam-latin/ZimamLatin-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-007F, U+00A0-00FF, U+0100-017F, U+0180-024F, U+02B0-02FF, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2150-218F, U+2200-22FF, U+FB00-FB4F;
}

@font-face {
    font-family: 'Zimam Latin';
    src: url('../fonts/zimam/zimam-latin/ZimamLatin-Regular.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-007F, U+00A0-00FF, U+0100-017F, U+0180-024F, U+02B0-02FF, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2150-218F, U+2200-22FF, U+FB00-FB4F;
}

@font-face {
    font-family: 'Zimam Latin';
    src: url('../fonts/zimam/zimam-latin/ZimamLatin-Regular.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-007F, U+00A0-00FF, U+0100-017F, U+0180-024F, U+02B0-02FF, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2150-218F, U+2200-22FF, U+FB00-FB4F;
}

@font-face {
    font-family: 'Zimam Latin';
    src: url('../fonts/zimam/zimam-latin/ZimamLatin-Regular.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-007F, U+00A0-00FF, U+0100-017F, U+0180-024F, U+02B0-02FF, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2150-218F, U+2200-22FF, U+FB00-FB4F;
}

/* -------------------------------------------------------------------------- */
/* 2. Alyamama (الرسمي - خط اليمامة للغة العربية)                             */
/* -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Alyamama';
    src: url('../fonts/zimam/alyamama/Alyamama-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

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

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

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

@font-face {
    font-family: 'Alyamama';
    src: url('../fonts/zimam/alyamama/Alyamama-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alyamama';
    src: url('../fonts/zimam/alyamama/Alyamama-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* -------------------------------------------------------------------------- */
/* 3. Fallback Compatibility Aliases                                         */
/* Redirects any legacy 'IBM Plex Sans Arabic' call directly to Alyamama     */
/* -------------------------------------------------------------------------- */
@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../fonts/zimam/alyamama/Alyamama-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../fonts/zimam/alyamama/Alyamama-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../fonts/zimam/alyamama/Alyamama-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../fonts/zimam/alyamama/Alyamama-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* -------------------------------------------------------------------------- */
/* 4. Global Typography Tokens & Root Variables                              */
/* -------------------------------------------------------------------------- */
:root {
    --zimam-font-family: 'Zimam Latin', 'Alyamama', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-admin: var(--zimam-font-family);
    --font-primary: var(--zimam-font-family);
    --font-sans: var(--zimam-font-family);
    --font-family-base: var(--zimam-font-family);
    
    /* Ergonomic Optical Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.55;
    --line-height-relaxed: 1.7;
}

/* -------------------------------------------------------------------------- */
/* 5. Platform-Wide Application                                              */
/* -------------------------------------------------------------------------- */
html,
body,
button,
input,
optgroup,
select,
textarea,
.font-IBM\ Plex\ Sans\ Arabic,
[class*="font-IBM"] {
    font-family: var(--zimam-font-family) !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Enhanced body typography & comfortable line-height for Arabic text */
body {
    font-family: var(--zimam-font-family) !important;
    line-height: var(--line-height-normal);
    letter-spacing: 0;
}

/* Headings Visual Hierarchy with Alyamama */
h1, .h1 {
    font-family: var(--zimam-font-family) !important;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

h2, .h2 {
    font-family: var(--zimam-font-family) !important;
    font-weight: 700;
    line-height: 1.38;
}

h3, .h3 {
    font-family: var(--zimam-font-family) !important;
    font-weight: 600;
    line-height: 1.42;
}

h4, .h4 {
    font-family: var(--zimam-font-family) !important;
    font-weight: 600;
    line-height: 1.45;
}

h5, .h5,
h6, .h6 {
    font-family: var(--zimam-font-family) !important;
    font-weight: 500;
    line-height: 1.5;
}

/* Form Controls & Table Data legibility */
.form-control,
.form-select,
.btn,
.table th,
.table td,
.nav-link,
.dropdown-item,
.modal-title,
.badge {
    font-family: var(--zimam-font-family) !important;
}

/* Ensure numerals in tables, metrics, and KPI cards render crisp & aligned */
.admin-stat-card-value,
.bidi-code,
.bidi-number,
.table td:has(.bidi-value),
.badge:has(.bidi-value) {
    font-feature-settings: "tnum" 1, "cv01" 1;
}
