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

/* نقش المدرجات يمتد قليلاً خارج الحاوية، فلا يُحدث تمريراً أفقياً */
.tn-stats {
	overflow: hidden;
}

.tn-stats .tn-head {
	margin-bottom: 46px;
}

/* الحقل: يحمل نقش المدرجات خلف الشريط */
.tn-stats__field {
	position: relative;
	isolation: isolate;
	padding: 34px 0;
}

/* خطوط المدرجات المتموجة خضراء خافتة، تتلاشى نحو الأطراف */
.tn-stats__rows {
	position: absolute;
	inset: -24px -40px;
	z-index: -1;
	background: var(--tn-leaf-deep);
	opacity: 0.45;
	-webkit-mask: var(--tn-rows) center / var(--tn-rows-size), radial-gradient(ellipse 70% 80% at 50% 50%, #000 45%, transparent 85%);
	-webkit-mask-composite: source-in;
	mask: var(--tn-rows) center / var(--tn-rows-size), radial-gradient(ellipse 70% 80% at 50% 50%, #000 45%, transparent 85%);
	mask-composite: intersect;
	pointer-events: none;
}

/* الشريط الأبيض الطافي */
.tn-stats__strip {
	display: grid;
	grid-template-columns: repeat(var(--tn-stats-count, 4), minmax(0, 1fr));
	margin: 0 auto;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--tn-line);
	border-radius: var(--tn-radius-lg);
	background: #ffffff;
	box-shadow: 0 30px 60px -34px rgba(var(--theme-primary-rgb), 0.45), 0 2px 0 rgba(var(--theme-secondary-rgb), 0.35);
	list-style: none;
}

.tn-stats__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 36px 18px 32px;
	text-align: center;
}

/* الفاصل الرأسي على حافة البداية، يقصّه الشريط عند أول عمود في الصف */
.tn-stats__item::before {
	content: '';
	position: absolute;
	top: 22%;
	bottom: 22%;
	right: -1px;
	width: 1px;
	background: linear-gradient(to bottom, transparent, var(--tn-line-strong) 20%, var(--tn-line-strong) 80%, transparent);
}

/* مربع الأيقونة بشكل ورقة */
.tn-stats__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 10px;
	border-radius: 22px 6px 22px 6px;
	background: var(--tn-sand);
	color: var(--tn-leaf-deep);
	box-shadow: inset 0 0 0 1px var(--tn-clay-line);
	transition: background-color 0.3s ease, color 0.3s ease, border-radius 0.4s var(--tn-ease);
}

.tn-stats__item:hover .tn-stats__icon {
	border-radius: 6px 22px 6px 22px;
	background: var(--theme-secondary);
	color: #ffffff;
}

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

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

.tn-stats__number {
	display: inline-flex;
	align-items: flex-start;
	gap: 2px;
	color: var(--theme-primary);
	font-size: clamp(2rem, 1.4rem + 1.5vw, 2.9rem);
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tn-stats__plus {
	color: var(--theme-secondary);
	font-size: 0.6em;
	line-height: 1.2;
}

.tn-stats__title {
	color: var(--theme-text-light);
	font-size: 0.96rem;
	font-weight: 600;
	line-height: 1.6;
}

/* ==========================================================================
   الشاشات الأصغر
   ========================================================================== */

@media (max-width: 1024px) {
	.tn-stats__item {
		padding-inline: 10px;
	}
}

/* الجوال: عمودان، والخطوط الفاصلة فجوة 1px بلون الخط بين خلايا بيضاء */
@media (max-width: 767px) {
	.tn-stats__field {
		padding: 20px 0;
	}

	.tn-stats__strip {
		--tn-stats-count: 2 !important;
		gap: 1px;
		background: var(--tn-line);
		border-radius: var(--tn-radius);
	}

	.tn-stats__item {
		padding: 24px 8px 22px;
		background: #ffffff;
	}

	.tn-stats__item::before {
		content: none;
	}

	/* عدد فردي: الأخيرة بعرض الشريط فلا تبقى خانة فارغة */
	.tn-stats__item:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}

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

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