/* Reset, typography and base elements. */

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Components set display:flex/grid; make the hidden attribute always win. */
[hidden] {
	display: none !important;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--md-bg-page);
	color: var(--md-text-primary);
	font-family: var(--md-font-ar);
	font-size: var(--md-fs-body);
	font-weight: 400;
	line-height: var(--md-lh-body);
	direction: rtl;
	text-align: right;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s var(--md-ease), opacity 0.2s var(--md-ease);
}

a:hover {
	color: var(--md-text-brand);
}

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--md-text-primary);
	font-family: var(--md-font-ar);
	text-wrap: balance;
}

h1 { font-size: var(--md-fs-h1); font-weight: 600; line-height: var(--md-lh-heading); }
h2 { font-size: var(--md-fs-h2); font-weight: 600; line-height: var(--md-lh-heading); }
h3 { font-size: var(--md-fs-h3); font-weight: 600; line-height: var(--md-lh-h3); }
h4, h5, h6 { font-size: var(--md-fs-h4); font-weight: 600; line-height: var(--md-lh-h4); }

p {
	margin: 0;
	text-wrap: pretty;
}

ul,
ol {
	margin: 0;
	padding: 0;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

::selection {
	background: var(--md-blue-500);
	color: var(--md-white);
}

:focus-visible {
	outline: 2px solid var(--md-border-strong);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 12px;
	inset-inline-start: 12px;
	z-index: 1000;
	width: auto;
	height: auto;
	clip: auto;
	padding: 12px 20px;
	background: var(--md-bg-surface);
	color: var(--md-text-brand);
}

/* Type utilities (match Figma text styles) */
.md-display { font-size: var(--md-fs-display); font-weight: 600; line-height: var(--md-lh-display); }
.md-h1 { font-size: var(--md-fs-h1); font-weight: 600; line-height: var(--md-lh-heading); }
.md-h2 { font-size: var(--md-fs-h2); font-weight: 600; line-height: var(--md-lh-heading); }
.md-h3 { font-size: var(--md-fs-h3); font-weight: 600; line-height: var(--md-lh-h3); }
.md-h4 { font-size: var(--md-fs-h4); font-weight: 600; line-height: var(--md-lh-h4); }
.md-body-lg { font-size: var(--md-fs-body-lg); line-height: var(--md-lh-body); }
.md-small { font-size: var(--md-fs-small); font-weight: 400; line-height: 1.7; }
.md-muted { color: var(--md-text-secondary); }
.md-ltr { direction: ltr; unicode-bidi: isolate; }

/* Eyebrow (Figma «Eyebrow»): 3px yellow rule at the start (right), then the label. */
.md-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--md-text-brand);
	font-size: var(--md-fs-label);
	font-weight: 500;
	line-height: 1.7;
}

.md-eyebrow::before {
	content: "";
	flex: none;
	width: 36px;
	height: 3px;
	background: var(--md-border-accent);
}

/* Prose (blog posts, default pages) */
.md-prose {
	font-size: var(--md-fs-body-lg);
	line-height: var(--md-lh-body);
}

.md-prose > * + * {
	margin-top: 1.5em;
}

.md-prose h2,
.md-prose h3 {
	margin-top: 2em;
	font-size: var(--md-fs-h3);
	font-weight: 500;
}

.md-prose h4 {
	margin-top: 1.6em;
}

.md-prose p,
.md-prose li {
	color: var(--md-text-primary);
}

.md-prose a {
	color: var(--md-text-brand);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.md-prose ul,
.md-prose ol {
	padding-inline-start: 1.4em;
}

.md-prose ul li::marker {
	color: var(--md-text-brand);
}

.md-prose li + li {
	margin-top: 0.5em;
}

.md-prose blockquote {
	margin-inline: 0;
	padding: 4px 28px 4px 0;
	border-inline-start: 3px solid var(--md-border-strong);
	color: var(--md-text-brand);
	font-size: var(--md-fs-h4);
	font-weight: 500;
	line-height: var(--md-lh-h4);
}

.md-prose img,
.md-prose figure {
	margin-inline: 0;
	width: 100%;
}

.md-prose figcaption {
	margin-top: 8px;
	color: var(--md-text-secondary);
	font-size: var(--md-fs-small);
}

.md-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--md-fs-body);
}

.md-prose th,
.md-prose td {
	padding: 12px;
	border-bottom: 1px solid var(--md-border-default);
	text-align: right;
}
