@font-face { font-family: "Aparajita"; src: url('../fonts/maithili/Aparajita.ttf') format('truetype'); font-weight: 100 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Kalam"; src: url('../fonts/maithili/Kalam-Regular.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Yatra One"; src: url('../fonts/maithili/YatraOne-Regular.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Nandni Maithili Digits"; src: url('../fonts/maithili/Kalam-DevanagariDigits.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0030-0039; }

html[lang="mai"] {
    --maithili-text: "Aparajita", serif;
    --maithili-items: "Kalam", cursive;
    --maithili-bold: "Yatra One", serif;
}
html[lang="mai"] body {
    --sans: var(--maithili-text);
    --serif: var(--maithili-bold);
    --bs-body-font-family: var(--maithili-text);
    font-size-adjust: .52;
    font-synthesis: none;
}
html[lang="mai"] body,
html[lang="mai"] body :where(p,a,span,small,label,li,td,th,dt,dd,div,section,article,header,footer,nav,legend,summary,output,time,button,input,select,textarea,option) {
    font-family: var(--maithili-text) !important;
}
html[lang="mai"] body :is(h1,h2,h3,h4,h5,h6,b,strong,.locale-bold),
html[lang="mai"] body :is(h1,h2,h3,h4,h5,h6,b,strong,.locale-bold) :where(*) {
    font-family: var(--maithili-bold) !important;
    letter-spacing: normal;
}
html[lang="mai"] body .locale-item-name,
html[lang="mai"] body .locale-item-name :where(*),
html[lang="mai"] body .locale-number,
html[lang="mai"] body :is(.store-product-card h3,.product-card h3,.product-name,.pos-product-name,.website-product-name,[data-customer-quantity-name]) {
    font-family: var(--maithili-items) !important;
    font-weight: 400 !important;
    letter-spacing: normal;
}
html[lang="mai"] .locale-text-run { min-width: 0; max-width: 100%; }
html[lang="mai"] body :is(.store-product-card h3,.product-card h3,.product-name,.pos-product-name,.website-product-name,[data-customer-quantity-name]) :where(*) {
    font-family: var(--maithili-items) !important;
    font-weight: 400 !important;
}
/* Native numeric controls retain valid machine values and show Devanagari glyphs. */
html[lang="mai"] body input:is([type="number"],[type="date"],[type="time"],[type="tel"],[inputmode="numeric"],[inputmode="decimal"]) {
    font-family: "Nandni Maithili Digits", var(--maithili-items) !important;
    font-weight: 400 !important;
}
/* Language choices must stay recognizable in their own language. */
html[lang="mai"] body [lang="en"], html[lang="mai"] body [lang="en"] :where(*) {
    font-family: "Poppins", Arial, sans-serif !important;
    font-size-adjust: none;
}
html[lang="en"] body [lang="mai"] { font-family: "Aparajita", serif; font-size-adjust: .52; }
/* Personal names retain their saved spelling and their readable original script. */
html[lang="mai"] body .locale-person-name[data-language-preserve],
html[lang="mai"] body .locale-person-name[data-language-preserve] :where(*) {
    font-family: "Poppins", "Aparajita", sans-serif !important;
    font-size-adjust: none;
}
