/*========================================
  RTL & Persian Digits for JNews (Final)
  Author: Mhdi/ChatGPT — Optimized & Fixed
========================================*/

/* --- Font faces (use ONE consistent family name) --- */


@font-face {
	font-family: IRANSans;
	font-style: normal;
	font-weight: normal;
	src: url('fonts/eot/IRANSansWeb.eot?#iefix') format('embedded-opentype'),  /* IE6-8 */
		 url('fonts/woff2/IRANSansWeb.woff2') format('woff2'),  /* FF39+,Chrome36+, Opera24+*/
		 url('fonts/woff/IRANSansWeb.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
		 url('fonts/ttf/IRANSansWeb.ttf') format('truetype');
}


@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-Thin.woff2') format('woff2'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-ExtraLight.woff2') format('woff2'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url('fonts/vazirmatn/Vazirmatn-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* --- Global font application (minimal !important to override theme) --- */
html, body,
button, input, textarea, select,
div, p, a, span, th, tr,
h1, h2, h3, h4, h5, h6 {
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* --- Persian digits via OpenType localization when lang=fa is present --- */
html[lang="fa"], :lang(fa) {
  font-feature-settings: "locl" 1; /* use localized glyphs (Persian digits) */
}

/* Optional: force Persian digits on specific blocks without lang attr */
.fa-digits {
  font-feature-settings: "locl" 1;
}

/* --- Ordered lists using Persian numerals (fallback for older browsers) --- */
@counter-style persian-digits {
  system: numeric;
  symbols: '۰' '۱' '۲' '۳' '۴' '۵' '۶' '۷' '۸' '۹';
  suffix: ' ';
}
ol { list-style: persian-digits; }
ol li::marker { font-feature-settings: "locl" 1; }

/* --- Basic RTL helpers (safe for JNews) --- */
html[lang="fa"] body { direction: rtl; }
input, textarea { direction: rtl; }
