/* ==========================================================================
   Thaana (Dhivehi) typeface — the single place the Dhivehi font is defined.

   WHY THIS FILE EXISTS
   Faruma was once declared as @font-face in five separate places (style.css
   twice, public.css, dhivehi.css, manage_translations.php) and named in a
   dozen more inline font-family stacks. Two of those declarations pointed at
   `../assets/fonts/…` from inside assets/css/, which resolves to
   assets/assets/fonts/ — a 404 fired on every page load. Everything now reads
   one custom property, --dv-font.

   MADHEEH IS THE DHIVEHI FACE
   Bundled at assets/fonts/Madheeh.otf. MV Faseyha and Faruma sit behind it as
   fallbacks, and 'MV Boli' / 'A_Faruma' behind that for the case where bundled files
   fail to load — those are system Thaana faces common on Maldivian machines.

   The @font-face family is named 'Madheeh': that is the key used by --dv-font
   and by the mobile app.

   CHANGING THE DHIVEHI FONT
   One line — reorder --dv-font at the bottom. Nothing else on the site
   hardcodes a Thaana font.
   ========================================================================== */

/* --- Madheeh — the default ---------------------------------------------- */
/* Single weight, so 400 and 700 point at the same file. Declaring both stops
   the browser synthesising a bold from an undeclared weight, which renders
   more heavily than simply reusing the regular. */

@font-face {
    font-family: 'Madheeh';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Madheeh.otf') format('opentype');
}

@font-face {
    font-family: 'Madheeh';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Madheeh.otf') format('opentype');
}

/* --- MV Faseyha — kept as the first fallback ---------------------------- */

@font-face {
    font-family: 'MV Faseyha';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    /* Filename case matters: Apache on Linux serves paths case-sensitively,
       and the file on disk is faseyha.TTF — lowercase name, uppercase
       extension. Rename both together or not at all. */
    src: url('../fonts/faseyha.TTF') format('truetype');
}

@font-face {
    font-family: 'MV Faseyha';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/faseyha.TTF') format('truetype');
}

/* --- Faruma — kept as the second fallback ------------------------------- */

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

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

:root {
    /* The one stack. Change the first entry and every Dhivehi string on the
       site follows — public pages, the customer suite, the language toggle,
       the translations editor and the terms editor included.

       A browser only downloads a font it actually needs, so while Madheeh
       resolves, the Faseyha/Faruma @font-face rules above never fire a request.
       There is no cost to keeping them. */
    --dv-font: 'Madheeh', 'MV Faseyha', 'Faruma', 'MV Boli', 'A_Faruma', sans-serif;

    /* How much bigger Dhivehi renders than the Latin it sits beside.

       Thaana glyphs are small for their point size, so without this Dhivehi
       looks shrunken next to English. Tune this ONE value if Dhivehi looks too
       big or too small anywhere — do not patch individual pages.

       THE MOBILE APP MIRRORS THIS. src/i18n/defaultDhivehi.ts has a DV_SCALE
       constant doing the same job — React Native has no `em`, so it flattens
       each component's style, reads the fontSize and multiplies. Change one,
       change the other, or the app and the site will drift apart. */
    --dv-scale: 1.15;
}
