/* ==========================================================================
   Vazirmatn Persian Font Definitions (Local Webfonts)
   Weights: 100 (Thin), 300 (Light), 400 (Regular), 500 (Medium),
            600 (SemiBold), 700 (Bold), 800 (ExtraBold), 900 (Black)
   ========================================================================== */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Thin.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

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

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

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

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2'),
         url('../fonts/Vazirmatn-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2'),
         url('../fonts/Vazirmatn-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Backward compatibility alias for 'Vazir' */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazirmatn-Thin.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

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

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

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

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2'),
         url('../fonts/Vazirmatn-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2'),
         url('../fonts/Vazirmatn-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Persian Font Utilities & Selectors
   ========================================================================== */
:root {
    --ra-font-persian: 'Vazirmatn', 'Vazir', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Apply Vazirmatn to Persian documents and RTL content */
html[lang="fa"],
html[lang="fa"] body,
html[dir="rtl"],
html[dir="rtl"] body,
[lang="fa"],
:lang(fa),
[dir="rtl"],
body.rtl {
    font-family: 'Vazirmatn', 'Vazir', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Specific heading & UI overrides for Persian context */
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3,
html[lang="fa"] h4, html[lang="fa"] h5, html[lang="fa"] h6,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
html[lang="fa"] .panel__title,
html[lang="fa"] .site-header__title,
html[lang="fa"] .section-card__title,
html[lang="fa"] .nav-link,
[dir="rtl"] .panel__title,
[dir="rtl"] .site-header__title,
[dir="rtl"] .section-card__title,
[dir="rtl"] .nav-link {
    font-family: 'Vazirmatn', 'Vazir', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ensure FontAwesome icons and monospace elements keep their proper fonts */
[lang="fa"] .fa, [lang="fa"] .fas, [lang="fa"] .fab, [lang="fa"] .far, [lang="fa"] .fa-solid, [lang="fa"] .fa-brands, [lang="fa"] [class*="fa-"],
[dir="rtl"] .fa, [dir="rtl"] .fas, [dir="rtl"] .fab, [dir="rtl"] .far, [dir="rtl"] .fa-solid, [dir="rtl"] .fa-brands, [dir="rtl"] [class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands", "FontAwesome" !important;
}

[lang="fa"] code, [lang="fa"] pre, [lang="fa"] kbd, [lang="fa"] samp,
[dir="rtl"] code, [dir="rtl"] pre, [dir="rtl"] kbd, [dir="rtl"] samp {
    font-family: 'Courier New', 'Consolas', 'Fira Code', monospace;
}
