/* =========================================================
 * NationVoice — Video Showcase Widget
 * Fully isolated under .nv-videos-wrapper
 * ========================================================= */

.nv-videos-wrapper {
	--nv-primary: #3c4d8c;
	--nv-accent: #ff6716;
	--nv-heading: #202428;
	--nv-text: #5e5e5e;
	--nv-text-soft: #7c7c7c;
	--nv-bg: #f7f7f9;
	--nv-card: #ffffff;
	--nv-yt-red: #ff0000;

	--nv-radius-md: 16px;
	--nv-radius-lg: 20px;
	--nv-shadow-md: 0 8px 24px rgba(0,0,0,0.08);
	--nv-shadow-lg: 0 24px 60px rgba(0,0,0,0.18);

	--nv-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--nv-trans: 0.35s var(--nv-ease);

	--nv-font-body: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--nv-font-heading: Georgia, 'Times New Roman', serif;

	font-family: var(--nv-font-body);
	color: var(--nv-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.nv-videos-wrapper *,
.nv-videos-wrapper *::before,
.nv-videos-wrapper *::after {
	box-sizing: border-box;
}

.elementor-page .nv-videos-wrapper,
.e-con .nv-videos-wrapper,
.elementor-widget-container .nv-videos-wrapper {
	color: var(--nv-text) !important;
	font-family: var(--nv-font-body) !important;
}

/* Frame */
.nv-videos-wrapper .nv-videos {
	width: 100%;
	background-color: var(--nv-bg);
}

.nv-videos-wrapper .nv-videos__container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 96px 32px;
}

.nv-videos-wrapper .nv-videos__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
}

/* Header */
.nv-videos-wrapper .nv-videos__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
	max-width: 640px;
}

.nv-videos-wrapper .nv-videos__heading {
	margin: 0;
	font-family: var(--nv-font-heading) !important;
	font-weight: 600;
	font-size: 40px;
	line-height: 1.25;
	color: var(--nv-heading) !important;
}

.nv-videos-wrapper .nv-videos__subheading {
	margin: 0;
	font-family: var(--nv-font-body) !important;
	font-size: 16px;
	line-height: 1.5;
	color: var(--nv-text) !important;
}

/* Card box (white container around grid) */
.nv-videos-wrapper .nv-videos__card {
	width: 100%;
	background-color: var(--nv-card);
	border-radius: 20px;
	padding: 28px;
	box-shadow: var(--nv-shadow-md);
}

/* Grid */
.nv-videos-wrapper .nv-videos__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
}

.nv-videos-wrapper .nv-videos__grid--cols-1 { grid-template-columns: 1fr; }
.nv-videos-wrapper .nv-videos__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.nv-videos-wrapper .nv-videos__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.nv-videos-wrapper .nv-videos__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Video item */
.nv-videos-wrapper .nv-videos__item {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
	background-color: #000;
	aspect-ratio: 16 / 9;
}

.nv-videos-wrapper .nv-videos__embed {
	position: absolute;
	inset: 0;
	display: block;
	cursor: pointer;
	text-decoration: none !important;
	transition: transform var(--nv-trans);
}

.nv-videos-wrapper .nv-videos__item:hover .nv-videos__embed {
	transform: scale(1.02);
}

.nv-videos-wrapper .nv-videos__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: filter var(--nv-trans), transform var(--nv-trans);
}

.nv-videos-wrapper .nv-videos__item:hover .nv-videos__thumb {
	filter: brightness(0.92);
}

/* YouTube-style red play button */
.nv-videos-wrapper .nv-videos__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 72px;
	height: 50px;
	transform: translate(-50%, -50%);
	background-color: var(--nv-yt-red);
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
	transition: transform var(--nv-trans), background var(--nv-trans), box-shadow var(--nv-trans);
	pointer-events: none;
}

.nv-videos-wrapper .nv-videos__embed:hover .nv-videos__play {
	transform: translate(-50%, -50%) scale(1.08);
	background-color: #ff0000;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.nv-videos-wrapper .nv-videos__play svg {
	margin-left: 4px; /* visually center the triangle */
}

/* Caption */
.nv-videos-wrapper .nv-videos__caption {
	margin: 0;
	font-family: var(--nv-font-body) !important;
	font-size: 14px;
	line-height: 1.55;
	color: var(--nv-text-soft) !important;
	text-align: center;
	max-width: 80ch;
}

/* =========================================================
 * LIGHTBOX
 * ========================================================= */
.nv-videos-wrapper .nv-videos__lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background-color: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s var(--nv-ease), visibility 0.3s var(--nv-ease);
}

.nv-videos-wrapper .nv-videos__lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.nv-videos-wrapper .nv-videos__close {
	position: absolute;
	top: 24px;
	right: 24px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 0;
	background-color: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform var(--nv-trans), background var(--nv-trans);
	z-index: 2;
}

.nv-videos-wrapper .nv-videos__close:hover {
	transform: rotate(90deg) scale(1.05);
	background-color: rgba(255, 255, 255, 0.22);
}

.nv-videos-wrapper .nv-videos__frame {
	width: 100%;
	max-width: 1200px;
	transform: scale(0.95);
	transition: transform 0.4s var(--nv-ease);
}

.nv-videos-wrapper .nv-videos__lightbox.is-open .nv-videos__frame {
	transform: scale(1);
}

.nv-videos-wrapper .nv-videos__iframe-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-color: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.nv-videos-wrapper .nv-videos__iframe-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* =========================================================
 * STAGGER ENTRANCE
 * ========================================================= */
.nv-videos-wrapper .nv-videos__anim {
	opacity: 0;
	transform: translateY(20px);
	animation: nv-videos-fade-up 0.7s var(--nv-ease) forwards;
	animation-delay: calc(var(--nv-anim-order, 0) * 120ms);
}

@keyframes nv-videos-fade-up {
	to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
 * RESPONSIVE
 * ========================================================= */
@media (max-width: 1024px) {
	.nv-videos-wrapper .nv-videos__container { padding: 72px 24px; }
	.nv-videos-wrapper .nv-videos__heading { font-size: 32px; }
	.nv-videos-wrapper .nv-videos__card { padding: 20px; border-radius: 16px; }
}

@media (max-width: 768px) {
	.nv-videos-wrapper .nv-videos__container { padding: 56px 16px; }
	.nv-videos-wrapper .nv-videos__heading { font-size: 26px; }
	.nv-videos-wrapper .nv-videos__subheading { font-size: 15px; }
	.nv-videos-wrapper .nv-videos__inner { gap: 24px; }
	.nv-videos-wrapper .nv-videos__card { padding: 16px; border-radius: 14px; }
	.nv-videos-wrapper .nv-videos__grid {
		grid-template-columns: 1fr !important;
		gap: 16px;
	}
	.nv-videos-wrapper .nv-videos__play { width: 56px; height: 40px; border-radius: 10px; }
	.nv-videos-wrapper .nv-videos__caption { font-size: 13px; }

	.nv-videos-wrapper .nv-videos__lightbox { padding: 16px; }
	.nv-videos-wrapper .nv-videos__close { top: 12px; right: 12px; width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	.nv-videos-wrapper *,
	.nv-videos-wrapper *::before,
	.nv-videos-wrapper *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
	.nv-videos-wrapper .nv-videos__anim { opacity: 1 !important; transform: none !important; }
}
