/* Dhivehi (Thaana) typefaces.
   Self-hosted so Dhivehi text never falls back to a font that lacks the
   Thaana block. Loaded on every page ahead of typography.css. */

/* AK Rasmee — the primary Dhivehi typeface (readable at UI sizes). */
@font-face {
    font-family: 'AK Rasmee';
    src: url('../../fonts/AKRasmee.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Faruma — kept as a fallback for any Thaana glyph AK Rasmee lacks. */
@font-face {
    font-family: 'Faruma';
    src: url('../../fonts/Faruma.woff2') format('woff2'),
         url('../../fonts/Faruma.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Anything flagged as Dhivehi renders in AK Rasmee, right-to-left and
   right-aligned, slightly larger than the surrounding text so the Thaana
   glyphs stay legible.

   The font-family/size/direction are forced with !important: component rules
   and inline styles on the host element (e.g. .c-post-desc, lightbox
   descriptions) otherwise win on specificity or source order and shrink or
   restyle the Dhivehi run. */
.is-dhivehi,
[lang="dv"] {
    font-family: 'AK Rasmee', 'Faruma', var(--font-family-base) !important;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext;
    font-size: 1.15em !important;
    letter-spacing: 0.06em;
    word-spacing: 0.12em;
    line-height: 1.5;
}

input.is-dhivehi,
textarea.is-dhivehi,
[contenteditable].is-dhivehi {
    direction: rtl !important;
    text-align: right !important;
    font-family: 'AK Rasmee', 'Faruma', var(--font-family-base) !important;
    font-size: 1.15em !important;
    letter-spacing: 0.06em;
    word-spacing: 0.12em;
}
