/*
    The typefaces the FOREIGN-LANGUAGE pages are set in. Persian never loads this file.

    ==================== WHY THIS EXISTS AT ALL ====================
    Every catalogue locale was being set in the shop's PERSIAN brand face. Measured, not assumed:
    on /en, /ru and /ja an ordinary paragraph computed
        "Ravi FaNum", Vazirmatn, IRANSans, system-ui, Tahoma, sans-serif
    -- the brand face FIRST. The [dir="ltr"] inversion in storefront-theme only ever rescued
    elements that CARRY a dir attribute (the prices, the WhatsApp number, the switcher), because
    .b-scope sets font-family on a div and everything inside it inherits that instead. So the
    body copy of a German catalogue page was drawn in a Persian type designer's latin.

    ==================== SELF-HOSTED, AND SUBSET ON PURPOSE ====================
    All OFL, all served from this origin. Never a font CDN: the rule holds for the same reason it
    holds for Persian, and doubly for Chinese, where Google is not reachable at all -- a CDN there
    is not a slow page, it is no page.

    Only the subsets a locale of this site can use are shipped. The unicode-ranges are Google's
    own, and they are what stops an Arabic page pulling Noto's latin cut when Inter already
    carries the latin, and what stops any of this being fetched before a character needs it.

    ==================== WHAT EACH SCRIPT GOT, AND WHY ====================
    Inter               latin, latin-ext, cyrillic -- en es fr pt da de tr ru.
                        One face for eight languages. latin-ext is what carries Turkish g-breve
                        and dotless i; Danish ae/oe/aa and German umlauts are already in latin.
    Noto Sans Arabic    ar. The brand face is Persian: it draws U+0030-39 as PERSIAN digits, whose
                        4, 5 and 6 are shaped differently from the Arabic-Indic ones an Arab
                        reader expects.
    Noto Nastaliq Urdu  ur. NOT a naskh face. Urdu set in naskh reads as foreign to an Urdu
                        reader; nastaliq is the script Urdu is actually written in. It is the
                        most expensive file here and it is not optional.
    Noto Sans Georgian  ka.
    Noto Sans Armenian  hy.
    Noto Sans Thai      th.

    ==================== CHINESE AND JAPANESE GET NO WEBFONT ====================
    Deliberate, and measured: Noto Sans SC is 8.8 MB across 202 subset files and Noto Sans JP is
    10.2 MB across 248. A page pulls only the slices it uses, but that is still most of a megabyte
    for one catalogue page, shipped from a server in Iran. Every Chinese and Japanese device
    already carries a first-class face for its own script -- PingFang SC, Microsoft YaHei,
    Hiragino Sans, Yu Gothic, Noto Sans CJK -- drawn by Apple, Microsoft and Adobe for exactly
    this. Those stacks are named in storefront-theme. Zero bytes and better type is not a
    compromise; for CJK it is what the good Chinese and Japanese sites do.
*/

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('inter-cyrillic-400.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('inter-latin-ext-400.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;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('inter-latin-400.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: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('inter-cyrillic-700.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('inter-latin-ext-700.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;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('inter-latin-700.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: 'Noto Sans Arabic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('noto-arabic-arabic-400.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: 'Noto Sans Arabic';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('noto-arabic-arabic-700.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: 'Noto Nastaliq Urdu';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('noto-nastaliq-arabic-400.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: 'Noto Nastaliq Urdu';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('noto-nastaliq-arabic-700.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: 'Noto Sans Georgian';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('noto-georgian-georgian-400.woff2') format('woff2');
    unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31;
}

@font-face {
    font-family: 'Noto Sans Georgian';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('noto-georgian-georgian-700.woff2') format('woff2');
    unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31;
}

@font-face {
    font-family: 'Noto Sans Armenian';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('noto-armenian-armenian-400.woff2') format('woff2');
    unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17;
}

@font-face {
    font-family: 'Noto Sans Armenian';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('noto-armenian-armenian-700.woff2') format('woff2');
    unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17;
}

@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('noto-thai-thai-400.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('noto-thai-thai-700.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

/*
    ==================== WHICH LOCALE IS SET IN WHAT ====================

    These re-point the three type tokens declared on :root in partials/buy-theme.blade.php. They
    are keyed off html[lang], which is where the locale already is, and they reach `.b-scope`
    because custom properties inherit -- which is exactly why --b-font must NOT be declared on
    .b-scope itself.

    --b-font-ltr is set to the same value everywhere here on purpose. On a catalogue page the main
    stack is ALREADY correct for latin, because every non-latin face below is subset to its own
    unicode-range and latin characters fall through to Inter one character at a time. Leaving the
    Persian default in place would have drawn the prices in a different face from the paragraph
    beside them.

    LINE HEIGHT IS PER SCRIPT, AND IT IS NOT A PREFERENCE. Measured from each font's own hhea:

        Inter               1.210 em      Noto Sans Thai        1.511 em
        Noto Sans Georgian  1.360 em      Noto Sans Arabic      2.112 em
        Noto Sans Armenian  1.360 em      Noto Nastaliq Urdu    2.500 em
        Ravi FaNum          1.550 em   (the Persian default, at --b-lh 1.85)

    Arabic and Urdu both exceed the site's 1.85, so at the default they would overlap their own
    lines -- nastaliq especially, which cascades diagonally and genuinely uses that 2.5. Those two
    get more leading. Latin gets slightly less than Persian for the reason the old rule gave: it
    carries shorter ascenders and does not need the room.
*/

/* Latin and Cyrillic -- eight languages, one face. */
html[lang="en"], html[lang="es"], html[lang="fr"], html[lang="pt"],
html[lang="de"], html[lang="da"], html[lang="tr"], html[lang="ru"] {
    --b-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 1.75;
}

html[lang="ar"] {
    --b-font: 'Noto Sans Arabic', 'Inter', system-ui, Tahoma, sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 2.05;
}

/*
    Nastaliq, not naskh. Urdu written in naskh is legible the way English in blackletter is
    legible -- a reader gets through it and knows it was not meant for them. The heaviest file
    in this directory, and the one least worth economising on.
*/
html[lang="ur"] {
    --b-font: 'Noto Nastaliq Urdu', 'Noto Sans Arabic', 'Inter', system-ui, serif;
    --b-font-ltr: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --b-lh: 2.6;
}

html[lang="ka"] {
    --b-font: 'Noto Sans Georgian', 'Inter', system-ui, sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 1.8;
}

html[lang="hy"] {
    --b-font: 'Noto Sans Armenian', 'Inter', system-ui, sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 1.8;
}

html[lang="th"] {
    --b-font: 'Noto Sans Thai', 'Inter', system-ui, sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 1.95;
}

/*
    Chinese and Japanese: Inter carries the latin, the DEVICE carries its own script. See the
    note at the top of this file for the measurement behind that -- 8.8 MB and 10.2 MB of webfont
    respectively, against a native face that is already installed, already excellent, and free.
    The stacks are ordered Apple, Windows, Android/Linux, which is the order the market is in.
*/
html[lang="zh"] {
    --b-font: 'Inter', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
              'Noto Sans CJK SC', 'Source Han Sans SC', 'WenQuanYi Micro Hei', sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 1.9;
}

html[lang="ja"] {
    --b-font: 'Inter', -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic',
              'Noto Sans CJK JP', 'Meiryo', sans-serif;
    --b-font-ltr: var(--b-font);
    --b-lh: 1.9;
}

/*
    ==================== THE TAB BAR LABEL IS 16px, AND TWO SCRIPTS DO NOT FIT ====================

    .c-tabs__label is a FIXED 16px box with overflow:hidden, because the box is what animates when
    the bar minimises. Measured with canvas TextMetrics at the real 10.88px label size, the ink of
    each script against that box:

        Ravi FaNum (fa)      asc  9.00  desc 3.00   fits, 1.50/2.50 to spare
        Inter (latin)        asc  8.00  desc 3.00   fits
        Noto Sans Georgian   asc  9.00  desc 3.00   fits
        Noto Sans Thai       asc 10.00  desc 1.00   fits
        Noto Sans Arabic     asc  9.62  desc 5.00   CLIPPED 1.00px at the bottom -> needs 19
        Noto Nastaliq Urdu   asc 20.63  desc 1.82   CLIPPED 8.63px at the TOP    -> needs 35

    Arabic is a regression this very stylesheet introduced: /ar used to be set in the Persian face,
    which fits, and Noto Sans Arabic has a deeper descender. Four pixels of box buys it back.

    URDU IS THE INTERESTING ONE, AND IT IS NOT A HEIGHT PROBLEM. A 20.63px ink ascent under an
    10.88px font is nastaliq telling you what it is: the script cascades diagonally, so a word
    occupies roughly twice the vertical room its point size suggests. Giving it 35px would make the
    tab bar 81px tall on one locale and distort the one element on this site that was tuned to the
    pixel — and it would still be nastaliq at 11px, which is not legible whatever room it has.

    So the Urdu tab labels are set in NASKH, from the system, and the body copy stays nastaliq.
    That is what Urdu interfaces actually do: nastaliq is for reading, naskh is for chrome. It is
    also free — naming Noto Sans Arabic here instead would pull 324 KB onto the page to set five
    navigation words, when the device already has a face that does the job at this size.
*/
html[lang="ar"], html[lang="ur"] {
    --ct-lbl: 20px;
}

html[lang="ur"] .c-tabs__label {
    font-family: system-ui, 'Segoe UI', Tahoma, sans-serif;
}
