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

.sh-hero {
	--sh-tip: 34px;
	--sh-hero-h: min(640px, 78vh);
	--sh-hero-shade: color-mix(in srgb, var(--sh-deep) 92%, transparent);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	/* ما تحت رأس المعيّن شفاف، فتظهر فيه خلفية الصفحة الموحدة */
	background: transparent;
	color: #ffffff;
}

.sh-hero__slider {
	overflow: hidden;
	background: var(--sh-deep);
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--sh-tip)), 50% 100%, 0 calc(100% - var(--sh-tip)));
}

/* الشرائح فوق بعضها قبل تهيئة Swiper: تظهر الأولى فقط */
.sh-hero__slider:not(.swiper-initialized) .swiper-slide:not(:first-child) {
	display: none;
}

.sh-hero__slide {
	position: relative;
	display: flex;
	align-items: center;
	height: auto;
	min-height: var(--sh-hero-h);
	padding: 72px 0 calc(var(--sh-tip) + 76px);
	background: var(--sh-grad-deep);
}

/* ==========================================================================
   الصورة والظل
   ========================================================================== */

.sh-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.sh-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ظل الأساسي العميق من جهة النص، وظل أخف من الأسفل يمهّد لرأس المعيّن */
.sh-hero__bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to top, color-mix(in srgb, var(--sh-deep) 55%, transparent), transparent 35%),
		linear-gradient(to left, var(--sh-hero-shade) 0%, color-mix(in srgb, var(--sh-deep) 70%, transparent) 40%, transparent 80%);
}

/* ==========================================================================
   النص
   ========================================================================== */

.sh-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
}

.sh-hero__content {
	position: relative;
	max-width: 620px;
	padding-inline-start: 30px;
}

/* الجرّة الكوفية: خط رأسي بتدرّج الرمز من الأعلى إلى الأسفل */
.sh-hero__stroke {
	position: absolute;
	top: 14px;
	bottom: 6px;
	inset-inline-start: 0;
	width: 4px;
	border-radius: 2px;
	background: linear-gradient(to bottom, var(--sh-mint), color-mix(in srgb, var(--theme-primary) 55%, #ffffff));
}

/* تعلوها حبّة ذهبية مائلة كورقتي الشعار في أعلى الرمز */
.sh-hero__stroke::before {
	content: '';
	position: absolute;
	top: -15px;
	left: 50%;
	width: 9px;
	height: 9px;
	margin-left: -4.5px;
	border-radius: 2px;
	background: var(--theme-secondary);
	transform: rotate(45deg);
}

/* الشارة: نسخة زجاجية فاتحة من .sh-tag فوق الصورة */
.sh-hero__tag {
	border-color: rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.sh-hero__tag svg {
	color: var(--theme-secondary);
}

.sh-hero__title {
	margin: 18px 0 0;
	color: #ffffff;
	font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.3rem);
	font-weight: 800;
	line-height: 1.28;
	text-wrap: balance;
}

.sh-hero__desc {
	max-width: 540px;
	margin-top: 16px;
	color: rgba(255, 255, 255, 0.88);
	font-size: 1.08rem;
	line-height: 1.9;
}

.sh-hero__desc p {
	margin: 0 0 0.5em;
}

.sh-hero__desc p:last-child {
	margin-bottom: 0;
}

.sh-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 30px;
}

/* ==========================================================================
   الترقيم الرأسي وزرّا التنقل (الطرف المقابل)
   ========================================================================== */

.sh-hero__controls {
	position: absolute;
	top: 0;
	right: 0;
	bottom: var(--sh-tip);
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	pointer-events: none;
}

.sh-hero__nav {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	pointer-events: auto;
}

.sh-hero__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1.5px solid rgba(255, 255, 255, 0.35);
	border-radius: var(--sh-radius);
	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;
	cursor: pointer;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.sh-hero__arrow:hover,
.sh-hero__arrow:focus-visible {
	border-color: var(--theme-secondary);
	background: var(--theme-secondary);
	color: var(--sh-deep);
}

.sh-hero__dots {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

/* كل نقطة زر بمساحة لمس كافية، والمعيّن الظاهر داخله */
.sh-hero__dot {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: var(--sh-radius-sm);
	background: transparent;
	cursor: pointer;
}

.sh-hero__dot::before {
	content: '';
	width: 9px;
	height: 9px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.5);
	transform: rotate(45deg);
	transition: width 0.35s var(--sh-ease), height 0.35s var(--sh-ease), background-color 0.25s ease, box-shadow 0.25s ease;
}

.sh-hero__dot:hover::before {
	background: #ffffff;
}

.sh-hero__dot.is-active::before {
	width: 15px;
	height: 15px;
	border-radius: 3px;
	background: var(--theme-secondary);
	box-shadow: 0 0 0 4px rgba(var(--theme-secondary-rgb), 0.22);
}

.sh-hero__dot:focus-visible,
.sh-hero__arrow:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* ==========================================================================
   خط التقدّم: يظهر مع التشغيل التلقائي فقط (.is-timed من السكربت)
   ========================================================================== */

.sh-hero__progress {
	position: absolute;
	right: 0;
	bottom: calc(var(--sh-tip) + 24px);
	left: 0;
	z-index: 2;
	pointer-events: none;
}

.sh-hero:not(.is-timed) .sh-hero__progress {
	display: none;
}

.sh-hero__progress-track {
	display: block;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.16);
	overflow: hidden;
}

