/**
 * أنماط قسم الإحصائيات في الثيم الابن.
 *
 * يُحمَّل في الصفحة الرئيسية فقط عند تفعيل القسم (انظر association_child_enqueue_block_assets في functions.php).
 */

/* ==========================================================================
   قسم الإحصائيات: بطاقة بيضاء فيها 4 إحصائيات بينها فواصل
   القالب: template-parts/home/home-stats.php
   ========================================================================== */

.child-stats-section {
	--child-stats-accent: var(--theme-secondary, #ca9c5e);
	--child-stats-dark: var(--theme-primary, #1a4261);
	--child-stats-dark-rgb: var(--theme-primary-rgb, 26, 66, 97);

	position: relative;
	z-index: 3;
	background: #ffffff;
}

.child-stats-header {
	display: flex;
	justify-content: flex-start;
	margin-bottom: clamp(24px, 3.5vw, 40px);
	text-align: start;
}

.child-stats-title {
	margin: 0;
	color: var(--theme-heading, #111827);
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
	font-weight: 800;
}

.child-stats-title::after {
	content: '';
	display: block;
	width: 60px;
	height: 6px;
	margin-top: 10px;
	border-radius: 999px;
	background: var(--child-stats-accent);
}

.child-stats-title__accent {
	color: var(--child-stats-accent);
}

/* البطاقة: أعمدة متساوية بعدد الإحصائيات (4 كحد أقصى) */
.child-stats-card {
	display: grid;
	grid-template-columns: repeat(var(--child-stats-count, 4), minmax(0, 1fr));
	margin: 0;
	padding: clamp(22px, 3vw, 34px) 0;
	list-style: none;
	border: 1px solid rgba(var(--child-stats-dark-rgb), 0.08);
	border-radius: 20px;
	background: #ffffff;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.child-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 16px;
	text-align: center;
}

/* فاصل رأسي خفيف بين الإحصائيات */
.child-stat + .child-stat {
	border-inline-start: 1px solid rgba(var(--child-stats-dark-rgb), 0.1);
}

.child-stat__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: 4px;
	color: var(--child-stats-accent);
}

.child-stat__icon svg {
	width: 38px;
	height: 38px;
}

/* أيقونة مرفوعة كصورة: تُلوَّن باللون الثانوي عبر القناع */
.child-stat__icon-mask {
	display: block;
	width: 40px;
	height: 40px;
	background-color: currentColor;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.child-stat__number {
	color: var(--child-stats-dark);
	font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem);
	font-weight: 800;
	line-height: 1.2;
}

.child-stat__title {
	color: var(--child-stats-accent);
	font-size: 0.95rem;
	font-weight: 700;
}

/*
 * حين يأتي القسم مباشرة بعد السلايدر: ترتفع البطاقة فوق أسفل الصورة (كما في التصميم المرجعي)،
 * ويُخفى العنوان لأن البطاقة تكمل السلايدر ولا تبدأ قسماً جديداً.
 */
.child-hero + .child-stats-section {
	padding-top: 0;
	background: transparent;
}

.child-hero + .child-stats-section .child-stats-header {
	display: none;
}

.child-hero + .child-stats-section .child-stats-card {
	margin-top: clamp(-90px, -7vw, -50px);
}

/* الشاشات الضيقة: عمودان، والفواصل بين كل زوج وبين الصفين */
@media (max-width: 768px) {
	.child-stats-card {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding: 8px 0;
	}

	.child-stat {
		padding: 18px 12px;
	}

	.child-stat + .child-stat {
		border-inline-start: 0;
	}

	.child-stat:nth-child(even) {
		border-inline-start: 1px solid rgba(var(--child-stats-dark-rgb), 0.1);
	}

	.child-stat:nth-child(n + 3) {
		border-top: 1px solid rgba(var(--child-stats-dark-rgb), 0.1);
	}

	.child-hero + .child-stats-section .child-stats-card {
		margin-top: 0;
	}
}
