/**
 * قسم الإحصائيات في ثيم هدي (template-parts/home/home-stats.php): شريط أخضر الحبر بكتاب الشعار خافتاً في زاويته،
 * والأرقام بتدرّج ذهبي «هدي»، وبين الأعمدة خطوط ذهبية رفيعة تتلاشى.
 */

.hd-stats {
	overflow: hidden;
	background: linear-gradient(160deg, var(--hd-ink-soft), var(--hd-ink));
	color: #ffffff;
}

/* كتاب الشعار خافتاً في الزاوية السفلية */
.hd-stats::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--hd-gold-grad);
	opacity: 0.1;
	-webkit-mask: var(--hd-flow) left -140px bottom -90px / 620px auto no-repeat;
	mask: var(--hd-flow) left -140px bottom -90px / 620px auto no-repeat;
	pointer-events: none;
}

/* ==========================================================================
   1) الأعمدة: بلا فراغ بينها فتتصل مسطرة الصف، وعرض محدود حين تقلّ الإحصائيات
   ========================================================================== */

.hd-stats__list {
	--hd-stats-cols: 4;
	display: grid;
	grid-template-columns: repeat(var(--hd-stats-cols), minmax(0, 1fr));
	gap: 46px 0;
	max-width: calc(var(--hd-stats-cols) * 280px);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.hd-stats__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
	padding: 12px 14px 0;
	text-align: center;
}

/* خط ذهبي رفيع يتلاشى بين الأعمدة (على بداية كل إحصائية عدا الأولى) */
.hd-stats__item + .hd-stats__item::before {
	content: '';
	position: absolute;
	top: 30px;
	right: 0;
	bottom: 10px;
	width: 1px;
	background: linear-gradient(transparent, rgba(var(--hd-gold-rgb), 0.55), transparent);
	pointer-events: none;
}

/* ==========================================================================
   2) الإحصائية: الأيقونة، ثم الرقم بتدرّج ذهبي الشعار، وجرّة القلم، والاسم
   ========================================================================== */

.hd-stats__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border: 1px solid rgba(var(--hd-gold-rgb), 0.5);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.04);
	color: var(--hd-gold-light);
}

.hd-stats__mask {
	display: block;
	width: 26px;
	height: 26px;
	background: currentColor;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.hd-stats__svg {
	width: 28px;
	height: 28px;
}

.hd-stats__number {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	max-width: 100%;
	margin-top: 14px;
	color: var(--hd-gold-light);
	background: var(--hd-gold-grad);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	font-family: var(--hd-display);
	font-size: clamp(2.3rem, 1.7rem + 1.7vw, 3.3rem);
	font-weight: 800;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.hd-stats__plus {
	font-size: 0.6em;
}

/* رقم كُتب نصاً: أصغر قليلاً */
.hd-stats__number--text {
	font-size: clamp(1.6rem, 1.3rem + 0.8vw, 2.1rem);
}

.hd-stats__stroke {
	width: 74px;
	margin: 6px 12px 0 0;
	color: var(--hd-gold);
}

.hd-stats__title {
	margin-top: 10px;
	color: #ffffff;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.6;
}

/* ==========================================================================
   3) الأجهزة اللوحية والجوال
   ========================================================================== */

@media (max-width: 1024px) {
	/* عمودان: لا خط على بداية الصف */
	.hd-stats__item:nth-child(odd)::before {
		display: none;
	}

	.hd-stats__list {
		grid-template-columns: repeat(var(--hd-stats-cols-md, 2), minmax(0, 1fr));
		max-width: calc(var(--hd-stats-cols-md, 2) * 300px);
	}
}

@media (max-width: 640px) {
	.hd-stats__list {
		grid-template-columns: repeat(var(--hd-stats-cols-sm, 2), minmax(0, 1fr));
		max-width: none;
		row-gap: 38px;
	}

	.hd-stats__item {
		padding: 8px 8px 0;
	}

	.hd-stats__icon {
		width: 46px;
		height: 46px;
	}

	.hd-stats__mask {
		width: 22px;
		height: 22px;
	}

	.hd-stats__svg {
		width: 24px;
		height: 24px;
	}

	.hd-stats__number {
		font-size: 2rem;
	}

	.hd-stats__number--text {
		font-size: 1.4rem;
	}

	.hd-stats__title {
		font-size: 0.92rem;
	}
}

/* المرور: الدائرة ذهبية ممتلئة */
.hd-stats__icon {
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.hd-stats__item:hover .hd-stats__icon {
	border-color: var(--hd-gold);
	background: var(--hd-gold);
	color: var(--hd-ink);
}

@media (prefers-reduced-motion: reduce) {
	.hd-stats__icon {
		transition: none;
	}
}
