/*
 * ============================================================
 * AKADEMIYA SAYTI — YAGONA TIPOGRAFIYA MANBAI (public sayt)
 * ============================================================
 *
 * Ulanishi: `app\assets\TypographyAsset` (layout'da ro'yxatga olinadi).
 *
 *   gorom/css/style.css, responsive.css, menu.css — komponentlar (tokenlardan foydalanadi)
 *        ↓
 *   mycss/typography.css                         — SHU FAYL: shrift, shkala, baza
 *        ↓
 *   mycss/page-hero.css, inner-page.css …        — sahifa/komponent qatlami
 *
 * QOIDALAR
 *   1. Shrift oilasi faqat shu yerda (`--font-primary`). Boshqa fayllar
 *      meros oladi. Istisno: ikonka fontlari (Font Awesome, Flaticon,
 *      Glyphicons) — ularga tegilmaydi.
 *   2. O'lchamlar FAQAT shkaladan: 11 / 12 / 13 / 14 / 16 / 20 / 28px.
 *      Komponentlar qiymatni emas, tokenni yozadi (`var(--fs-card)`).
 *   3. Og'irliklar: 400 / 500 / 600 / 700. 800/900 ishlatilmaydi.
 *   4. Shrift fayllari layout'dagi bitta Google Fonts <link> orqali
 *      (Montserrat 400–700, `cyrillic` + `cyrillic-ext`: Ў Қ Ғ Ҳ).
 *   5. `!important` faqat CMS kontentidagi inline uslublarni yengish uchun.
 *
 * Shkaladan tashqari (asosli) istisnolar komponent fayllarida izoh bilan:
 *   bosh sahifa hero'si, statistika raqamlari, 404 raqami, ikonka o'lchamlari.
 *
 * Bosh sahifa to'liq shkaladan tashqarida: kattaroq sarlavha va kartalar —
 * `mycss/home.css` (`HomePageAsset`, faqat `body.page-home` ostida).
 */

/* ============================================================
   Tokenlar
   ============================================================ */

:root {
    --font-primary: "Montserrat", Arial, sans-serif;

    /* O'lchamlar shkalasi */
    --fs-xs: 11px;      /* yordamchi, belgi (badge), oy nomi   */
    --fs-sm: 12px;      /* menyu, breadcrumb, sana, tugma      */
    --fs-card: 13px;    /* karta/yangilik sarlavhasi, jadval   */
    --fs-body: 14px;    /* asosiy matn, forma                  */
    --fs-md: 16px;      /* H3, yon ustun sarlavhasi, tashkilot */
    --fs-lg: 20px;      /* H2, bo'lim sarlavhasi, modal         */
    --fs-xl: 28px;      /* H1, sahifa sarlavhasi               */

    /* Sahifa sarlavhasi — mobilda kichrayadi (pastda) */
    --fs-page-title: var(--fs-xl);

    /*
     * Uzun o'qiladigan kontent (CMS matni: menyu sahifalari, yangilik,
     * statik sahifa, FAQ javobi, biografiya). UI matnidan (14px) +2px —
     * katta hajmdagi rasmiy matnni o'qish qulay bo'lishi uchun.
     */
    --fs-content: 18px;

    /* Yon ustun (bo'lim menyusi, aloqa va promo kartasi) — barcha ichki sahifalarda bir xil */
    --fs-sidebar-title: 18px;
    --fs-sidebar: 15px;

    /* Og'irliklar */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Qator balandligi */
    --lh-tight: 1.3;
    --lh-heading: 1.3;
    --lh-normal: 1.5;
    --lh-body: 21px;    /* 14px matn   */
    --lh-card: 18px;    /* 13px sarlavha, 12px tugma */
    --lh-meta: 17px;    /* 12px sana   */
    --lh-table: 19px;   /* 13px jadval */
    --lh-content: 29px; /* 18px kontent */
    --lh-sidebar: 21px; /* 15px yon ustun */
}

/* ============================================================
   Typography — bazaviy elementlar
   ============================================================ */

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

p {
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
    line-height: var(--lh-body);
}

h1,
.page-title {
    font-size: var(--fs-page-title);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
}

h2,
.section-title,
.section-title h2,
.block-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
}

h3,
.content-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}

h4,
h5,
h6 {
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}

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

small,
.small {
    font-size: var(--fs-sm);
}

/* ============================================================
   Breadcrumb
   ============================================================ */

.breadcrumb {
    font-family: var(--font-primary);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    line-height: var(--lh-card);
}

/* ============================================================
   Sidebar
   ============================================================
   Eski ichki sahifalarning yon menyusi (`MenuCategoryWidget`,
   `CategoryWidget`) sarlavhasi — `h2`, lekin vizual darajasi H3.
   ------------------------------------------------------------ */

.widget-title,
.widget > h2 {
    font-size: var(--fs-sidebar-title);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}

/* ============================================================
   Cards / News — umumiy nomlar
   ============================================================ */

