/* معرض الصور (Masonry Layout بسيط عبر CSS Columns) */

.tg-gallery {
	column-count: 3;
	column-gap: 12px;
}

@media ( max-width: 782px ) {
	.tg-gallery {
		column-count: 2;
	}
}

@media ( max-width: 480px ) {
	.tg-gallery {
		column-count: 1;
	}
}

.tg-gallery__item {
	display: block;
	margin-bottom: 12px;
	break-inside: avoid;
	border-radius: 8px;
	overflow: hidden;
	cursor: zoom-in;
}

.tg-gallery__item img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.25s ease;
}

.tg-gallery__item:hover img {
	transform: scale( 1.03 );
}

/* صندوق العرض الكبير (Lightbox) */
.tg-lightbox {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0.85 );
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 24px;
}

.tg-lightbox.is-open {
	display: flex;
}

.tg-lightbox img {
	max-width: 90vw;
	max-height: 85vh;
	border-radius: 6px;
}

.tg-lightbox__close,
.tg-lightbox__prev,
.tg-lightbox__next {
	position: absolute;
	background: rgba( 255, 255, 255, 0.15 );
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 20px;
	cursor: pointer;
}

.tg-lightbox__close {
	top: 20px;
	inset-inline-end: 20px;
}

.tg-lightbox__prev {
	inset-inline-start: 20px;
	top: 50%;
	transform: translateY( -50% );
}

.tg-lightbox__next {
	inset-inline-end: 20px;
	top: 50%;
	transform: translateY( -50% );
}

/* شبكة فيديوهات YouTube */
.tg-youtube-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 16px;
}

.tg-youtube-card {
	border-radius: 8px;
	overflow: hidden;
	background: #f7f7f7;
}

.tg-youtube-card__thumb {
	position: relative;
	display: block;
	cursor: pointer;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
}

.tg-youtube-card__thumb::after {
	content: '▶';
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	color: #fff;
	background: rgba( 0, 0, 0, 0.25 );
	pointer-events: none; /* لا تحجب أي نقر حتى قبل بدء التشغيل (احتياط إضافي). */
}

/* بعد بدء الفيديو فعليًا (يُضاف هذا الصنف من youtube-embed.js)، تُزال طبقة
   أيقونة التشغيل بالكامل حتى يستطيع الزائر التحكم بمشغّل يوتيوب نفسه
   (إيقاف/تقديم/صوت...) دون أي طبقة تعترض النقر. */
.tg-youtube-card__thumb.is-playing::after {
	content: none;
	display: none;
}

.tg-youtube-card__thumb iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.tg-youtube-card__title {
	padding: 10px 12px 4px;
	font-weight: 600;
	font-size: 14px;
}

.tg-youtube-card__date {
	padding: 0 12px 10px;
	font-size: 12px;
	color: #6b7280;
}

/* تضمين TikTok */
.tg-tiktok-embed-wrap {
	max-width: 720px;
	margin: 0 auto;
}
