/* ==========================================================================
   FONTS — self-hosted
   --------------------------------------------------------------------------
   Files live in public/fonts and are served from our own origin. No CDN:
   a blocking request to fonts.googleapis.com is a poor bet on Iraqi networks
   and leaks every page view to a third party.

   Imported by resources/react/theme.css (public + portal), and handed to
   masar/core's admin panel as its font file, so the public site, the portal
   and the panel resolve the same faces.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Latin
   -------------------------------------------------------------------------- */

/* Cinzel — variable, display */
@font-face {
    font-family: "Cinzel";
    src: url("/fonts/Cinzel-Variable.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* Lato — body */
@font-face {
    font-family: "Lato";
    src: url("/fonts/Lato-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

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

/* --------------------------------------------------------------------------
   Arabic
   -------------------------------------------------------------------------- */

/* Amiri — naskh display */
@font-face {
    font-family: "Amiri";
    src: url("/fonts/Amiri-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

/* Almarai — Arabic body */
@font-face {
    font-family: "Almarai";
    src: url("/fonts/Almarai-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

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

@font-face {
    font-family: "Almarai";
    src: url("/fonts/Almarai-ExtraBold.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Tajawal — Arabic display. size-adjust evens its labels with Almarai, which it draws ~10% smaller. */
@font-face {
    font-family: "Tajawal";
    src: url("/fonts/Tajawal-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    size-adjust: 104%;
}

@font-face {
    font-family: "Tajawal";
    src: url("/fonts/Tajawal-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    size-adjust: 104%;
}

@font-face {
    font-family: "Tajawal";
    src: url("/fonts/Tajawal-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    size-adjust: 104%;
}

@font-face {
    font-family: "Tajawal";
    src: url("/fonts/Tajawal-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    size-adjust: 104%;
}

/* --------------------------------------------------------------------------
   Kurdish (Sorani)
   --------------------------------------------------------------------------
   Amiri, Almarai and Tajawal do not carry ڕ ڵ ۆ ێ گ چ پ ژ. The Noto faces do,
   which is why the `kurdish` and `kurdish-display` Tailwind families exist.
   -------------------------------------------------------------------------- */

/* Noto Kufi Arabic — variable, Kurdish display */
@font-face {
    font-family: "Noto Kufi Arabic";
    src: url("/fonts/NotoKufiArabic-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Noto Sans Arabic — variable, Kurdish body */
@font-face {
    font-family: "Noto Sans Arabic";
    src: url("/fonts/NotoSansArabic-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/*
  One pair of font tokens, re-pointed per locale. Targeting `body` and the
  heading elements was not enough — anything that sets `font-display` itself,
  such as Button, kept a Latin face with no Arabic or Kurdish glyphs and fell
  back to whatever the OS happened to ship.

  Kurdish Sorani needs its own stack: Almarai and Tajawal have no glyphs for
  the extended letters (ڵ ڕ ۆ ێ گ چ ژ پ). Noto covers Kurdish in full.

  Here rather than in theme.css because the admin panel needs them too, and it
  cannot import a file containing Tailwind directives.
*/
:root {
  --font-display: "Cinzel", serif;
  --font-body: "Lato", sans-serif;
}

html[lang="ar"] {
  --font-display: "Tajawal", sans-serif;
  --font-body: "Almarai", sans-serif;
}

html[lang="ckb"] {
  --font-display: "Noto Kufi Arabic", "Tajawal", sans-serif;
  --font-body: "Noto Sans Arabic", "Almarai", sans-serif;
}
