/* Global styles */

html[lang^="ar"] {
	--font-family-base: var(--font-family-ar);
	--font-family-heading: var(--font-family-ar);
}

html[lang^="en"] {
	--font-family-base: var(--font-family-en);
	--font-family-heading: var(--font-family-en);
}

body {
	font-family: var(--font-family-base);
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-normal);
	line-height: var(--line-height-base);
	color: var(--color-text);
	background-color: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-family-heading);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	letter-spacing: var(--letter-spacing-tight);
	color: var(--color-brand-900);
}

h1 {
	font-size: var(--font-size-3xl);
}

h2 {
	font-size: var(--font-size-2xl);
}

h3 {
	font-size: var(--font-size-xl);
}

h4 {
	font-size: var(--font-size-lg);
}

h5 {
	font-size: var(--font-size-md);
}

h6 {
	font-size: var(--font-size-base);
}

button,
input,
select,
textarea {
	font-family: inherit;
}

p {
	margin-bottom: var(--space-md);
}

p:last-child {
	margin-bottom: 0;
}

a {
	color: var(--color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	transition: color var(--transition-fast);
}

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

img {
	border-radius: var(--radius-sm);
}

/* Focus states */
:focus-visible {
	outline: 2px solid var(--color-accent-500);
	outline-offset: 2px;
}

/* Accessibility helpers */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

/* Page spacing */
.page-content,
.entry__content {
	max-width: var(--content-max-width);
}

.entry__content > * + * {
	margin-top: var(--space-md);
}

.entry__content h2,
.entry__content h3,
.entry__content h4 {
	margin-top: var(--space-xl);
	margin-bottom: var(--space-sm);
}

.entry__content ul,
.entry__content ol {
	margin-bottom: var(--space-md);
	padding-left: var(--space-xl);
	list-style: disc;
}

.entry__content ol {
	list-style: decimal;
}

.entry__content li + li {
	margin-top: var(--space-xs);
}

.entry__content blockquote {
	margin-block: var(--space-lg);
	padding: var(--space-md) var(--space-lg);
	border-left: 4px solid var(--color-accent-500);
	background-color: var(--color-surface-muted);
}

/* Search form */
.search-form {
	display: flex;
	gap: var(--space-sm);
	max-width: 28rem;
}

.search-form label {
	flex: 1;
	margin-bottom: 0;
}

.search-form input[type="search"] {
	flex: 1;
}

/* Error page */
.error-404 .page-content {
	margin-top: var(--space-lg);
}
