/* آبار التنمية — معرض يوتيوب */

.abar-yt {
	--abar-yt-accent: #3a80c0;
	--abar-yt-accent-soft: #eaf2fa;
	--abar-yt-text: #1b2733;
	--abar-yt-muted: #6c7a88;
	--abar-yt-border: #e3e8ee;
	--abar-yt-card: #fff;
	--abar-yt-cols: 3;
	direction: rtl;
	text-align: right;
	font-family: inherit;
	color: var(--abar-yt-text);
}

/* ---------- التبويبات ---------- */

.abar-yt-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 28px;
	padding: 0;
}

.abar-yt-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: 1px solid var(--abar-yt-border);
	border-radius: 999px;
	background: #fff;
	color: var(--abar-yt-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background .18s, border-color .18s, color .18s;
}

.abar-yt-tab:hover {
	border-color: var(--abar-yt-accent);
	color: var(--abar-yt-accent);
}

.abar-yt-tab.is-active {
	background: var(--abar-yt-accent);
	border-color: var(--abar-yt-accent);
	color: #fff;
}

.abar-yt-count {
	display: inline-block;
	min-width: 22px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--abar-yt-accent-soft);
	color: var(--abar-yt-accent);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

.abar-yt-tab.is-active .abar-yt-count {
	background: rgba(255, 255, 255, .22);
	color: #fff;
}

/* ---------- الأقسام والشبكة ---------- */

.abar-yt-section {
	margin: 0 0 44px;
}

.abar-yt-section[hidden] {
	display: none;
}

.abar-yt-heading {
	margin: 0 0 18px;
	padding-right: 14px;
	border-right: 4px solid var(--abar-yt-accent);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}

.abar-yt-grid {
	display: grid;
	grid-template-columns: repeat(var(--abar-yt-cols, 3), minmax(0, 1fr));
	gap: 24px;
}

.abar-yt-card {
	display: flex;
	flex-direction: column;
	background: var(--abar-yt-card);
	border: 1px solid var(--abar-yt-border);
	border-radius: 14px;
	overflow: hidden;
	transition: transform .18s, box-shadow .18s;
}

.abar-yt-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(58, 128, 192, .16);
}

.abar-yt-play {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: #000;
	aspect-ratio: 16 / 9;
	cursor: pointer;
	overflow: hidden;
}

.abar-yt-thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s, opacity .2s;
}

.abar-yt-play:hover .abar-yt-thumb {
	transform: scale(1.05);
	opacity: .85;
}

.abar-yt-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .4));
	transition: transform .18s;
}

.abar-yt-play:hover .abar-yt-icon {
	transform: scale(1.12);
}

.abar-yt-title {
	margin: 14px 16px 6px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.abar-yt-date {
	margin: 0 16px 16px;
	color: var(--abar-yt-muted);
	font-size: 13px;
}

/* ---------- النافذة المنبثقة ---------- */

.abar-yt-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, .82);
}

.abar-yt-modal[hidden] {
	display: none;
}

.abar-yt-modal-inner {
	position: relative;
	width: min(960px, 100%);
}

.abar-yt-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}

.abar-yt-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.abar-yt-modal-title {
	margin: 14px 0 0;
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.6;
}

.abar-yt-close {
	position: absolute;
	top: -46px;
	left: 0;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.abar-yt-close:hover {
	background: rgba(255, 255, 255, .3);
}

.abar-yt-notice {
	padding: 18px 22px;
	border: 1px solid var(--abar-yt-border);
	border-radius: 12px;
	background: #fafbfb;
	color: var(--abar-yt-muted);
	text-align: center;
}

/* ---------- الاستجابة ---------- */

@media (max-width: 900px) {
	.abar-yt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.abar-yt-grid { grid-template-columns: 1fr; gap: 18px; }
	.abar-yt-heading { font-size: 19px; }
	.abar-yt-tab { padding: 8px 15px; font-size: 14px; }
	.abar-yt-close { top: auto; bottom: -46px; left: 50%; transform: translateX(-50%); }
}

/* ---------- البحث ---------- */

.abar-yt-search {
	position: relative;
	margin: 0 0 20px;
	max-width: 460px;
}

.abar-yt-search-input {
	width: 100%;
	padding: 13px 46px 13px 18px;
	border: 1px solid var(--abar-yt-border);
	border-radius: 999px;
	background: #fff;
	color: var(--abar-yt-text);
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	transition: border-color .18s, box-shadow .18s;
}

.abar-yt-search-input:focus {
	outline: 0;
	border-color: var(--abar-yt-accent);
	box-shadow: 0 0 0 3px var(--abar-yt-accent-soft);
}

.abar-yt-search-icon {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	pointer-events: none;
	opacity: .5;
	font-size: 15px;
}

/* ---------- الحالة والتحميل ---------- */

.abar-yt-status:empty {
	display: none;
}

.abar-yt-status {
	margin: 0 0 16px;
	color: var(--abar-yt-muted);
	font-size: 14px;
}

.abar-yt-grid.is-loading {
	opacity: .5;
	transition: opacity .15s;
}

.abar-yt-more-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 34px 0 0;
}

.abar-yt-more {
	padding: 13px 40px;
	border: 1px solid var(--abar-yt-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--abar-yt-accent);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background .18s, color .18s;
}

.abar-yt-more:hover:not(:disabled) {
	background: var(--abar-yt-accent);
	color: #fff;
}

.abar-yt-more:disabled {
	opacity: .55;
	cursor: default;
}

.abar-yt-more[hidden] {
	display: none;
}

.abar-yt-spinner {
	width: 22px;
	height: 22px;
	border: 2.5px solid var(--abar-yt-border);
	border-top-color: var(--abar-yt-accent);
	border-radius: 50%;
	animation: abar-yt-spin .7s linear infinite;
}

.abar-yt-spinner[hidden] {
	display: none;
}

@keyframes abar-yt-spin {
	to { transform: rotate(360deg); }
}
