/* ==========================================================================
   فونت اصلی سایت شهرداری موسیان — یکان‌بخ (YekanBakh)
   --------------------------------------------------------------------------
   کل وزن‌های فونت به‌صورت محلی روی همین سرور بارگذاری می‌شود؛
   هیچ درخواستی به گوگل‌فونت یا CDN بیرونی ارسال نمی‌شود.
   font-display: swap  → متن از همان لحظهٔ اول با فونت جانشین نمایش داده می‌شود
   و پس از آمدن فونت اصلی، بدون پرش و بدون صفحهٔ سفید جایگزین می‌شود.
   ========================================================================== */

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Hairline.woff2') format('woff2'),
         url('../fonts/YekanBakh-Hairline.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Thin.woff2') format('woff2'),
         url('../fonts/YekanBakh-Thin.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Light.woff2') format('woff2'),
         url('../fonts/YekanBakh-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Regular.woff2') format('woff2'),
         url('../fonts/YekanBakh-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Medium.woff2') format('woff2'),
         url('../fonts/YekanBakh-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Bold.woff2') format('woff2'),
         url('../fonts/YekanBakh-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Heavy.woff2') format('woff2'),
         url('../fonts/YekanBakh-Heavy.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh-Fat.woff2') format('woff2'),
         url('../fonts/YekanBakh-Fat.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   فونت جانشین با متریک هم‌اندازهٔ یکان‌بخ.
   تا لحظه‌ای که فایل فونت اصلی برسد، متن با تاهوما نمایش داده می‌شود ولی
   با همان عرض و ارتفاع؛ به این ترتیب هنگام سوییچ شدن فونت، صفحه تکان
   نمی‌خورد و متن جابه‌جا نمی‌شود (حذف Layout Shift).
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'YekanBakh Fallback';
    src: local('Tahoma'), local('Arial');
    size-adjust: 97%;
    ascent-override: 92%;
    descent-override: 24%;
    line-gap-override: 0%;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   اعمال فونت روی کل سایت
   font-synthesis: none  → جلوگیری از «بولد مصنوعی» زشت؛ مرورگر موظف است
   از وزن واقعی فونت استفاده کند.
   -------------------------------------------------------------------------- */
:root {
    --mosian-font: 'YekanBakh', 'YekanBakh Fallback', Tahoma, 'Segoe UI', sans-serif;
}

html,
body,
button,
input,
select,
textarea,
optgroup,
h1, h2, h3, h4, h5, h6,
.navbar_nav,
.navbar_nav a,
.dropdown-menu,
.dropdown-item,
.btn,
p, span, a, li, td, th, label, small, strong, b, div {
    font-family: var(--mosian-font) !important;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* اعداد فارسی/عربی هم با همین فونت و بدون تغییر جهت رندر شوند */
body {
    font-feature-settings: 'ss01' on, 'ss02' on;
    text-rendering: optimizeLegibility;
}

/* آیکون‌فونت‌ها نباید تحت تأثیر قاعدهٔ بالا قرار بگیرند */
[class^='icon-'],
[class*=' icon-'],
[class^='bi-'],
[class*=' bi-'],
[class^='fa-'],
[class*=' fa-'],
.fa, .fas, .far, .fab, .fal, .bi,
i {
    font-family: inherit;
}

.fa, .fas, .far, .fab, .fal,
[class^='fa-'], [class*=' fa-'] {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome !important;
}

.bi,
[class^='bi-'], [class*=' bi-'] {
    font-family: 'bootstrap-icons' !important;
}

[class^='icon-'], [class*=' icon-'] {
    font-family: 'icomoon' !important;
}
