/* ============================================================
   ASYAD — Self-hosted type system
   English  → Alexandria   (Thin 100 – ExtraBold 800)
   Arabic   → Thmanyah Sans (Light 300 – Black 900)
   Generated as woff2/woff/ttf|otf trios for broad browser support.
   ============================================================ */

/* ---------- Alexandria (English / Latin) ---------- */
@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-Thin.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-Thin.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-Light.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-Light.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-Regular.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-Regular.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-Medium.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-Medium.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-SemiBold.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-SemiBold.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-Bold.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-Bold.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/alexandria/Alexandria-ExtraBold.woff2') format('woff2'),
         url('../fonts/alexandria/Alexandria-ExtraBold.woff') format('woff'),
         url('../fonts/alexandria/Alexandria-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ---------- Thmanyah Sans (Arabic) ---------- */
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah-sans/ThmanyahSans-Light.woff2') format('woff2'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Light.woff') format('woff'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah-sans/ThmanyahSans-Regular.woff2') format('woff2'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Regular.woff') format('woff'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah-sans/ThmanyahSans-Medium.woff2') format('woff2'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Medium.woff') format('woff'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah-sans/ThmanyahSans-Bold.woff2') format('woff2'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Bold.woff') format('woff'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyah-sans/ThmanyahSans-Black.woff2') format('woff2'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Black.woff') format('woff'),
         url('../fonts/thmanyah-sans/ThmanyahSans-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- Direction-aware font stacks ----------
   English (ltr) pages/text  -> Alexandria first
   Arabic  (rtl) pages/text  -> Thmanyah Sans first
   Both stacks list the other family as a secondary fallback so mixed
   AR/EN strings on the same line still render with a matching typeface. */
:root {
    --font-en: 'Alexandria', 'Thmanyah Sans', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-ar: 'Thmanyah Sans', 'Alexandria', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

    /* default (falls back to Arabic stack); overridden per <html dir> below */
    --font-main: var(--font-ar);
}

html[dir="ltr"] { --font-main: var(--font-en); }
html[dir="rtl"] { --font-main: var(--font-ar); }
