/*
 * Reading preferences.
 * --sk-font-ui       brand face (Kalameh). Shop and purchase buttons.
 * --sk-font-reading  the face the student chose.
 * --sk-font-scale    multiplies reading sizes, the header, and the footer.
 * Spacing stays on the root rem so the 60px bar and cards do not reflow.
 */

body {
	font-family: var(--sk-font-reading, IRANSans), Tahoma, "Segoe UI", sans-serif;
	font-size: calc(16px * var(--sk-font-scale, 1));
	line-height: 1.85;
}

/* Brand chrome keeps a stable face and size. The site header overrides this below. */
header,
header a,
#sidebar,
.sk-slide,
.sk-slide__title,
.sk-stat__num,
.sk-course-card,
.home-products-section,
.free-product-card,
.ctk,
button,
input,
select,
textarea,
.sk-cta,
.sk-badge,
.sk-tag {
	font-family: var(--sk-font-ui, Kalameh), Tahoma, "Segoe UI", sans-serif;
}

header,
#sidebar,
.sk-slide,
.sk-course-card,
.home-products-section,
.free-product-card,
.ctk {
	font-size: 16px;
}

/*
 * Site header, its mega panels, the account menu, and the mobile drawer.
 * The bar is a fixed 60px; only the type follows the preference.
 * Buttons and links inside it must beat the brand `button` rule above.
 */
.milad-site-header,
.milad-drawer {
	font-family: var(--sk-font-reading, IRANSans), Tahoma, "Segoe UI", sans-serif;
	font-size: calc(16px * var(--sk-font-scale, 1));
}

.milad-site-header :is(a, button),
.milad-drawer :is(a, button),
.milad-user-menu,
.milad-user-menu :is(a, button) {
	font-family: inherit;
}

.milad-user-menu > button {
	font-size: calc(0.92rem * var(--sk-font-scale, 1));
}

.milad-user-menu a,
.milad-site-header a[data-open-login] {
	font-size: calc(0.875rem * var(--sk-font-scale, 1));
}

/* Footer columns, brand copy, links, and the copyright line. */
.site-footer,
.site-footer :is(a, button, address) {
	font-family: var(--sk-font-reading, IRANSans), Tahoma, "Segoe UI", sans-serif;
}

.site-footer {
	font-size: calc(16px * var(--sk-font-scale, 1));
}

.site-footer .text-2xl {
	font-size: calc(1.5rem * var(--sk-font-scale, 1));
}

.site-footer .text-sm {
	font-size: calc(0.875rem * var(--sk-font-scale, 1));
}

.site-footer .text-xs {
	font-size: calc(0.75rem * var(--sk-font-scale, 1));
}

/* Long-form reading: lessons, articles, comments, legal text, encyclopedia. */
.ska,
.entry-content,
.content-section,
.comments-wrapper,
.pp,
.ency-body,
.sk-reading {
	font-family: var(--sk-font-reading, IRANSans), Tahoma, "Segoe UI", sans-serif;
	line-height: 2;
}

.ska,
.entry-content,
.content-section,
.comments-wrapper,
.pp,
.ency-body,
.sk-reading {
	font-size: calc(1.0625rem * var(--sk-font-scale, 1));
}

/* Dashboard prose follows the preference; the sidebar is brand chrome. */
body.page-template-page-dashboard main {
	font-family: var(--sk-font-reading, IRANSans), Tahoma, "Segoe UI", sans-serif;
	font-size: calc(1rem * var(--sk-font-scale, 1));
	line-height: 1.9;
}

/* Chemical symbols and Latin names stay out of the Persian face. */
.ska .ska-m,
.ska .ska-num,
.ska .ska-eq,
.ency-body .lesson-formula {
	font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", var(--sk-font-reading, IRANSans), Tahoma, serif;
}

.ska .ska-chem,
.ska .ska-latin {
	font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

/*
 * Body paragraphs on single posts.
 * The article root is right-aligned, so lines end in a ragged left edge.
 * Justify the measure. The last line stays at the start (right in RTL),
 * so a one-line label does not stretch.
 */
body.single :is(
	.ska,
	.ency-body,
	.scientist-body,
	.entry-content,
	.content-section,
	.prose,
	.content,
	.sk-prose,
	.sc-file-hero__desc,
	.sc-comment__body
) p {
	text-align: justify;
	text-align-last: start;
	text-justify: inter-word;
}

body.single :is(
	.ska-list,
	.ency-body,
	.scientist-body,
	.entry-content,
	.content-section,
	.prose,
	.content,
	.sk-prose,
	.sc-file-hero__desc,
	.sc-comment__body
) li {
	text-align: justify;
	text-align-last: start;
	text-justify: inter-word;
}

/* Formulas, stamps, and blocks designed as centered stay centered. */
body.single .ska p.ska-eq__expr,
body.single .ska p.ska-eq__cap,
body.single .ska p.ska-rx__note,
body.single .ska p.ska-lesson-atom__note,
body.single .ska-fact__verdict p,
body.single .ska-recall__head p,
body.single p.text-center {
	text-align: center;
	text-align-last: center;
}

body.single .ska p.ska-sci-id__full {
	text-align: right;
	text-align-last: right;
}

body.single p.text-left {
	text-align: left;
	text-align-last: left;
}

/* Descriptions stored as plain text, without a wrapping <p>. */
body.single :is(.sk-prose, .sc-file-hero__desc) {
	text-align: justify;
	text-align-last: start;
	text-justify: inter-word;
}

body.single :is(.sk-prose, .sc-file-hero__desc) :is(h1, h2, h3, h4) {
	text-align: start;
	text-align-last: start;
}