.card-title,
.news-title,
.news-card-title,
.news-item-title {
    font-size: var(--fs-card);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-card);
}

/* ============================================================
   Buttons
   ============================================================ */

button,
.btn,
.button,
input[type="submit"],
input[type="button"] {
    font-family: var(--font-primary);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-card);
}

/* ============================================================
   Forms
   ============================================================ */

input,
select,
textarea,
optgroup,
option {
    font-family: var(--font-primary);
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
}

input::placeholder,
textarea::placeholder {
    font-family: var(--font-primary);
}

.control-label,
.form-label,
.form-group > label {
    font-size: var(--fs-card);
    font-weight: var(--fw-semibold);
}

.help-block,
.hint-block,
.form-text {
    font-size: var(--fs-sm);
    font-weight: var(--fw-regular);
}

.help-block-error,
.invalid-feedback,
.has-error .help-block {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

/* ============================================================
   Tables
   ============================================================ */

table {
    font-size: var(--fs-card);
    line-height: var(--lh-table);
}

th {
    font-weight: var(--fw-semibold);
}

td {
    font-weight: var(--fw-regular);
}

table .btn,
table button {
    font-size: var(--fs-sm);
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination,
.pagination a,
.pagination li > span {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

/* ============================================================
   Modal
   ============================================================ */

.modal-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
}

.modal-body {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

.modal-footer .btn {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

/* ============================================================
   Footer
   ============================================================ */

.main-footer .widget-content h2 {
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
}

/* ============================================================
   Bootstrap va uchinchi tomon komponentlari
   ============================================================
   O'z shrift stack'ini beradigan komponentlar asosiy shriftga
   qaytariladi. Vendor fayllari o'zgartirilmaydi.
   ------------------------------------------------------------ */

.dropdown-menu,
.dropdown-item,
.nav-link,
.badge,
.tooltip,
.popover,
.nice-select,
.nice-select .list,
.selectize-input,
.selectize-dropdown,
.mfp-title,
.mfp-counter,
.fancybox-title,
.fancybox-error,
#baguetteBox-overlay .full-image figcaption,
.glightbox-container .gslide-title,
.glightbox-container .gslide-desc,
.swiper {
    font-family: var(--font-primary);
}

/* ============================================================
   Content — CMS matni (`.content-body`)
   ============================================================
   Adminda (TinyMCE / Word) kiritilgan matnlarda inline
   `font-family: tahoma; font-size: 14pt` bor (yangiliklarning ~99% i).
   Kontent bazada o'zgartirilmaydi — o'ram ichida sahifa
   tipografiyasi ustun qo'yiladi. `Symbol` / `Wingdings` — Word ro'yxat
   belgilari, almashtirilmaydi.
   ------------------------------------------------------------ */

.content-body {
    font-size: var(--fs-content);
    line-height: var(--lh-content);
    overflow-wrap: break-word;
}

.content-body [style*="font-family"]:not([style*="Symbol" i]):not([style*="Wingdings" i]) {
    font-family: inherit !important;
}

.content-body [style*="font-size"] {
    font-size: inherit !important;
}

.content-body [style*="line-height"] {
    line-height: inherit !important;
}

/*
 * Global `p` qoidasi (14px) paragrafga o'lchamni to'g'ridan-to'g'ri beradi —
 * kontent ichida paragraf va ro'yxat bandi o'ramdan meros oladi.
 */
.content-body p,
.content-body li {
    font-size: inherit;
    line-height: inherit;
}

.content-body p {
    margin: 0 0 1em;
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    margin: 1.4em 0 0.6em;
}

/* Kontent sarlavhalari: sahifa sarlavhasidan (H1) oshmaydi, matndan (16px) kichik bo'lmaydi */
.content-body h1,
.content-body h2 {
    font-size: var(--fs-lg);
}

.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    font-size: var(--fs-content);
}

/* Shablon `ul, li { list-style: none }` qiladi — kontentda belgilar qaytadi */
.content-body ul,
.content-body ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.content-body ul { list-style: disc; }
.content-body ol { list-style: decimal; }

.content-body li {
    list-style: inherit;
}

.content-body li + li {
    margin-top: 0.35em;
}

.content-body table {
    font-size: var(--fs-md);
    line-height: 24px;
}

.content-body blockquote {
    margin: 0 0 1em;
    padding-left: 1em;
    border-left: 3px solid #d9e3f2;
    font-style: italic;
}

.content-body > :first-child {
    margin-top: 0;
}

.content-body > :last-child {
    margin-bottom: 0;
}

/* Jadval katakchasi kabi tor joylar: o'lcham atrofdan olinadi */
.content-body--compact {
    font-size: inherit;
    line-height: inherit;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 767.98px) {
    :root {
        --fs-page-title: var(--fs-lg);
    }

    /* Tor ustunda `justify` so'zlar orasida katta bo'shliq qoldiradi */
    .content-body [style*="justify"] {
        text-align: left !important;
    }
}
