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

.sh-services__layout {
	display: grid;
	grid-template-columns: minmax(280px, 0.78fr) minmax(0, 2fr);
	align-items: stretch;
	gap: 28px;
}

/* ==========================================================================
   اللوحة
   ========================================================================== */

.sh-services__guide {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 38px 32px 34px;
	border-radius: var(--sh-radius-lg);
	background: var(--sh-grad-deep);
	color: #ffffff;
	box-shadow: 0 30px 60px -36px rgba(var(--theme-primary-rgb), 0.9);
}

/* رمز الشعار خافتاً في الركن السفلي */
.sh-services__guide-emblem {
	position: absolute;
	bottom: -54px;
	inset-inline-end: -48px;
	z-index: -1;
	width: 230px;
	height: 230px;
	opacity: 0.12;
}

.sh-services__guide .sh-head {
	margin-bottom: 26px;
}

.sh-services__guide .sh-head__title {
	font-size: clamp(1.5rem, 1.1rem + 0.9vw, 1.95rem);
}

.sh-services__count {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: auto 0 22px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	width: 100%;
}

.sh-services__count strong {
	color: var(--theme-secondary);
	font-size: 2.6rem;
	font-weight: 800;
	line-height: 1;
}

.sh-services__count span {
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.95rem;
	font-weight: 600;
}

/* ==========================================================================
   البلاطات
   ========================================================================== */

.sh-services__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sh-services__tile {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px;
	min-height: 118px;
	padding: 22px 22px 22px 18px;
	border: 1px solid var(--sh-line);
	border-radius: var(--sh-radius-lg);
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(var(--theme-primary-rgb), 0.04);
	transition: box-shadow 0.35s ease, border-color 0.35s ease, transform 0.35s var(--sh-ease);
}

/* عدد فردي: آخر بلاطة بعرض العمودين فلا يبقى فراغ */
.sh-services__tile:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

/* الجرّة الكوفية على حافة البداية: تنمو من الأعلى عند المرور */
.sh-services__tile::before {
	content: '';
	position: absolute;
	top: 18px;
	bottom: 18px;
	inset-inline-start: -1px;
	width: 5px;
	border-radius: 0 3px 3px 0;
	background: linear-gradient(180deg, var(--sh-mint), var(--theme-primary));
	transform: scaleY(0);
	transform-origin: top;
	transition: transform 0.45s var(--sh-ease);
}

.sh-services__tile:hover,
.sh-services__tile:focus-within {
	border-color: transparent;
	box-shadow: var(--sh-shadow-hover);
	transform: translateY(-3px);
}

.sh-services__tile:hover::before,
.sh-services__tile:focus-within::before {
	transform: scaleY(1);
}

/* أيقونة الخدمة في بلاطة نعناعية خافتة تمتلئ بتدرّج الرمز عند المرور */
.sh-services__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	border-radius: var(--sh-radius);
	background: var(--sh-mist-deep);
	color: var(--theme-primary);
	transition: background 0.35s ease, color 0.35s ease, border-radius 0.35s ease;
}

.sh-services__tile:hover .sh-services__icon,
.sh-services__tile:focus-within .sh-services__icon {
	border-radius: 50% 14px 50% 14px;
	background: var(--sh-grad);
	color: #ffffff;
}

.sh-services__mask {
	width: 30px;
	height: 30px;
	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;
}

.sh-services__svg {
	width: 32px;
	height: 32px;
}

.sh-services__name {
	margin: 0 0 6px;
	color: var(--sh-ink);
	font-size: 1.08rem;
	font-weight: 800;
	line-height: 1.5;
}

.sh-services__desc {
	margin: 0;
	color: var(--theme-text-light);
	font-size: 0.9rem;
	line-height: 1.75;
}

/* الرابط يغطي البلاطة، وسهمه في معيّن في طرفها */
.sh-services__link {
	position: static;
	color: var(--theme-primary);
}

.sh-services__link::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.sh-services__link:focus-visible {
	outline: none;
}

.sh-services__tile:has(.sh-services__link:focus-visible) {
	outline: 3px solid var(--sh-mint);
	outline-offset: 3px;
}

.sh-services__go {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
}

.sh-services__go::before {
	content: '';
	position: absolute;
	inset: 6px;
	border: 1.5px solid var(--sh-line-strong);
	border-radius: 6px;
	transform: rotate(45deg);
	transition: background 0.35s ease, border-color 0.35s ease;
}

.sh-services__go svg {
	position: relative;
	transition: transform 0.3s var(--sh-ease), color 0.3s ease;
}

.sh-services__tile:hover .sh-services__go::before,
.sh-services__tile:focus-within .sh-services__go::before {
	border-color: var(--theme-secondary);
	background: var(--theme-secondary);
}

.sh-services__tile:hover .sh-services__go svg,
.sh-services__tile:focus-within .sh-services__go svg {
	color: var(--sh-deep);
	transform: translateX(-2px);
}

/* ==========================================================================
   الشاشات المتوسطة والجوال
   ========================================================================== */

@media (max-width: 1100px) {
	.sh-services__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sh-services__count {
		margin-top: 0;
	}
}

@media (max-width: 680px) {
	.sh-services__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.sh-services__guide {
		padding: 30px 22px 26px;
	}

	.sh-services__tile {
		gap: 14px;
		min-height: 0;
		padding: 18px 16px 18px 12px;
	}

	.sh-services__icon {
		width: 52px;
		height: 52px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sh-services__tile,
	.sh-services__tile::before,
	.sh-services__icon,
	.sh-services__go::before,
	.sh-services__go svg {
		transition: none;
	}
}
