/*
 * Official SOUEAST typography for the public site: Montserrat (English/Latin) and Lateef (Arabic),
 * the families used by soueast-motor.com. Both are SIL OFL 1.1 fonts, self-hosted from the
 * Fontsource packages (v5.3.0); licences in ../fonts/OFL-*.txt.
 *
 * Lateef covers only the Arabic range, so Latin words and digits on Arabic pages use Montserrat.
 * Lateef draws much smaller than Latin fonts at the same px size; size-adjust brings it back to a
 * readable size without touching any page's font-size rules.
 *
 * The Lateef files used by normal Arabic text are the same font cut down to the Arabic block, supplement and joiners
 * (~38/40 KB instead of ~62/68 KB, tools/fonts/subset_lateef.sh); the original files stay for the rare ranges.
 *
 * Pages use var(--sou-font); it switches with <html lang>.
 */

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/montserrat-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Lateef, Arabic block and the signs normal text uses: the cut-down files (Arabic letters, supplement, joiners; every
   GSUB/GPOS feature kept, so shaping is identical). Used by every Arabic page. */
@font-face {
    font-family: 'Lateef';
    font-style: normal;
    font-display: swap;
    font-weight: 100 500;
    size-adjust: 135%;
    src: url('../fonts/lateef-arabic-400-subset.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41;
}

@font-face {
    font-family: 'Lateef';
    font-style: normal;
    font-display: swap;
    font-weight: 600 900;
    size-adjust: 135%;
    src: url('../fonts/lateef-arabic-700-subset.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41;
}

/* Lateef, rare ranges (Arabic Extended-A and the presentation forms that text pasted from PDFs can contain):
   the original full files, fetched only when such a character actually appears. */
@font-face {
    font-family: 'Lateef';
    font-style: normal;
    font-display: swap;
    font-weight: 100 500;
    size-adjust: 135%;
    src: url('../fonts/lateef-arabic-400-normal.woff2') format('woff2');
    unicode-range: U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Lateef';
    font-style: normal;
    font-display: swap;
    font-weight: 600 900;
    size-adjust: 135%;
    src: url('../fonts/lateef-arabic-700-normal.woff2') format('woff2');
    unicode-range: U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
    --sou-font-en: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --sou-font-ar: 'Lateef', 'Montserrat', 'Segoe UI', Tahoma, Arial, sans-serif;
    --sou-font: var(--sou-font-en);
    --bs-body-font-family: var(--sou-font);
}

:root[lang="ar"] {
    --sou-font: var(--sou-font-ar);
    --bs-body-font-family: var(--sou-font);
}

body,
button,
input,
select,
optgroup,
textarea {
    font-family: var(--sou-font);
}

/*
 * Arabic is a joined script: any letter-spacing pulls the connected letters apart (e.g. the
 * "حضورنا" kicker and the "صالة عرض ساويست جازان" labels, which inherited the uppercase tracking
 * of their English versions). Every Arabic-language element (the whole of an Arabic page, or an
 * Arabic block marked lang="ar" on an English page) gets normal shaping; an element marked
 * lang="en" inside an Arabic page keeps its own tracking.
 */
body:lang(ar),
body :lang(ar) {
    letter-spacing: 0 !important;
}
