/* NSV MEDIA FIT — 2026-09-29
 * عرض الصور غير المتناسبة مع إطارها كاملة + نافذة تكبير.
 * يُحمَّل من inc/customizer/nsv-media-fit-settings.php (الرئيسية + المركز الإعلامي فقط).
 */

/* ---------- الصورة كاملة داخل إطارها فوق نسخة مموّهة منها ---------- */
html body .nsv-home-media-item-thumb.nsv-fit-contain,
html body .nsv-media-card-image.nsv-fit-contain{
	background:#0f172a;
	isolation:isolate;
}
html body .nsv-home-media-item-thumb.nsv-fit-contain::before,
html body .nsv-media-card-image.nsv-fit-contain::before{
	content:"";
	position:absolute;
	inset:-24px;
	background-image:var(--nsv-fit-bg);
	background-size:cover;
	background-position:center;
	filter:blur(20px) saturate(1.1) brightness(.78);
	transform:scale(1.08);
	z-index:0;
	pointer-events:none;
}
html body .nsv-home-media-item-thumb.nsv-fit-contain img,
html body .nsv-media-card-image.nsv-fit-contain img{
	position:relative;
	z-index:1;
	object-fit:contain !important;
	object-position:center !important;
}
html body .nsv-fit-contain .nsv-home-media-type-badge,
html body .nsv-fit-contain .nsv-home-media-play{ z-index:2; }
html body .nsv-media-card-image.nsv-fit-contain .nsv-media-card-type{ z-index:3; }

/* إطار أعلى قليلاً لسلايدر «أحدث الصور» في الرئيسية (كان 178px) */
html body .nsv-home-media-slider-image .nsv-home-media-item .nsv-home-media-item-thumb{
	height:230px !important;
}
@media (max-width:768px){
	html body .nsv-home-media-slider-image .nsv-home-media-item .nsv-home-media-item-thumb{
		height:210px !important;
	}
}

/* مؤشر التكبير */
html body .nsv-home-media-slider-image .nsv-home-media-item-thumb,
html body .nsv-media-card-type-image .nsv-media-card-image{
	cursor:zoom-in;
}

/* ---------- نافذة التكبير ---------- */
html.nsv-lightbox-open,
html.nsv-lightbox-open body{ overflow:hidden !important; }

.nsv-lightbox{
	position:fixed;
	inset:0;
	z-index:100000;
	display:flex;
	align-items:center;
	justify-content:center;
	padding:clamp(12px,3vw,32px);
	background:rgba(15,23,42,.86);
	direction:rtl;
	animation:nsvLightboxIn .2s ease both;
}
.nsv-lightbox[hidden]{ display:none !important; }
@keyframes nsvLightboxIn{ from{opacity:0} to{opacity:1} }

.nsv-lightbox-figure{
	position:relative;
	margin:0;
	width:min(1040px,100%);
	max-height:calc(100vh - 48px);
	max-height:calc(100dvh - 48px);
	display:flex;
	flex-direction:row;
	background:#fff;
	border-radius:22px;
	overflow:hidden;
	box-shadow:0 30px 90px rgba(0,0,0,.45);
}
.nsv-lightbox-figure img{
	display:block;
	flex:0 1 auto;
	width:auto;
	height:auto;
	max-width:62%;
	max-height:calc(100vh - 48px);
	max-height:calc(100dvh - 48px);
	object-fit:contain;
	background:#0f172a;
}
.nsv-lightbox-figure figcaption{
	flex:1 1 300px;
	min-width:0;
	overflow:auto;
	padding:56px 26px 28px;
	text-align:right;
}
.nsv-lightbox-figure figcaption[hidden]{ display:none; }
.nsv-lightbox-figure.is-image-only{ width:auto; }
.nsv-lightbox-figure.is-image-only img{ max-width:100%; }

.nsv-lightbox-title{
	margin:0 0 12px !important;
	color:var(--nsv-primary,#0f766e) !important;
	font-size:clamp(20px,2.2vw,26px) !important;
	font-weight:900 !important;
	line-height:1.5 !important;
}
.nsv-lightbox-desc{
	margin:0 !important;
	color:#334155 !important;
	font-size:16px !important;
	line-height:2 !important;
	white-space:pre-line;
}
.nsv-lightbox-close{
	position:absolute;
	top:12px;
	left:12px;
	z-index:2;
	width:40px;
	height:40px;
	border:0;
	border-radius:999px;
	background:rgba(255,255,255,.94);
	color:#0f172a;
	font-size:26px;
	line-height:1;
	cursor:pointer;
	box-shadow:0 8px 24px rgba(15,23,42,.18);
}
.nsv-lightbox-close:focus-visible{ outline:3px solid var(--nsv-primary,#0f766e); outline-offset:2px; }

@media (max-width:768px){
	.nsv-lightbox{ padding:12px; }
	.nsv-lightbox-figure{
		flex-direction:column;
		max-height:calc(100vh - 24px);
		max-height:calc(100dvh - 24px);
		border-radius:18px;
	}
	.nsv-lightbox-figure img{
		max-width:100%;
		width:100%;
		max-height:62vh;
		max-height:62dvh;
	}
	.nsv-lightbox-figure figcaption{
		flex:1 1 auto;
		padding:16px 18px 20px;
	}
	.nsv-lightbox-figure.is-image-only{ width:100%; }
}
