/*
 * Modern CSS Reset
 * Based on modern-normalize principles with RTL support
 * Optimized for Farsi/Persian content
 */

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

/* Remove default margin and padding */
* {
	margin: 0;
	padding: 0;
}

/* Prevent font size inflation */
html {
	-moz-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
	list-style: none;
}

/* Set core root defaults */
html:focus-within {
	scroll-behavior: smooth;
}

/* Set core body defaults */
body {
	min-height: 100vh;
	text-rendering: optimizeSpeed;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
	text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
	font: inherit;
}

input[type="email"] {
	direction: ltr;
	text-align: left;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Remove button styles */
button {
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
}

/* Remove input styles */
input,
textarea {
	border: none;
	outline: none;
	background: transparent;
}

/* Remove link underline by default */
a {
	text-decoration: none;
	color: inherit;
}

/* Table reset */
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* RTL-specific resets */
[dir="rtl"] {
	direction: rtl;
	text-align: right;
}

[dir="ltr"] {
	direction: ltr;
	text-align: left;
}

/* Ensure proper text direction inheritance */
[dir="rtl"] * {
	text-align: inherit;
}

[dir="ltr"] * {
	text-align: inherit;
}

/* Form elements reset */
fieldset {
	border: none;
	padding: 0;
	margin: 0;
}

legend {
	padding: 0;
}

/* Remove default styles from headings */
h1, h2, h3, h4, h5, h6 {
	font-size: inherit;
	font-weight: inherit;
	margin: 0;
}

/* Remove default styles from paragraphs */
p {
	margin: 0;
}

/* Remove default styles from lists */
ul, ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Remove default styles from blockquote */
blockquote {
	margin: 0;
	padding: 0;
}

/* Remove default styles from pre */
pre {
	margin: 0;
	overflow: auto;
}

/* Remove default styles from code */
code,
kbd,
samp {
	font-family: monospace;
	font-size: 1em;
}

/* Accessibility: Ensure focus is visible */
:focus-visible {
	outline: 1px solid lch(from currentColor l c h / 0.2);
	outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
	outline: none;
}

/* Ensure hidden elements stay hidden */
[hidden] {
	display: none !important;
}

/* Print styles */
@media print {
	*,
	*::before,
	*::after {
		background: transparent !important;
		color: #000 !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}

	a,
	a:visited {
		text-decoration: underline;
	}

	pre,
	blockquote {
		border: 1px solid #999;
		page-break-inside: avoid;
	}

	thead {
		display: table-header-group;
	}

	tr,
	img {
		page-break-inside: avoid;
	}

	img {
		max-width: 100% !important;
	}

	p,
	h2,
	h3 {
		orphans: 3;
		widows: 3;
	}

	h2,
	h3 {
		page-break-after: avoid;
	}
}

div[class*="wp-block"] {
	margin: 0;
	padding: 0;
}

.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: 100%;
}

:root :where(.wp-block-group-is-layout-constrained) > * {
    margin-block-start: 0;
    margin-block-end: 0;
}