/**
 * PersiaCopy Base Styles — reset, typography, accessibility
 *
 * @package PersiaCopy
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--weight-normal);
	line-height: var(--leading-normal);
	color: var(--color-text);
	background-color: var(--color-bg);
	direction: rtl;
	text-align: right;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ── Typography hierarchy ── */

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
	font-family: var(--font-display);
	font-weight: var(--weight-bold);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-tight);
	color: var(--color-text);
	margin-block: 0 var(--space-4);
}

h1,
.h1 {
	font-size: var(--text-4xl);
}

h2,
.h2 {
	font-size: var(--text-3xl);
}

h3,
.h3 {
	font-size: var(--text-2xl);
}

h4,
.h4 {
	font-size: var(--text-xl);
}

h5,
.h5 {
	font-size: var(--text-lg);
}

h6,
.h6 {
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
}

p {
	margin-block: 0 0 var(--space-4);
}

.text-muted {
	color: var(--color-muted) !important;
}

.text-small {
	font-size: var(--text-sm);
}

.text-lead {
	font-size: var(--text-lg);
	line-height: var(--leading-relaxed);
	color: var(--color-text-secondary);
}

.section-title {
	margin: 0 0 var(--space-6);
	font-size: var(--text-3xl);
	font-weight: var(--weight-bold);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-tight);
}

.section-subtitle {
	margin: calc(var(--space-2) * -1) 0 var(--space-8);
	font-size: var(--text-lg);
	color: var(--color-muted);
	max-width: 38rem;
}

.page-title {
	font-size: var(--text-3xl);
	margin-bottom: var(--space-6);
}

/* ── Links ── */

a {
	color: var(--color-link);
	text-decoration: none;
	transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
	color: var(--color-link-hover);
	text-decoration: none;
}

a:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
	border-radius: var(--radius-sm);
}

/* ── Media ── */

img,
svg,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

figure {
	margin: 0;
}

/* ── Lists ── */

ul,
ol {
	padding-inline-start: var(--space-6);
	margin-block: 0 0 var(--space-4);
}

/* ── Focus & accessibility ── */

:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}

.skip-link {
	position: absolute;
	inset-inline-start: var(--space-4);
	top: -100%;
	z-index: calc(var(--z-modal) + 1);
	padding: var(--space-2) var(--space-4);
	background: var(--color-primary);
	color: var(--color-inverse);
	border-radius: var(--radius-md);
	font-weight: var(--weight-medium);
	font-size: var(--text-sm);
	transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
	top: var(--space-4);
	box-shadow: var(--shadow-lg);
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px) !important;
	clip-path: inset(50%);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	white-space: nowrap;
}

/* ── Layout ── */

.container {
	width: min(100% - var(--space-8), var(--container-max));
	margin-inline: auto;
}

.container--narrow {
	width: min(100% - var(--space-8), var(--container-narrow));
	margin-inline: auto;
}

.site-main {
	padding-block: var(--space-10);
}

.home-section {
	padding-block: var(--space-12);
}

.home-section:nth-child(even) {
	background-color: var(--color-bg-alt);
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
