/**
 * المكتبة المرئية لثيم تنمية الشمالية (template-parts/home/home-videos.php): «شاشة العرض».
 *
 * على تدرّج الرمز العميق (.sh-section--deep). شاشة من جزأين: المقطع المميز بطاقة كبيرة 16:9 في البداية،
 * في وسطها زر تشغيل داخل معيّن ذهبي تنبض حوله حلقة معيّنة، وفي أسفلها فوق تظليل داكن الوسم والعنوان والتاريخ.
 * وفي الطرف الآخر «قائمة التشغيل» على لوح زجاجي خافت: صفوف مدمجة مرقّمة تفصلها خطوط رفيعة، والمعروض منها
 * بخط كوفي رأسي متدرّج في بدايته.
 * القائمة بارتفاع البطاقة وتتمرر داخلها على الشاشات الواسعة، وتحت البطاقة كاملة حتى 991px.
 *
 * أزرار الفتح تحمل كلاس الأب .video-card ليلتقطها سكربت النافذة، فتُلغى هنا أنماط الأب عليها بمحددات أقوى،
 * ويمتد غطاؤها (::after) على البطاقة أو الصف كله فيُنقر في أي موضع منه.
 */

.sh-videos__screen {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: 28px;
	align-items: stretch;
}

/* مقطع واحد: البطاقة وحدها في الوسط */
.sh-videos--single .sh-videos__screen {
	grid-template-columns: minmax(0, 880px);
	justify-content: center;
}

/* ==========================================================================
   زر الفتح: إلغاء أنماط بطاقة الأب، وغطاء ممتد على الحاوية
   ========================================================================== */

.sh-videos .video-card,
.sh-videos .video-card:hover,
.sh-videos .video-card:focus-visible {
	position: static;
	display: inline;
	flex: none;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	transform: none;
	overflow: visible;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	outline: none;
}

.sh-videos .sh-videos__open::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 3;
	border-radius: inherit;
}

.sh-videos .sh-videos__open:focus-visible::after {
	outline: 2px solid var(--theme-secondary);
	outline-offset: 3px;
}

/* ==========================================================================
   المقطع المميز
   ========================================================================== */

/* الصورة والزر والنص طبقات في خلية واحدة، والبطاقة وحدها الحاوية الموضعية لغطاء زر الفتح */
.sh-videos__feature {
	position: relative;
	display: grid;
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	align-self: start;
	aspect-ratio: 16 / 9;
	border-radius: var(--sh-radius-lg);
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

.sh-videos__media {
	position: relative;
	grid-area: 1 / 1;
	display: block;
	overflow: hidden;
	border-radius: inherit;
	background: var(--sh-grad-deep);
}

.sh-videos__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--sh-ease);
}

/* تظليل داكن في الأسفل تحت النص */
.sh-videos__media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(4, 18, 26, 0.88) 0%, rgba(4, 18, 26, 0.45) 38%, rgba(4, 18, 26, 0) 66%);
}

.sh-videos__feature:hover .sh-videos__img,
.sh-videos__feature:focus-within .sh-videos__img {
	transform: scale(1.04);
}

.sh-videos__placeholder {
	position: absolute;
	top: 42%;
	left: 50%;
	width: 26%;
	max-width: 120px;
	height: auto;
	color: rgba(255, 255, 255, 0.18);
	transform: translate(-50%, -50%);
}

/* زر التشغيل داخل معيّن ذهبي */
.sh-videos__play {
	position: absolute;
	top: 42%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	color: var(--sh-deep);
	transform: translate(-50%, -50%);
	transition: transform 0.4s var(--sh-ease);
}

.sh-videos__play::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--theme-secondary);
	-webkit-mask: var(--sh-diamond) center / contain no-repeat;
	mask: var(--sh-diamond) center / contain no-repeat;
	filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

/* حلقة معيّنة ذهبية تنبض حول الزر */
.sh-videos__play::after {
	content: '';
	position: absolute;
	inset: -14px;
	border: 2px solid rgba(var(--theme-secondary-rgb), 0.7);
	border-radius: 12px;
	transform: rotate(45deg) scale(0.72);
	opacity: 0;
	animation: sh-videos-pulse 2.4s var(--sh-ease) infinite;
}

@keyframes sh-videos-pulse {
	0% {
		transform: rotate(45deg) scale(0.72);
		opacity: 0.9;
	}

	100% {
		transform: rotate(45deg) scale(1.1);
		opacity: 0;
	}
}

.sh-videos__play svg {
	position: relative;
	width: 24px;
	height: 24px;
	/* المثلث في وسط المعيّن بصرياً */
	margin-left: 4px;
}

.sh-videos__feature:hover .sh-videos__play,
.sh-videos__feature:focus-within .sh-videos__play {
	transform: translate(-50%, -50%) scale(1.08);
}

/* بلا position، فيمتد غطاء الزر على البطاقة كلها لا على النص وحده */
.sh-videos__caption {
	grid-area: 1 / 1;
	align-self: end;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 24px 28px 24px;
	color: #ffffff;
}

