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

.tn-services__layout {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	align-items: start;
	gap: 64px;
}

/* ==========================================================================
   المقدمة الثابتة
   ========================================================================== */

.tn-services__intro {
	position: sticky;
	top: 120px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.tn-services .tn-head {
	margin-bottom: 26px;
}

.tn-services__cta {
	padding: 13px 26px;
}

/* الغرسة على التل: التل أخضر فاتح، والساق تركوازية، والورقتان خضراوان */
.tn-services__art {
	width: min(240px, 80%);
	height: auto;
	margin-top: 34px;
	color: var(--tn-leaf-deep);
}

.tn-services__art-hill {
	color: var(--tn-sand-deep);
}

.tn-services__art path:not([fill]) {
	stroke: var(--theme-secondary);
}

/* رمز الشعار بلونيه فوق التلّ (مسارات الرمز بلا stroke) */
.tn-services__art-emblem {
	--tn-emblem-top: var(--theme-primary);
	--tn-emblem-leaf: var(--theme-secondary);
	overflow: visible;
}

.tn-services__art-emblem path {
	stroke: none !important;
}

/* ==========================================================================
   القائمة المرقّمة
   ========================================================================== */

.tn-services__list {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--tn-line-strong);
	list-style: none;
}

.tn-services__row {
	position: relative;
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 20px;
	padding: 24px 20px;
	border-bottom: 1px solid var(--tn-line);
	border-radius: 0;
	transition: background-color 0.3s ease, border-radius 0.3s ease;
}

.tn-services__row:hover,
.tn-services__row:focus-within {
	border-radius: var(--tn-radius);
	background: var(--tn-sand);
}

.tn-services__num {
	min-width: 2.4ch;
	color: rgba(var(--theme-primary-rgb), 0.28);
	font-size: 1.7rem;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	transition: color 0.3s ease;
}

.tn-services__row:hover .tn-services__num,
.tn-services__row:focus-within .tn-services__num {
	color: var(--tn-leaf-deep);
}

/* مربع الأيقونة بشكل ورقة */
.tn-services__tile {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 24px 6px 24px 6px;
	background: var(--tn-sand);
	color: var(--theme-primary);
	box-shadow: inset 0 0 0 1px var(--tn-clay-line);
	transition: background-color 0.3s ease, color 0.3s ease;
}

.tn-services__row:hover .tn-services__tile,
.tn-services__row:focus-within .tn-services__tile {
	background: var(--theme-secondary);
	color: #ffffff;
}

.tn-services__mask {
	display: block;
	width: 28px;
	height: 28px;
	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-services__svg {
	--tn-emblem-top: var(--theme-primary);
	--tn-emblem-leaf: var(--theme-secondary);
	width: 32px;
	height: 32px;
}

.tn-services__row:hover .tn-services__svg,
.tn-services__row:focus-within .tn-services__svg {
	--tn-emblem-top: #ffffff;
	--tn-emblem-leaf: #ffffff;
}

.tn-services__body {
	min-width: 0;
}

.tn-services__name {
	margin: 0;
	color: var(--tn-ink);
	font-size: 1.12rem;
	font-weight: 800;
	line-height: 1.5;
}

.tn-services__desc {
	margin: 4px 0 0;
	color: var(--theme-text-light);
	font-size: 0.94rem;
	line-height: 1.8;
}

/* سهم «طلب الخدمة»: دائرة بحد رفيع، والنص يظهر لقارئ الشاشة عبر aria-label */
.tn-services__link {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 1.5px solid var(--tn-line-strong);
	border-radius: 999px;
	color: var(--theme-primary);
	text-decoration: none;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.tn-services__link-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.tn-services__link svg {
	transition: transform 0.25s var(--tn-ease);
}

/* الصف كله قابل للنقر عبر الرابط */
.tn-services__link::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.tn-services__row:hover .tn-services__link,
.tn-services__link:focus-visible {
	border-color: var(--theme-primary);
	background: var(--theme-primary);
	color: #ffffff;
}

.tn-services__row:hover .tn-services__link svg,
.tn-services__link:focus-visible svg {
	transform: translateX(-3px);
}

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

@media (max-width: 991px) {
	.tn-services__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 34px;
	}

	.tn-services__intro {
		position: static;
	}

	.tn-services__art {
		display: none;
	}
}

@media (max-width: 767px) {
	/* الرقم فوق الأيقونة في عمود واحد فيتسع الوصف */
	.tn-services__row {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas:
			'num body link'
			'tile body link';
		align-items: start;
		gap: 6px 14px;
		padding: 20px 6px;
	}

	.tn-services__num {
		grid-area: num;
		min-width: 0;
		font-size: 0.95rem;
		text-align: center;
	}

	.tn-services__tile {
		grid-area: tile;
	}

	.tn-services__body {
		grid-area: body;
		align-self: center;
	}

	.tn-services__link {
		grid-area: link;
		align-self: center;
	}

	.tn-services__tile {
		width: 48px;
		height: 48px;
	}

	.tn-services__link {
		width: 40px;
		height: 40px;
	}

	.tn-services__name {
		font-size: 1.04rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tn-services__row,
	.tn-services__num,
	.tn-services__tile,
	.tn-services__link,
	.tn-services__link svg {
		transition: none;
	}
}
