/* =============================================================================
   Rahav — Vazirmatn + Nazanin (site-wide, self-hosted)
   Applies the same Persian typeface used by the «hozor» project to the entire
   site: the WordPress theme (twentytwentyfive), the rahav-lms / rahav-support
   panels, wp-login.php and wp-admin. Loaded by the `rahav-font` must-use plugin.

   Two families are hosted next to this file and served from the site server
   (`/wp-content/mu-plugins/rahav-font/fonts/`), so no third-party CDN and no
   client-installed font is required:

   • Vazirmatn — the UI font for the whole site. It is a subset of the Vazirmatn
     variable font (weight axis 100-900) limited to the characters a Persian site
     needs, and split by unicode-range so a normal page fetches only the
     Arabic/Persian subset (~58 KB) instead of the 111 KB full family. The Latin
     subset is fetched only when Latin letters appear.

   • Nazanin — the reading font for the lesson body (`.rahav-lesson-content` only).
     Plain `@font-face`s for weights 400/700, split into Arabic/Persian, Latin and
     symbol subsets. Because it is referenced by a single class, the browser only
     downloads it on pages that actually render a lesson description.
   ============================================================================= */

/* Arabic / Persian, ASCII digits, punctuation and symbols — loaded on every page. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url("fonts/Vazirmatn-Arabic.woff2") format("woff2");
  unicode-range: U+0020-002F, U+0030-0039, U+003A-0040, U+005B-0060, U+007B-007E,
    U+00A0, U+00AB, U+00BB, U+0600-06FF, U+2000-206F, U+20AC, U+2122,
    U+2190-2193, U+2212, U+2215, U+FB50-FDFF, U+FE70-FEFF, U+FEFF, U+FFFD;
}

/* Latin letters (A-Z, a-z and accented forms) — fetched only when used. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url("fonts/Vazirmatn-Latin.woff2") format("woff2");
  unicode-range: U+0041-005A, U+0061-007A, U+00A1-00AA, U+00AC-024F,
    U+02C6, U+02DA, U+02DC;
}

:root {
  /* The block theme (twentytwentyfive) renders the body with
     font-family: var(--wp--preset--font-family--manrope) and also uses that
     preset for .has-manrope-font-family blocks. Redefining the variable — with
     !important so it also beats the theme's own :root declaration — turns the
     whole theme over to Vazirmatn without touching its files. */
  --wp--preset--font-family--manrope: "Vazirmatn", "Segoe UI", Tahoma, sans-serif !important;
}

/* Body and form controls. Deliberately limited to element selectors (NOT `*`):
   a global `* { font-family: ... !important }` would clobber icon fonts such as
   WordPress' `dashicons`. Everything else inherits from <body>, and the panels
   (`.rahav-*`) already list Vazirmatn first in their own font stacks. */
html,
body,
button,
input,
select,
textarea,
optgroup {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", sans-serif !important;
}

/* =============================================================================
   Nazanin — lesson body font (rahav-lesson-content)
   A Nazanin webfont for weights 400/700, self-hosted next to this file and split
   by unicode-range into Persian, Latin and symbol subsets. It is applied ONLY to
   the lesson description block so the rest of the panels keep Vazirmatn.
   `font-display: swap` is used (unlike Vazirmatn's `optional`) because the whole
   point of this face is that readers actually see Nazanin once it arrives.
   ============================================================================= */

/* weight 400 — Persian/Arabic */
@font-face {
  font-family: "Nazanin";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Nazanin-400-Arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200D, U+FB50-FDFF, U+FE70-FEFF;
}

/* weight 400 — Latin + digits */
@font-face {
  font-family: "Nazanin";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Nazanin-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, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* weight 400 — symbols/punctuation */
@font-face {
  font-family: "Nazanin";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Nazanin-400-Symbols.woff2") format("woff2");
  unicode-range: U+0300-0301, U+2219, U+25A1, U+25AA-25AB, U+25CA, U+25CC, U+25CF, U+25E6, U+266F, U+FFFC;
}

/* weight 700 — Persian/Arabic */
@font-face {
  font-family: "Nazanin";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Nazanin-700-Arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200D, U+FB50-FDFF, U+FE70-FEFF;
}

/* weight 700 — Latin + digits */
@font-face {
  font-family: "Nazanin";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Nazanin-700-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, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* weight 700 — symbols/punctuation */
@font-face {
  font-family: "Nazanin";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Nazanin-700-Symbols.woff2") format("woff2");
  unicode-range: U+0300-0301, U+2219, U+25A1, U+25AA-25AB, U+25CA, U+25CC, U+25CF, U+25E6, U+266F, U+FFFC;
}

/* The lesson description block keeps Vazirmatn everywhere else, but reads in
   Nazanin. `!important` beats the theme's heading/body presets and the
   `html, body, …` rule above; the descendant `*` also covers headings and
   <strong>/<em> that the theme would otherwise reset to its own preset. The
   block only ever holds rich text (no icon fonts), so the wide selector is safe. */
.rahav-lesson-content,
.rahav-lesson-content * {
  font-family: "Nazanin", "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", sans-serif !important;
}
