/**
 * Global typography — Iran Nastaliq (overridable via تنظیمات قالب → سفارشی‌سازی خلوت → فونت).
 */
@font-face {
	font-family: "IranNastaliq";
	src:
		url("../fonts/khalvat/IranNastaliq.woff2") format("woff2"),
		url("../fonts/khalvat/IranNastaliq.woff") format("woff"),
		url("../fonts/khalvat/IranNastaliq.ttf") format("truetype");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

:root {
	--irancast-font-family: "IranNastaliq", Tahoma, serif;
	--irancast-font-scale: 1.28;
	--irancast-font-size-base: calc(18px * var(--irancast-font-scale));
	--irancast-font-size-reading: calc(17px * var(--irancast-font-scale));
	--irancast-font-size-ui: calc(15px * var(--irancast-font-scale));
	--irancast-font-size-small: calc(13px * var(--irancast-font-scale));
	--irancast-font-size-title: calc(22px * var(--irancast-font-scale));
	--irancast-reading-line-height: 3.55;
	--irancast-reading-paragraph-gap: 1.65em;
}

html {
	font-size: calc(16px * var(--irancast-font-scale));
}

html body {
	font-family: var(--irancast-font-family) !important;
	font-size: var(--irancast-font-size-base) !important;
	line-height: 1.85;
}

html body textarea,
html body input,
html body button,
html body select,
html body option {
	font-family: var(--irancast-font-family) !important;
	font-size: var(--irancast-font-size-ui) !important;
}

/* Article / post reading */
html body .archive-page .single-content .body .sub-body,
html body .archive-page .single-content .body .sub-body p,
html body .archive-page .single-content .body .sub-body li,
html body .archive-page .single-content .body .sub-body blockquote,
html body .archive-page .single-content .body .sub-body figcaption,
html body .archive-page .single-content .body .sub-body td,
html body .archive-page .single-content .body .sub-body th {
	font-family: var(--irancast-font-family) !important;
	font-size: var(--irancast-font-size-reading) !important;
	line-height: var(--irancast-reading-line-height) !important;
}

html body .archive-page .single-content h1,
html body .archive-page .single-content .content-area h1 {
	font-family: var(--irancast-font-family) !important;
	font-size: var(--irancast-font-size-title) !important;
	line-height: 1.75 !important;
}

/* Q&A chat */
html body .khalvat-qa-chat,
html body .khalvat-qa-chat__bubble,
html body .khalvat-qa-chat__sender,
html body .khalvat-qa-chat__header-title,
html body .khalvat-qa-chat__header-subtitle {
	font-family: var(--irancast-font-family) !important;
	font-size: var(--irancast-font-size-ui) !important;
}

html body .khalvat-qa-chat__bubble {
	font-size: var(--irancast-font-size-reading) !important;
	line-height: 2.2 !important;
}

/* Header, footer, sidebar, menus */
html body .irancast-header,
html body .irancast-footer,
html body .footer-main,
html body .aside-title,
html body .blog-category-tree,
html body .archive-page .archive-side,
html body .start-guide,
html body .episode-card,
html body .woocommerce,
html body .woocommerce-page {
	font-family: var(--irancast-font-family) !important;
}

html body .irancast-header,
html body .irancast-header a,
html body .blog-category-tree a,
html body .archive-page .archive-side a,
html body .aside-title {
	font-size: var(--irancast-font-size-ui) !important;
}

html body .archive-page .archive-side .irancast-sidebar-search__input {
	font-size: var(--irancast-font-size-ui) !important;
}

/* Cards, lists, general UI text */
html body :where(
	p,
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	a,
	span,
	li,
	td,
	th,
	label,
	div,
	figcaption,
	blockquote,
	nav,
	header,
	footer,
	section,
	article,
	aside,
	main,
	time,
	small,
	strong,
	em,
	dt,
	dd
) {
	font-family: var(--irancast-font-family) !important;
}

html body h1 { font-size: calc(1.45rem * var(--irancast-font-scale)) !important; }
html body h2 { font-size: calc(1.3rem * var(--irancast-font-scale)) !important; }
html body h3 { font-size: calc(1.18rem * var(--irancast-font-scale)) !important; }
html body h4,
html body h5,
html body h6 { font-size: calc(1.05rem * var(--irancast-font-scale)) !important; }

html body small,
html body .small {
	font-size: var(--irancast-font-size-small) !important;
}

/* Keep icon / code fonts intact */
html body .fa,
html body .fas,
html body .far,
html body .fab,
html body .fal,
html body .fad,
html body [class*="fa-"],
html body .dashicons,
html body .mce-ico,
html body code,
html body pre,
html body kbd,
html body samp {
	font-family: inherit;
	font-size: inherit;
}

html body .fa::before,
html body .fas::before,
html body .far::before,
html body .fab::before,
html body .fal::before,
html body .fad::before,
html body [class*="fa-"]::before,
html body [class*="fa-"]::after {
	font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
}

html body .archive-page .single-content .body .sub-body p {
	margin-bottom: var(--irancast-reading-paragraph-gap);
}

@media (max-width: 768px) {
	:root {
		--irancast-font-scale: 1.18;
	}
}

@media (max-width: 480px) {
	:root {
		--irancast-font-scale: 1.12;
	}
}
