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

   WHY THIS FILE EXISTS
   Faruma was 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/Faruma.ttf` 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.

   WHY NOTO SANS THAANA
   Faruma is a system font from the early 2000s: one weight, no hinting tuned
   for screens, and metrics that sit noticeably small next to Latin text, which
   is why dhivehi.css has to bump every Dhivehi node to 1.15em to compensate.
   Noto Sans Thaana is actively maintained, licensed OFL 1.1 (so it can be
   self-hosted and redistributed), and ships weights 100–900 with much better
   screen rendering. Faruma stays in the stack as a fallback so nothing breaks.

   >>> ONE MANUAL STEP <<<
   The font binaries are not in the repo yet. Download these two files and drop
   them in assets/fonts/thaana/:

     NotoSansThaana-Regular.ttf   weight 400
     NotoSansThaana-Bold.ttf      weight 700

   From https://fonts.google.com/noto/specimen/Noto+Sans+Thaana ("Get font" →
   download the family), or directly:
     https://fonts.gstatic.com/s/notosansthaana/v26/C8c14dM-vnz-s-3jaEsxlxHkBH-WZOETXfoQrfQ9Y4XrbhLh.ttf   (400)
     https://fonts.gstatic.com/s/notosansthaana/v26/C8c14dM-vnz-s-3jaEsxlxHkBH-WZOETXfoQrfQ9Y4UMaRLh.ttf   (700)

   If you can convert them to .woff2 first, do — it is roughly a third of the
   size and the src list below already prefers it. Until the files exist the
   last entry in each src list loads them from Google's CDN, so the site works
   either way; self-host as soon as you can so there is no third-party request.
   ========================================================================== */

@font-face {
    font-family: 'Noto Sans Thaana';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/thaana/NotoSansThaana-Regular.woff2') format('woff2'),
         url('../fonts/thaana/NotoSansThaana-Regular.ttf') format('truetype'),
         url('https://fonts.gstatic.com/s/notosansthaana/v26/C8c14dM-vnz-s-3jaEsxlxHkBH-WZOETXfoQrfQ9Y4XrbhLh.ttf') format('truetype');
}

@font-face {
    font-family: 'Noto Sans Thaana';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/thaana/NotoSansThaana-Bold.woff2') format('woff2'),
         url('../fonts/thaana/NotoSansThaana-Bold.ttf') format('truetype'),
         url('https://fonts.gstatic.com/s/notosansthaana/v26/C8c14dM-vnz-s-3jaEsxlxHkBH-WZOETXfoQrfQ9Y4UMaRLh.ttf') format('truetype');
}

/* Faruma, kept as a fallback. Declared once, with the path that actually
   resolves — assets/css/ + ../fonts/ = assets/fonts/. */
@font-face {
    font-family: 'Faruma';
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: url('../fonts/Faruma.ttf') format('truetype');
}

:root {
    /* The one stack. 'MV Faseyha' and 'MV Boli' are the Windows and macOS
       system Thaana faces; they only matter if both webfonts fail. */
    --dv-font: 'Noto Sans Thaana', 'Faruma', 'MV Faseyha', 'MV Boli', 'A_Faruma', sans-serif;

    /* Thaana renders smaller than Latin at the same font-size. Noto Sans
       Thaana is closer to parity than Faruma was, so this is a gentler bump
       than the 1.15 the old stylesheet needed. */
    --dv-scale: 1.08;
}
