/*
 * CoreCave Academy — self-hosted Arabic fonts
 * Cairo (headings) + Tajawal (body)
 *
 * WOFF2 files are NOT shipped with the theme — they must be placed into this
 * directory after subsetting. Until they exist, the system font fallback in
 * --cc-font-heading / --cc-font-body keeps the site readable.
 *
 * Subset recipe (one-time, run on any workstation with fonttools installed):
 *   pyftsubset Cairo-Bold.ttf \
 *     --output-file=cairo-700-arabic.woff2 --flavor=woff2 \
 *     --unicodes="U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF"
 *
 * File-name contract:
 *   cairo-{400,600,700,900}-{arabic,latin}.woff2
 *   tajawal-{400,500,700}-{arabic,latin}.woff2
 */

/* ============================================================
 * Cairo — headings
 * ============================================================ */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('cairo-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('cairo-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('cairo-600-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('cairo-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('cairo-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('cairo-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('cairo-900-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('cairo-900-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}

/* ============================================================
 * Tajawal — body
 * ============================================================ */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('tajawal-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('tajawal-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('tajawal-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('tajawal-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('tajawal-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('tajawal-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}

/* ============================================================
 * Base type rules — applied through the cascade
 * ============================================================ */
html, body {
  font-family: var(--cc-font-body, 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, sans-serif);
  font-size: var(--cc-fs-base, 16px);
  line-height: var(--cc-lh-loose, 1.75);
  font-feature-settings: "kern", "liga", "calt";
}

h1, h2, h3, h4, h5, h6,
.elementor-heading-title,
.tutor-course-name,
.course-loop-title,
.tutor-h1, .tutor-h2, .tutor-h3 {
  font-family: var(--cc-font-heading, 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif);
  line-height: var(--cc-lh-tight, 1.25);
  font-weight: var(--cc-fw-bold, 700);
  letter-spacing: 0;
}

bdi.cc-num,
.cc-num {
  unicode-bidi: isolate;
  font-feature-settings: "lnum", "tnum";
  font-variant-numeric: tabular-nums;
}

/* ============================================================
 * Cairo Play (variable, display family — editorial revamp)
 * Single variable woff2 covers wght 100–1000 per Google Fonts spec.
 * ============================================================ */
@font-face {
  font-family: 'Cairo Play';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('cairo-play-variable-arabic.woff2') format('woff2-variations'), url('cairo-play-variable-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo Play';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('cairo-play-variable-latin.woff2') format('woff2-variations'), url('cairo-play-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}

/* ============================================================
 * Almarai (body family — editorial revamp)
 * Static weights 400 + 700, Arabic + Latin subsets.
 * ============================================================ */
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('almarai-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('almarai-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('almarai-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Almarai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('almarai-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
