/* =========================================================
 * NationVoice — Work / Initiatives Widget
 * Fully isolated under .nv-work-wrapper
 * ========================================================= */

.nv-work-wrapper {
	--nv-primary: #3c4d8c;
	--nv-accent: #ff6716;
	--nv-orange: #f2a541;
	--nv-heading: #202428;
	--nv-text: #5e5e5e;
	--nv-bg: #ffffff;
	--nv-bg-soft: #f7f7f9;

	--nv-radius-sm: 8px;
	--nv-radius-md: 16px;
	--nv-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
	--nv-shadow-md: 0 8px 24px rgba(0,0,0,0.10);
	--nv-shadow-lg: 0 24px 60px rgba(0,0,0,0.20);

	--nv-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--nv-trans: 0.45s 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-work-wrapper *,
.nv-work-wrapper *::before,
.nv-work-wrapper *::after {
	box-sizing: border-box;
}

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

/* =========================================================
 * SECTION FRAME
 * ========================================================= */
.nv-work-wrapper .nv-work {
	width: 100%;
	background-color: var(--nv-bg);
}

.nv-work-wrapper .nv-work__container {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 80px 32px;
}

.nv-work-wrapper .nv-work__inner {
	display: flex;
	flex-direction: column;
	gap: 56px;
}

/* =========================================================
 * HEADER
 * ========================================================= */
.nv-work-wrapper .nv-work__header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	max-width: 720px;
}

.nv-work-wrapper .nv-work__heading {
	margin: 0;
	font-family: var(--nv-font-body) !important;
	font-weight: 800;
	font-size: 48px;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--nv-heading) !important;
	text-transform: uppercase;
}

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

/* =========================================================
 * GRID
 * ========================================================= */
.nv-work-wrapper .nv-work__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 32px;
}

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

/* =========================================================
 * CARD
 * ========================================================= */
.nv-work-wrapper .nv-work__card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 520px;
	border-radius: 4px;
	overflow: hidden;
	color: #ffffff !important;
	text-decoration: none !important;
	transition: transform var(--nv-trans), box-shadow var(--nv-trans);
	background-color: #1a1a1a;
	cursor: pointer;
	isolation: isolate;
}

a.nv-work-wrapper .nv-work__card,
.nv-work-wrapper a.nv-work__card {
	color: #ffffff !important;
}

.nv-work-wrapper .nv-work__card:hover {
	transform: translateY(-4px);
	box-shadow: var(--nv-shadow-lg);
}

/* Image (background) */
.nv-work-wrapper .nv-work__image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.7s var(--nv-ease);
	z-index: 1;
}

.nv-work-wrapper .nv-work__card:hover .nv-work__image {
	transform: scale(1.06);
}

/* Gradient overlay using CSS variables (Elementor controls write into them) */
.nv-work-wrapper .nv-work__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		var(--nv-ovl-1, rgba(0,0,0,0)) 0%,
		var(--nv-ovl-1, rgba(0,0,0,0)) 35%,
		var(--nv-ovl-2, rgba(0,0,0,0.85)) 100%
	);
	transition: background var(--nv-trans), opacity var(--nv-trans);
	z-index: 2;
	pointer-events: none;
}

/* Content */
.nv-work-wrapper .nv-work__content {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	padding: 32px;
	gap: 24px;
}

.nv-work-wrapper .nv-work__icon {
	width: 56px;
	height: 56px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(255, 255, 255, 0.10);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	color: #ffffff !important;
	transition: transform var(--nv-trans), background var(--nv-trans);
	flex-shrink: 0;
	align-self: flex-start;
}

.nv-work-wrapper .nv-work__card:hover .nv-work__icon {
	background-color: rgba(255, 255, 255, 0.18);
	transform: scale(1.05);
}

.nv-work-wrapper .nv-work__icon i {
	font-size: 22px;
	color: #ffffff !important;
}

.nv-work-wrapper .nv-work__icon svg {
	width: 22px;
	height: 22px;
	fill: #ffffff;
}

/* Text container — slides up on hover */
.nv-work-wrapper .nv-work__text {
	display: flex;
	flex-direction: column;
	gap: 12px;
	transform: translateY(0);
	transition: transform var(--nv-trans);
}

.nv-work-wrapper .nv-work__title {
	margin: 0;
	font-family: var(--nv-font-body) !important;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: #ffffff !important;
}