.sh-videos__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--theme-secondary);
	font-size: 0.8rem;
	font-weight: 800;
}

/* حبّة فسيفساء صغيرة قبل الوسم */
.sh-videos__badge::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: currentColor;
	transform: rotate(45deg);
}

.sh-videos__title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: #ffffff;
	font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.45rem);
	font-weight: 800;
	line-height: 1.55;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.sh-videos__date {
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.85rem;
	font-weight: 600;
}

/* ==========================================================================
   قائمة التشغيل
   ========================================================================== */

.sh-videos__list {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 18px 10px 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: var(--sh-radius-lg);
	background: rgba(255, 255, 255, 0.06);
	/* لا يدخل ارتفاع القائمة في حساب الصف، فتأخذ ارتفاع البطاقة الكبيرة وتتمرر داخلها */
	contain: size;
}

.sh-videos__list-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 8px 12px;
	color: #ffffff;
	font-size: 0.95rem;
	font-weight: 800;
}

.sh-videos__count {
	color: rgba(255, 255, 255, 0.65);
	font-size: 0.8rem;
	font-weight: 600;
}

.sh-videos__rows {
	flex: 1 1 0;
	min-height: 0;
	margin: 0;
	padding: 0 4px 0 0;
	overflow-y: auto;
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.sh-videos__row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 9px 10px;
	border-radius: var(--sh-radius);
	transition: background-color 0.25s ease;
}

.sh-videos__row + .sh-videos__row {
	margin-top: 4px;
}

.sh-videos__row + .sh-videos__row::after {
	content: '';
	position: absolute;
	top: -3px;
	right: 10px;
	left: 10px;
	height: 1px;
	background: rgba(255, 255, 255, 0.1);
}

.sh-videos__row:hover,
.sh-videos__row:focus-within {
	background: rgba(255, 255, 255, 0.08);
}

/* المعروض: خط كوفي رأسي في البداية بتدرّج الرمز من أعلى إلى أسفل */
.sh-videos__row.is-featured {
	background: rgba(255, 255, 255, 0.1);
}

.sh-videos__row.is-featured::before {
	content: '';
	position: absolute;
	top: 12px;
	bottom: 12px;
	inset-inline-start: -2px;
	width: 4px;
	border-radius: 2px;
	background: linear-gradient(180deg, var(--sh-mint), var(--theme-secondary));
}

.sh-videos__row-thumb {
	position: relative;
	flex-shrink: 0;
	display: block;
	width: 104px;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--sh-radius-sm);
	background: rgba(255, 255, 255, 0.1);
}

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

.sh-videos__row-placeholder {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40%;
	height: auto;
	color: rgba(255, 255, 255, 0.25);
	transform: translate(-50%, -50%);
}

/* علامة تشغيل صغيرة في معيّن */
.sh-videos__row-play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: var(--sh-deep);
	transform: translate(-50%, -50%);
}

.sh-videos__row-play::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.92);
	-webkit-mask: var(--sh-diamond) center / contain no-repeat;
	mask: var(--sh-diamond) center / contain no-repeat;
	transition: background-color 0.25s ease;
}

.sh-videos__row-play svg {
	position: relative;
	width: 11px;
	height: 11px;
	margin-left: 2px;
}

.sh-videos__row:hover .sh-videos__row-play::before,
.sh-videos__row:focus-within .sh-videos__row-play::before,
.sh-videos__row.is-featured .sh-videos__row-play::before {
	background: var(--theme-secondary);
}

.sh-videos__row-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.sh-videos__row-mark {
	color: var(--theme-secondary);
	font-size: 0.74rem;
	font-weight: 800;
}

.sh-videos__row-title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: #ffffff;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.55;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.sh-videos__row-date {
	color: rgba(255, 255, 255, 0.65);
	font-size: 0.78rem;
	font-weight: 600;
}

/* ==========================================================================
   الشاشات المتوسطة والجوال: البطاقة ثم القائمة كاملة
   ========================================================================== */

@media (max-width: 991px) {
	.sh-videos__screen {
		grid-template-columns: minmax(0, 1fr);
		gap: 30px;
	}

	.sh-videos__list {
		contain: none;
	}

	/* بلا ارتفاع محدد للقائمة: الصفوف بطولها الطبيعي (أساس 0 كان يطويها) */
	.sh-videos__rows {
		flex: none;
		overflow: visible;
	}
}

@media (max-width: 640px) {
	.sh-videos__feature::before {
		top: -8px;
		inset-inline-start: -8px;
	}

	.sh-videos__play {
		top: 38%;
		width: 62px;
		height: 62px;
	}

	.sh-videos__play svg {
		width: 19px;
		height: 19px;
	}

	.sh-videos__caption {
		gap: 4px;
		padding: 16px 18px;
	}

	.sh-videos__badge {
		display: none;
	}

	.sh-videos__title {
		font-size: 1rem;
	}

	.sh-videos__row-thumb {
		width: 96px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sh-videos__play::after {
		animation: none;
	}

	.sh-videos__img,
	.sh-videos__play,
	.sh-videos__row,
	.sh-videos__row-play::before {
		transition: none;
	}
}
