/*
 * Base: fonts, the page itself, headings, links, focus, the container and a few helpers.
 * Only logical properties (inline/block, start/end) so one file serves right-to-left and left-to-right,
 * and only token variables (see tokens.css) for color, spacing, radius and type.
 */

@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "STIX Two Text";
	src: url("../fonts/StixTwoText-Variable-latin.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "STIX Two Text";
	src: url("../fonts/StixTwoText-Italic-Variable-latin.woff2") format("woff2");
	font-weight: 400 700;
	font-style: italic;
	font-display: swap;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-block-start: calc(var(--header-height) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--surface-100);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: var(--text-body-size);
	line-height: var(--text-body-line);
	font-weight: var(--text-body-weight);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

/* Persian letters join, so letters are never spaced apart. */
:lang(fa) * {
	letter-spacing: 0 !important;
}

h1,
h2,
h3,
h4 {
	margin-block: 0 var(--space-3);
	color: var(--ink);
	text-wrap: balance;
}

h1 {
	font-size: var(--text-h1-size);
	line-height: var(--text-h1-line);
	font-weight: var(--text-h1-weight);
}

h2 {
	font-size: var(--text-h2-size);
	line-height: var(--text-h2-line);
	font-weight: var(--text-h2-weight);
}

h3 {
	font-size: var(--text-h3-size);
	line-height: var(--text-h3-line);
	font-weight: var(--text-h3-weight);
}

h4 {
	font-size: var(--text-h4-size);
	line-height: var(--text-h4-line);
	font-weight: var(--text-h4-weight);
}

p {
	margin-block: 0 var(--space-4);
	text-wrap: pretty;
}

a {
	color: var(--brand);
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--brand-hover);
}

img,
svg,
video {
	max-inline-size: 100%;
	block-size: auto;
}

/* Keyboard focus is always visible and never removed. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

::selection {
	background: var(--brand-tint);
	color: var(--ink);
}

/* The container every page uses. */
.mt-wrap {
	inline-size: 100%;
	max-inline-size: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--space-6);
}

@media (max-width: 560px) {
	.mt-wrap {
		padding-inline: var(--space-4);
	}
}

/* Text for screen readers only, and the skip link that appears on focus. */
.screen-reader-text {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	inline-size: auto;
	block-size: auto;
	margin: 0;
	clip-path: none;
	position: fixed;
	inset-block-start: var(--space-2);
	inset-inline-start: var(--space-2);
	z-index: var(--z-modal);
	padding: var(--space-3) var(--space-4);
	background: var(--surface-200);
	color: var(--ink);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-pop);
}

/* Digits line up in columns (prices, tables). */
.mt-num {
	font-variant-numeric: tabular-nums;
}

/* Phone numbers, e-mail addresses and codes stay left to right inside right-to-left text. */
.mt-ltr {
	direction: ltr;
	unicode-bidi: isolate;
	text-align: start;
}

.mt-math {
	font-family: var(--font-math);
	font-style: italic;
	font-size: var(--text-math-inline-size);
	direction: ltr;
	unicode-bidi: isolate;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
