/**
 * Homepage Styles
 * Styles for front page template sections
 */

/* ============================================
   HERO SECTION - FULLSCREEN WITH VIDEO
   ============================================ */

.hero-section.hero-fullscreen {
	position: relative;
	width: 100%;
	height: 100vh;
	min-height: 600px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background-color: var(--color-deep-navy-forge);
	margin-top: 0;
	padding-top: 0;
	z-index: 1;
}

.hero-section.hero-partial {
	position: relative;
	width: 100%;
	height: 70vh;
	min-height: 500px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background-color: var(--color-deep-navy-forge);
	margin-top: 0;
	padding-top: 0;
	z-index: 1;
}

.hero-video-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.hero-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.hero-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		135deg,
		rgba(7, 179, 241, 0.4) 0%,
		rgba(42, 51, 71, 0.6) 50%,
		rgba(79, 100, 120, 0.5) 100%
	);
	z-index: 2;
	pointer-events: none;
}

/* Video loading spinner */
.hero-video-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	opacity: 1;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.hero-video-spinner.hidden {
	opacity: 0;
	visibility: hidden;
}

.hero-video-spinner .spinner {
	width: 48px;
	height: 48px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top-color: #07B3F1;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

.hero-content-wrapper {
	position: relative;
	z-index: 10;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	padding-bottom: 100px;
	padding-top: 120px; /* Compensate for fixed header on desktop (header height ~110-120px) */
}

@media (max-width: 768px) {
	.hero-content-wrapper {
		padding-bottom: var(--spacing-2xl);
	}
}

.hero-content {
	width: 100%;
	max-width: var(--container-max-width);
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.hero-section .container {
	width: 100%;
	margin: 0 auto;
	padding: 0 var(--container-padding);
	max-width: 1600px;
}

.hero-text {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-lg);
	max-width: 700px;
	color: var(--color-pure-white);
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features-section {
	background-color: var(--color-background-alt);
}

.card-icon {
	margin-bottom: var(--spacing-lg);
	width: clamp(3rem, 6vw, 4rem);
	height: clamp(3rem, 6vw, 4rem);
	display: flex;
	align-items: center;
	justify-content: center;
}

.card-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-section {
	background-color: var(--color-background);
}

.about-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--spacing-4xl);
	align-items: center;
}

.about-image {
	border-radius: var(--border-radius-lg);
	overflow: hidden;
}

.about-image img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.about-text {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-lg);
}

.about-actions {
	margin-top: var(--spacing-md);
}

/* ============================================
   SERVICES SECTION
   ============================================ */

.services-section {
	background-color: var(--color-background-alt);
}

/* ============================================
   POSTS SECTION
   ============================================ */

.posts-section {
	background-color: var(--color-background);
}

.card-image {
	margin: calc(var(--spacing-xl) * -1) calc(var(--spacing-xl) * -1) var(--spacing-lg);
	border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
	overflow: hidden;
}

.card-image img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.card-image a {
	display: block;
	line-height: 0;
}

.section-footer {
	margin-top: var(--spacing-3xl);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1440px) and (min-width: 769px) {
	/* Fix header overlap on medium desktop resolutions (1280-1440px) */
	.hero-section.hero-partial {
		min-height: 600px; /* Increase min-height to ensure enough space */
	}
	
	.hero-content-wrapper {
		padding-top: 140px !important; /* More padding for smaller screens to prevent header overlap */
		padding-bottom: 80px; /* Reduce bottom padding slightly to balance */
		align-items: center; /* Center content vertically instead of flex-end */
	}
}

@media (max-width: 1280px) and (min-width: 769px) {
	/* Specific fix for 1280px width screens */
	.hero-section.hero-partial {
		min-height: 620px; /* Ensure enough vertical space for 1280x800 */
		height: 75vh; /* Slightly increase from 70vh */
	}
	
	.hero-content-wrapper {
		padding-top: 150px !important; /* Extra padding to prevent overlap on 1280px */
		padding-bottom: 60px;
		align-items: center; /* Center content vertically */
	}
}

