/* Sinhala text rendering ----------------------------------------------------
   Jost / Quicksand (the site fonts) have no Sinhala glyphs, so the browser used to pick an
   arbitrary system font, which on many phones shapes rakaransaya / yansaya / vowel signs badly.
   Noto Sans Sinhala is appended to every font stack: Latin text keeps Jost / Quicksand,
   only Sinhala characters fall through to the Sinhala font.
   The font itself is loaded with <link> in the layout head (Google Fonts serves it with a
   unicode-range, so it is only downloaded when a page actually contains Sinhala). */

:root {
    --tp-ff-body: 'Jost', 'Noto Sans Sinhala', 'Iskoola Pota', 'Nirmala UI', sans-serif;
    --tp-ff-heading: 'Quicksand', 'Noto Sans Sinhala', 'Iskoola Pota', 'Nirmala UI', sans-serif;
    --tp-ff-p: 'Jost', 'Noto Sans Sinhala', 'Iskoola Pota', 'Nirmala UI', sans-serif;
    --tp-ff-jost: 'Jost', 'Noto Sans Sinhala', 'Iskoola Pota', 'Nirmala UI', sans-serif;
}

/* Sinhala vowel signs and conjuncts sit above and below the line: the fixed 23px line-height
   used for paragraphs clips and overlaps them. Give text blocks real leading. */
.product__details-info-list,
.product__details-info-list p,
.product__details-info-list li,
.tpdescription__content,
.tpdescription__content p,
.tpdescription__content li,
.tpdescription__content h1,
.tpdescription__content h2,
.tpdescription__content h3,
.tpdescription__content h4,
.tpdescription__content h5,
.tpdescription__content h6 {
    line-height: 1.8;
}

/* Never space letters out or change case inside descriptions: letter-spacing pulls apart the
   code points of one Sinhala letter and breaks the conjunct shaping. */
.product__details-info-list,
.tpdescription__content,
.tpproduct__title,
.product__details-title {
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    font-variant-ligatures: normal;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

/* Whole-site Sinhala mode (language switcher set to Sinhala) */
html:lang(si) body,
html:lang(si) p,
html:lang(si) li {
    line-height: 1.8;
    letter-spacing: normal;
}

html:lang(si) h1,
html:lang(si) h2,
html:lang(si) h3,
html:lang(si) h4,
html:lang(si) h5,
html:lang(si) h6 {
    line-height: 1.45;
    letter-spacing: normal;
}
