/**
 * فونت فارسی سلف‌هاستد — ایران‌یکان (تسک ۴۰).
 *
 * نکات مهم برای خوانایی:
 * - Metronic زیاد از font-weight: 600 (semibold) استفاده می‌کند؛
 *   ایران‌یکان وزن ۶۰۰ ندارد → بدون این alias مرورگر «بولدمصنوعی»
 *   می‌سازد و متن تار/چشم‌آزار می‌شود.
 * - font-display: fallback جلوی پرش طولانی به فونت سیستم را می‌گیرد.
 * - button/input به‌صورت پیش‌فرض فونت سیستم دارند؛ باید inherit شوند.
 */

@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebLight.woff2') format('woff2'),
    url('/fonts/IRANYekanWebLight.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebRegular.woff2') format('woff2'),
    url('/fonts/IRANYekanWebRegular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebMedium.woff2') format('woff2'),
    url('/fonts/IRANYekanWebMedium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: fallback;
}

/* alias برای semibold مترونیک — همان فایل Medium، بدون سنتز */
@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebMedium.woff2') format('woff2'),
    url('/fonts/IRANYekanWebMedium.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebBold.woff2') format('woff2'),
    url('/fonts/IRANYekanWebBold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: fallback;
}

/* وزن‌های سنگین‌تر هم به Bold مپ می‌شوند تا سنتز نشود */
@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebBold.woff2') format('woff2'),
    url('/fonts/IRANYekanWebBold.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'IranYekan';
  src:
    url('/fonts/IRANYekanWebBold.woff2') format('woff2'),
    url('/fonts/IRANYekanWebBold.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: fallback;
}

:root,
:host {
  --font-sans: 'IranYekan', Tahoma, ui-sans-serif, system-ui, sans-serif;
  --default-font-family: var(--font-sans);
}

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: inherit;
  letter-spacing: 0;
  word-spacing: 0;
  line-height: 1.6;
}

/* کنترل‌های فرم و دکمه در بعضی مرورگرها فونت سیستم می‌گیرند */
button,
input,
select,
textarea,
optgroup,
::file-selector-button {
  font-family: inherit;
  letter-spacing: inherit;
}

/* اعداد لاتین داخل متن فارسی خواناتر بمانند */
.tabular-nums,
[dir='ltr'] {
  font-variant-numeric: tabular-nums;
}