@media (max-width: 1024px) {
	.hero-section.hero-fullscreen {
		min-height: 500px;
	}
	
	.hero-section.hero-partial {
		min-height: 450px;
	}
	
	.hero-content-wrapper {
		padding-top: 90px; /* Reduce padding on tablets */
	}
	
	.hero-overlay {
		background: linear-gradient(
			135deg,
			rgba(7, 179, 241, 0.5) 0%,
			rgba(42, 51, 71, 0.7) 50%,
			rgba(79, 100, 120, 0.6) 100%
		);
	}
	
	.glass-card {
		max-width: 100%;
		min-height: auto;
		padding: var(--padding-24);
	}
	
	.about-content {
		grid-template-columns: 1fr;
		gap: var(--spacing-2xl);
	}
	
	.about-image {
		order: -1;
	}
}

@media (max-width: 768px) {
	.hero-section.hero-fullscreen {
		min-height: 400px;
		height: 100vh;
		height: 100svh;
		height: 100dvh; /* Dynamic viewport height for mobile */
		margin-top: 0;
		padding-top: 0;
	}
	
	.hero-section.hero-partial {
		min-height: 400px;
		height: 100vh;
		height: 100svh;
		height: 100dvh; /* Fullscreen on mobile for inner pages */
		margin-top: 0;
		padding-top: 0;
	}
	
	.hero-content-wrapper {
		padding-bottom: clamp(24px, 6vw, 48px);
		padding-top: calc(96px + env(safe-area-inset-top)); /* Fixed header + safe area on mobile */
		align-items: center;
		justify-content: center;
	}
	
	.hero-content {
		justify-content: center;
	}
	
	.glass-card {
		max-width: 100%;
		width: 100%;
		min-height: auto;
		padding: clamp(20px, 5vw, 32px);
		margin: 0 auto;
	}
	
	.glass-card-title {
		font-size: clamp(2rem, 5vw, 3rem);
		line-height: clamp(2.5rem, 6vw, 3.5rem);
		margin-bottom: 12px;
	}
	
	.glass-card-body {
		font-size: 14px;
		line-height: 20px;
		margin-bottom: 16px;
	}

	.hpmsm-program-page .hero-section {
		margin-top: 0;
		padding-top: 0;
	}

	.hpmsm-program-page .hero-content-wrapper {
		/* Offset fixed header + safe area to prevent text sticking under the header (Chrome/Safari mobile). */
		padding-top: calc(96px + env(safe-area-inset-top));
		align-items: center;
		justify-content: center;
	}

	.hpmsm-program-page .hero-section.hero-partial {
		height: 100vh;
		height: 100svh;
		height: 100dvh; /* Dynamic viewport height for mobile */
	}
	
	/* Ensure HPMSM Program page has same overlay as other internal pages on mobile */
	.hpmsm-program-page .hero-overlay {
		background: linear-gradient(
			135deg,
			rgba(7, 179, 241, 0.5) 0%,
			rgba(42, 51, 71, 0.7) 50%,
			rgba(79, 100, 120, 0.6) 100%
		);
	}
	
	.about-content {
		gap: var(--spacing-xl);
	}
}

@media (max-width: 480px) {
	.hero-section.hero-fullscreen {
		min-height: 350px;
	}
	
	.hero-section.hero-partial {
		min-height: 350px;
		height: 100vh;
		height: 100svh;
		height: 100dvh; /* Fullscreen on mobile for inner pages */
	}

	.hpmsm-program-page .hero-section.hero-partial {
		height: 100vh;
		height: 100svh;
		height: 100dvh; /* Fullscreen on mobile */
	}
	
	.hero-content-wrapper {
		padding-bottom: clamp(20px, 5vw, 40px);
	}
	
	.glass-card {
		padding: clamp(16px, 4vw, 24px);
	}
	
	.glass-card-label {
		font-size: 11px;
	}
	
	.glass-card-body {
		font-size: 13px;
		line-height: 18px;
	}
}