/* يمتلئ من جهة البداية (يمين) */
.sh-hero__progress-fill {
	display: block;
	height: 100%;
	background: linear-gradient(to left, var(--sh-mint), var(--theme-secondary));
	transform: scaleX(0);
	transform-origin: right center;
}

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

@media (max-width: 1024px) {
	.sh-hero--many .sh-hero__content {
		max-width: min(620px, calc(100% - 72px));
	}
}

@media (max-width: 767px) {
	.sh-hero {
		--sh-tip: 22px;
		--sh-hero-h: 540px;
	}

	.sh-hero__slide {
		align-items: flex-end;
		padding: 84px 0 calc(var(--sh-tip) + 56px);
	}

	/* الظل يصعد من الأسفل حيث النص */
	.sh-hero__bg::after {
		background: linear-gradient(to top, var(--sh-hero-shade) 0%, color-mix(in srgb, var(--sh-deep) 72%, transparent) 50%, color-mix(in srgb, var(--sh-deep) 25%, transparent) 100%);
	}

	.sh-hero--many .sh-hero__content {
		max-width: none;
	}

	.sh-hero__content {
		padding-inline-start: 22px;
	}

	.sh-hero__title {
		font-size: clamp(1.6rem, 1.1rem + 2.6vw, 2.1rem);
	}

	.sh-hero__desc {
		font-size: 1rem;
		line-height: 1.8;
	}

	.sh-hero__actions {
		margin-top: 24px;
	}

	/* الترقيم أفقي في أعلى الطرف المقابل */
	.sh-hero__controls {
		align-items: flex-start;
		padding-top: 18px;
	}

	.sh-hero__nav,
	.sh-hero__dots {
		flex-direction: row;
	}

	.sh-hero__nav {
		gap: 6px;
	}

	.sh-hero__arrow {
		width: 40px;
		height: 40px;
	}

	/* السهمان أعلى/أسفل يصيران يمين (السابق) ويسار (التالي) مع الصف الأفقي */
	.sh-hero__arrow svg {
		transform: rotate(90deg);
	}

	.sh-hero__progress {
		bottom: calc(var(--sh-tip) + 16px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sh-hero__arrow,
	.sh-hero__dot::before {
		transition: none;
	}

	.sh-hero__progress {
		display: none;
	}
}