.nv-work-wrapper .nv-work__desc {
	margin: 0;
	font-family: var(--nv-font-body) !important;
	font-size: 14px;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.85) !important;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height var(--nv-trans), opacity var(--nv-trans);
}

.nv-work-wrapper .nv-work__card:hover .nv-work__desc {
	max-height: 240px;
	opacity: 1;
}

/* "Learn more" link — appears on hover */
.nv-work-wrapper .nv-work__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--nv-font-body) !important;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--nv-accent) !important;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height var(--nv-trans), opacity var(--nv-trans);
	padding-top: 0;
}

.nv-work-wrapper .nv-work__card:hover .nv-work__link {
	max-height: 24px;
	opacity: 1;
	padding-top: 4px;
}

.nv-work-wrapper .nv-work__link svg {
	transition: transform var(--nv-trans);
	color: var(--nv-accent) !important;
}

.nv-work-wrapper .nv-work__card:hover .nv-work__link svg {
	transform: translateX(4px);
}

/* =========================================================
 * STAGGER ENTRANCE (CSS-only, autoplays for editor compat)
 * ========================================================= */
.nv-work-wrapper .nv-work__anim {
	opacity: 0;
	transform: translateY(24px);
	animation: nv-work-fade-up 0.8s var(--nv-ease) forwards;
	animation-delay: calc(var(--nv-anim-order, 0) * 120ms);
}

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

/* =========================================================
 * RESPONSIVE
 * ========================================================= */
@media (max-width: 1024px) {
	.nv-work-wrapper .nv-work__container { padding: 64px 24px; }
	.nv-work-wrapper .nv-work__heading { font-size: 36px; }
	.nv-work-wrapper .nv-work__inner { gap: 40px; }
	.nv-work-wrapper .nv-work__grid { gap: 24px; }
	.nv-work-wrapper .nv-work__card { min-height: 440px; }

	/* On tablet, show description by default (no hover on touch) */
	.nv-work-wrapper .nv-work__desc {
		max-height: 240px;
		opacity: 1;
	}
}

@media (max-width: 768px) {
	.nv-work-wrapper .nv-work__container { padding: 48px 16px; }
	.nv-work-wrapper .nv-work__heading { font-size: 28px; text-align: center; }
	.nv-work-wrapper .nv-work__subheading { font-size: 15px; text-align: center; }
	.nv-work-wrapper .nv-work__inner { gap: 32px; }

	/* Center the header section on mobile */
	.nv-work-wrapper .nv-work__header {
		align-items: center;
		text-align: center;
		max-width: 100%;
	}

	.nv-work-wrapper .nv-work__grid {
		grid-template-columns: 1fr !important;
		gap: 20px;
	}

	.nv-work-wrapper .nv-work__card { min-height: 400px; }

	/* Center-align card content on mobile */
	.nv-work-wrapper .nv-work__content {
		padding: 24px;
		gap: 20px;
		align-items: center;
		text-align: center;
	}

	.nv-work-wrapper .nv-work__icon {
		width: 48px;
		height: 48px;
		align-self: center;
	}
	.nv-work-wrapper .nv-work__icon i { font-size: 20px; }
	.nv-work-wrapper .nv-work__icon svg { width: 20px; height: 20px; }

	.nv-work-wrapper .nv-work__text {
		align-items: center;
		text-align: center;
	}

	.nv-work-wrapper .nv-work__title { font-size: 22px; }
	.nv-work-wrapper .nv-work__desc { font-size: 14px; }

	/* On mobile, show description always */
	.nv-work-wrapper .nv-work__desc {
		max-height: none;
		opacity: 1;
	}
	.nv-work-wrapper .nv-work__link {
		max-height: none;
		opacity: 1;
		padding-top: 4px;
	}
}

@media (max-width: 480px) {
	.nv-work-wrapper .nv-work__card { min-height: 360px; }
	.nv-work-wrapper .nv-work__content { padding: 20px; }
}

/* =========================================================
 * REDUCED MOTION
 * ========================================================= */
@media (prefers-reduced-motion: reduce) {
	.nv-work-wrapper *,
	.nv-work-wrapper *::before,
	.nv-work-wrapper *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
	.nv-work-wrapper .nv-work__anim { opacity: 1 !important; transform: none !important; }
	.nv-work-wrapper .nv-work__desc { max-height: 240px; opacity: 1; }
	.nv-work-wrapper .nv-work__link { max-height: none; opacity: 1; }
}
