/*
 * FOMA typography standard
 * ------------------------------------------------------------------
 * Titles (гарчиг, дэд гарчиг, мэдээний гарчиг): Comfortaa
 * Reading text (контент, тайлбар, UI):          Nunito
 *
 * Every size on the site comes from the tokens below. style.css and
 * main.css reference these tokens instead of hard-coded px values, so
 * changing a token here changes it everywhere, at every breakpoint.
 * Load this file after main.css.
 */

/* Metric-matched fallbacks: text keeps its size while the web font loads (no layout jump). */
@font-face {
    font-family: "Comfortaa Fallback";
    src: local("Arial");
    ascent-override: 74.95%;
    descent-override: 19.91%;
    line-gap-override: 0%;
    size-adjust: 117.54%;
}

@font-face {
    font-family: "Nunito Fallback";
    src: local("Arial");
    ascent-override: 99.71%;
    descent-override: 34.82%;
    line-gap-override: 0%;
    size-adjust: 101.39%;
}

:root {
    /* Families */
    --font-title: "Comfortaa", "Comfortaa Fallback", system-ui, sans-serif;
    --font-body: "Nunito", "Nunito Fallback", system-ui, sans-serif;

    /* Weights */
    --fw-body: 400;
    --fw-body-strong: 700;
    --fw-title: 700;
    --fw-card-title: 700;

    /* Body text */
    --fs-base: 16px;          /* default UI / paragraph text */
    --fs-reading: 18px;       /* article & product description body */
    --fs-small: 14px;         /* secondary text, card excerpts */
    --fs-meta: 13px;          /* dates, categories, captions */

    /* Headings */
    --fs-h1: 34px;            /* page & article title */
    --fs-h2: 28px;            /* product name, big banner title */
    --fs-h3: 23px;
    --fs-h4: 20px;            /* footer column titles */
    --fs-h5: 17px;
    --fs-h6: 15px;

    /* Components */
    --fs-hero-title: 32px;    /* slideshow headline */
    --fs-section-title: 20px; /* "FOMA МЭДЭЭ", "Санал болгох", widget titles */
    --fs-card-title-lg: 21px; /* featured / large news card */
    --fs-card-title: 16px;    /* news card title */
    --fs-card-text: 14px;     /* news card excerpt */
    --fs-product-title: 15px; /* product card name */

    /* Line heights */
    --lh-title: 1.35;
    --lh-body: 1.6;
    --lh-reading: 1.75;
}

@media (max-width: 991px) {
    :root {
        --fs-h1: 30px;
        --fs-h2: 25px;
        --fs-hero-title: 28px;
        --fs-card-title-lg: 19px;
    }
}

@media (max-width: 767px) {
    :root {
        --fs-reading: 17px;
        --fs-h1: 26px;
        --fs-h2: 22px;
        --fs-h3: 20px;
        --fs-h4: 18px;
        --fs-h5: 16px;
        --fs-hero-title: 24px;
        --fs-section-title: 18px;
        --fs-card-title-lg: 18px;
        --fs-card-title: 15px;
        --fs-product-title: 14px;
    }
}

/* ---------- Base ---------- */

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-body);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea, .btn, .form-control {
    font-family: var(--font-body);
}

b, strong {
    font-weight: var(--fw-body-strong);
}

/* ---------- Titles: Comfortaa ---------- */

h1, h2, h3, h4, h5, h6,
.page-header__title,
.post-header__title,
.post__section-title,
.block-header__title,
.block-slideshow__slide-title,
.block-banner__title,
.block-features__title,
.widget__title,
.footer-links__title,
.footer-contacts__title,
.footer-newsletter__title,
.post-card__name,
.widget-posts__name,
.product__name,
.product-card__name,
.category-card__name,
.card-title,
.house-ad__title {
    font-family: var(--font-title);
    font-weight: var(--fw-title);
    line-height: var(--lh-title);
    letter-spacing: -0.005em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

.post-card__name,
.product-card__name,
.category-card__name,
.widget-posts__name {
    font-weight: var(--fw-card-title);
}

/* Long Mongolian words must wrap instead of overflowing narrow cards. */
.post-card__name a,
.product-card__name a,
.post-header__title {
    overflow-wrap: anywhere;
}

/* ---------- Reading text: Nunito ---------- */

.typography,
.post__content,
.product__description,
.product-tabs__content {
    font-family: var(--font-body);
    font-size: var(--fs-reading);
    line-height: var(--lh-reading);
}

.typography p {
    margin-bottom: 1.1em;
}

.typography h1, .typography h2, .typography h3,
.typography h4, .typography h5, .typography h6 {
    margin-top: 1.6em;
    margin-bottom: .6em;
}

.post-card__content,
.post-card__date,
.post-card__category,
.post-header__meta,
.widget-posts__date,
.block-features__subtitle {
    font-family: var(--font-body);
}
