/*
 * أنماط الصفحة الرئيسية فقط. تُحمَّل حصرًا هناك (inc/home.php). كل الألوان
 * عبر متغيّرات CSS من theme.json — لا hex مباشر هنا (عدا ما استُنسخ من
 * elm.css لنفس السبب هناك).
 */

/* --- إيقاع عام بين الأقسام --- */
.elm-home-section {
	margin-block: 2.5rem;
}

/* --- 1) البطل --- */
.elm-hero-guest {
	background: var( --wp--preset--color--sunk );
	border-radius: 0.75rem;
	padding: 2rem;
}

.elm-hero-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2rem;
}

.elm-hero-text {
	flex: 1 1 320px;
	max-width: 55%;
}

.elm-hero-image {
	flex: 1 1 260px;
	max-width: 45%;
}

.elm-hero-image img {
	width: 100%;
	height: auto;
	border-radius: 0.75rem;
	display: block;
}

/* الرسم فاتح الخلفية: يُخفَّف قليلًا في الوضع الليلي حتى لا يبهر العين. */
:root[data-theme="dark"] .elm-hero-image img {
	filter: brightness( 0.85 );
}

@media ( max-width: 782px ) {
	.elm-hero-text,
	.elm-hero-image {
		max-width: 100%;
	}
}

.elm-hero-member {
	background: var( --wp--preset--color--sunk );
	border-radius: 0.75rem;
	padding: 2rem;
}

.elm-hero-title {
	margin-block-start: 0;
}

.elm-hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-block-start: 1rem;
}

.elm-hero-btn {
	display: inline-block;
	border-radius: 999px;
	padding: 0.7rem 1.5rem;
	text-decoration: none;
	background: var( --wp--preset--color--accent );
	color: var( --wp--preset--color--surface );
	font-weight: 600;
}

.elm-hero-btn--secondary {
	background: transparent;
	color: var( --wp--preset--color--accent );
	border: 1px solid var( --wp--preset--color--accent );
}

/* --- 2) اختر صفّك --- */
.elm-grade-picker {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 1.5rem;
}

@media ( max-width: 782px ) {
	.elm-grade-picker {
		grid-template-columns: 1fr;
	}
}

.elm-grade-picker-group {
	background: var( --wp--preset--color--surface );
	border: 1px solid var( --wp--preset--color--line );
	border-radius: 0.75rem;
	padding: 1.25rem;
}

.elm-grade-picker-group h3 {
	margin-block-start: 0;
	text-align: center;
}

.elm-grade-picker-buttons {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 0.6rem;
}

.elm-grade-btn {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	background: var( --wp--preset--color--sunk );
	border: 2px solid transparent;
	border-radius: 0.6rem;
	padding: 0.9rem 0.4rem;
	text-decoration: none;
	color: var( --wp--preset--color--contrast );
}

.elm-grade-btn-num {
	font-family: var( --wp--preset--font-family--headings );
	font-size: 1.5rem;
	font-weight: 700;
}

.elm-grade-btn-name {
	font-size: 0.75rem;
	color: var( --wp--preset--color--muted );
	text-align: center;
}

.elm-grade-btn.is-visited {
	border-color: var( --wp--preset--color--accent );
}

.elm-grade-btn-badge {
	position: absolute;
	top: -0.5rem;
	inset-inline-end: -0.3rem;
	background: var( --wp--preset--color--accent );
	color: var( --wp--preset--color--surface );
	font-size: 0.65rem;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	display: none;
}

.elm-grade-btn.is-visited .elm-grade-btn-badge {
	display: inline-block;
}

/* --- 3) لماذا 3elm --- */
.elm-why-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 1.5rem;
}

@media ( max-width: 782px ) {
	.elm-why-grid {
		grid-template-columns: 1fr;
	}
}

.elm-why-card {
	text-align: center;
	padding: 1.5rem 1rem;
}

.elm-why-card .elm-icon-svg {
	width: 2.5rem;
	height: 2.5rem;
	color: var( --wp--preset--color--accent );
}

.elm-why-card h3 {
	margin-block: 0.75rem 0.4rem;
}

.elm-why-card p {
	color: var( --wp--preset--color--muted );
	margin: 0;
}

/* --- 4) تصفّح بالمادة: تُعاد استخدام .elm-subject-grid/.elm-subject-card من elm.css --- */

/* --- 5) محاكاة مميّزة --- */
.elm-home-sim {
	max-width: 760px;
	margin-inline: auto;
}

.elm-home-sim-title {
	text-align: center;
	color: var( --wp--preset--color--muted );
	margin-block-start: 0.75rem;
}

.elm-home-sim-heading {
	text-align: center;
}

/* --- 6) أحدث ما نُشر --- */
.elm-latest-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 1rem;
}

@media ( max-width: 1024px ) {
	.elm-latest-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 640px ) {
	.elm-latest-grid {
		grid-template-columns: 1fr;
	}
}

.elm-latest-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	background: var( --wp--preset--color--surface );
	border: 1px solid var( --wp--preset--color--line );
	border-radius: 0.6rem;
	padding: 1.1rem 1rem 0.9rem;
	text-decoration: none;
	color: var( --wp--preset--color--contrast );
	overflow: hidden;
}

.elm-latest-card-bar {
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 4px;
	background: var( --elm-subject-color, var( --wp--preset--color--accent ) );
}

.elm-latest-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: var( --wp--preset--color--muted );
}

.elm-latest-card-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.elm-latest-card-badge .elm-icon-svg {
	width: 1rem;
	height: 1rem;
	color: var( --elm-subject-color, var( --wp--preset--color--accent ) );
}

.elm-latest-card-title {
	font-weight: 600;
	font-family: var( --wp--preset--font-family--headings );
}

/* --- 7) للمعلم --- */
.elm-teacher-banner {
	background: var( --wp--preset--color--sunk );
	border-radius: 0.75rem;
	padding: 2rem;
}

.elm-teacher-points {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 1rem;
	list-style: none;
	margin: 1.25rem 0;
	padding: 0;
}

@media ( max-width: 782px ) {
	.elm-teacher-points {
		grid-template-columns: repeat( 2, 1fr );
	}
}

.elm-teacher-points li {
	background: var( --wp--preset--color--surface );
	border-radius: 0.5rem;
	padding: 0.75rem 1rem;
	text-align: center;
	font-size: 0.9rem;
}

/* --- 8) كيف يعمل الموقع --- */
.elm-steps {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 1.5rem;
}

@media ( max-width: 782px ) {
	.elm-steps {
		grid-template-columns: 1fr;
	}
}

.elm-step {
	text-align: center;
	padding: 1rem;
}

.elm-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var( --wp--preset--color--accent );
	color: var( --wp--preset--color--surface );
	font-family: var( --wp--preset--font-family--headings );
	font-weight: 700;
	margin-block-end: 0.75rem;
}

/* --- 9) أنشئ حسابك --- */
.elm-signup-cta {
	text-align: center;
}
