/* =============================================================================
   PROFESSIONAL LANDING PAGE STYLES (FIRST COVER BLOCK ONLY)
   ============================================================================= */

/* CSS Reset for Landing Components - handled in compatibility section */

/* =============================================================================
   CLEANUP EMPTY ELEMENTS
   ============================================================================= */

	/* Hide empty paragraph tags to prevent layout shifting */
	p:empty {
		display: none !important;
		margin: 0 !important;
		padding: 0 !important;
		height: 0 !important;
	}

/* =============================================================================
   COMPATIBILITY WITH CORE STYLES
   ============================================================================= */

	/* Ensure landing pages work with existing core CSS */
	.wp-block-cover:first-of-type {
		/* Override any inherited styles from core */
		box-sizing: border-box !important;
	}

	/* Reset any potential conflicts for landing page containers */
	.wp-block-cover:first-of-type,
	.wp-block-cover:first-of-type * {
		box-sizing: border-box;
	}

	/* Specific overrides for WordPress block editor styles */
	.wp-block-cover:first-of-type.wp-block-cover {
		/* Ensure WordPress block styles don't interfere */
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
	}

	/* Cover blocks should be full width */
	/* Since .content no longer has padding, ensure clean full-width coverage */
	.content .wp-block-cover:first-of-type {
		/* Reset any margins and ensure full width */
		margin: 0 !important;
		width: 100% !important;
	}

	/* Ensure body can scroll when there are cover blocks */
	body:has(.wp-block-cover:first-of-type) {
		overflow-y: auto !important;
	}
	
	/* Fallback for browsers without :has() support */
	@supports not (selector(:has(*))) {
		body {
			overflow-y: auto !important;
		}
	}

/* =============================================================================
   FULL VIEWPORT HERO SECTION
   ============================================================================= */

	/* Main cover container - Static height approach for mobile stability */
	.wp-block-cover:first-of-type {
		/* Use stable viewport units */
		min-height: 100vh;
		height: 100vh;
		width: 100vw;
		position: relative;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		overflow: hidden;
		/* Override any inherited margins/padding */
		margin: 0 !important;
		padding: 0 !important;
		/* Ensure it takes precedence over core styles */
		z-index: 1;
		/* Smooth performance and prevent mobile jumping */
		transform: translateZ(0);
		will-change: transform;
		/* Lock height on mobile to prevent address bar issues */
		contain: layout style;
		margin-bottom: 2rem;
	}

	.wp-block-cover p:first-of-type {
		margin: 0 !important;
		max-width: 95vw !important;
	}

	:where(.wp-block-columns) {
		margin-bottom: 0 !important;
	}

	/* Mobile-specific stability fixes */
	@media (max-width: 768px) {
		.wp-block-cover:first-of-type {
			/* Lock the height to initial calculation */
			height: calc(100vh) !important;
			min-height: calc(100vh) !important;
			/* Prevent reflow during scroll */
			contain: strict;
			/* Optimize for mobile performance */
			transform: translate3d(0, 0, 0);
			-webkit-transform: translate3d(0, 0, 0);
			backface-visibility: hidden;
			-webkit-backface-visibility: hidden;
			/* Prevent viewport unit recalculation */
			position: relative;
			isolation: isolate;
		}
	}

	/* Use most stable viewport units when available */
	@supports (height: 100svh) {
		.wp-block-cover:first-of-type {
			/* Small viewport height - doesn't change with mobile UI */
			height: 100svh !important;
			min-height: 100svh !important;
		}
	}

	/* Alternative for browsers with large viewport height support */
	@supports (height: 100lvh) and (not (height: 100svh)) {
		.wp-block-cover:first-of-type {
			height: 100lvh !important;
			min-height: 100lvh !important;
		}
	}

	/* Background image optimization */
	.wp-block-cover:first-of-type .wp-block-cover__image-background {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: center;
		z-index: 1;
		/* Performance optimization */
		transform: translateZ(0);
		backface-visibility: hidden;
	}

	/* Enhanced overlay with modern gradient */
	.wp-block-cover:first-of-type .wp-block-cover__background {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 2;
		/* Subtle backdrop blur for modern effect */
		backdrop-filter: blur(0.5px);
		-webkit-backdrop-filter: blur(0.5px);
	}

	/* Content container */
	.wp-block-cover:first-of-type .wp-block-cover__inner-container {
		position: relative;
		z-index: 3;
		width: 100%;
		max-width: 1200px;
		margin: 0 auto;
		padding: 2rem;
		text-align: center;
		/* Ensure content is perfectly centered */
		display: flex !important;
		flex-direction: column !important;
		justify-content: center !important;
		align-items: center !important;
		min-height: 100vh;
		min-height: 100dvh;
		/* Override WordPress default positioning */
		top: auto !important;
		left: auto !important;
		right: auto !important;
		bottom: auto !important;
		transform: none !important;
	}

/* =============================================================================
   TYPOGRAPHY - BOLD & MODERN
   ============================================================================= */

   .wp-block-cover__inner-container > .wp-block-heading:first-child {
		margin: 0;
		padding: 0;
   }

	/* Main heading - Bold and impactful */
	.wp-block-cover:first-of-type .has-large-font-size,
	.wp-block-cover:first-of-type h1,
	.wp-block-cover:first-of-type .wp-block-cover__inner-container > p:first-child,
	.wp-block-cover:has(.wp-block-cover__inner-container:only-of-type) p:first-child {
		font-size: clamp(3rem, 8vw, 5rem) !important;
		font-weight: 800;
		line-height: 1.1;
		margin: 0 0 2rem 0;
		color: var(--mainYellow);
		text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
		/* Modern font stack */
		font-family: var(--secondaryFont);
		letter-spacing: -0.02em;
		/* Prevent text from being too wide */
		max-width: 50%;
		margin-left: auto;
		margin-right: auto;
	}

	/* Subheadings and body text */
	.wp-block-cover:first-of-type p:not(.has-large-font-size):not(.wp-block-button__link) {
		font-size: clamp(1.125rem, 2.5vw, 1.5rem);
		font-weight: 500;
		line-height: 1.5;
		color: #ffffff;
		text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
		margin: 0 0 1.5rem 0;
		/* Optimal reading width */
		max-width: 50ch;
		margin-left: auto;
		margin-right: auto;
	}

/* =============================================================================
   COLUMN LAYOUTS - ADAPTIVE & RESPONSIVE (SMART DETECTION)
   ============================================================================= */

	/* ONLY apply grid system to equal-width columns (no custom flex-basis) */
	.wp-block-cover .wp-block-columns:not(:has([style*="flex-basis"])) {
		width: 100%;
		margin: 0;
		display: grid !important; /* Override WordPress flex layout */
		gap: 2rem;
		/* Single minmax value for consistent stepping behavior */
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
		justify-content: center;
		/* Override WordPress flex styles */
		flex-wrap: unset !important;
	}

	/* Reduce gaps at smaller screens for grid layouts */
	@media (max-width: 800px) {
		.wp-block-cover .wp-block-columns:not(:has([style*="flex-basis"])) {
			gap: 1.5rem;
		}
	}

	/* Mobile - force single column for grid layouts */
	@media (max-width: 600px) {
		.wp-block-cover .wp-block-columns:not(:has([style*="flex-basis"])) {
			grid-template-columns: 1fr !important;
			gap: 1.5rem;
		}
	}

	/* Mobile - force flex columns to stack */
	@media (max-width: 600px) {
		.wp-block-cover .wp-block-columns:has([style*="flex-basis"]) {
			flex-direction: column !important;
		}
		
		.wp-block-cover .wp-block-columns:has([style*="flex-basis"]) .wp-block-column {
			flex-basis: auto !important;
		}
	}

	/* Individual column styling for grid layouts only */
	.wp-block-cover .wp-block-columns:not(:has([style*="flex-basis"])) .wp-block-column {
		/* Remove WordPress flex constraints for grid layouts */
		flex: unset !important;
		/* Ensure proper grid behavior */
		width: 100%;
		min-width: 0;
	}

	/* Center odd columns ONLY for equal-width grid layouts */
	/* For 3-column layouts that break to 2+1 */
	@media (max-width: 844px) and (min-width: 601px) {
		.wp-block-cover .wp-block-columns:not(:has([style*="flex-basis"])) .wp-block-column:nth-child(3):last-child {
			grid-column: 1 / -1;
			justify-self: center;
			max-width: 50%; /* 50% of the full row width */
		}
	}

	/* For 5-column layouts that break to 4+1 or 2+2+1 */
	@media (max-width: 1380px) and (min-width: 845px) {
		.wp-block-cover .wp-block-columns:not(:has([style*="flex-basis"])) .wp-block-column:nth-child(5):last-child {
			grid-column: 1 / -1;
			justify-self: center;
			max-width: 50%;
		}
	}

/* =============================================================================
   FULL-WIDTH BANNER HEIGHT FIX (SPECIFIC TARGETING)
   ============================================================================= */

	/* Only target covers that are truly single banners (no columns inside) */
	.wp-block-cover:has(.wp-block-cover__inner-container:only-of-type):not(:has(.wp-block-columns)) {
		min-height: 100vh !important;
		height: 100vh !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
	}

	/* If cover has .height-preset-half, override with 50vh */
	.wp-block-cover.height-preset-half:has(.wp-block-cover__inner-container:only-of-type):not(:has(.wp-block-columns)) {
		min-height: 50vh !important;
		height: 50vh !important;
	}

	/* Other single covers, not first-of-type */
	.wp-block-cover:not(:first-of-type):not(:has(.wp-block-columns)) {
		min-height: 100vh !important;
		height: 100vh !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
	}

	/* Override for .height-preset-half on non-first-of-type covers */
	.wp-block-cover.height-preset-half:not(:first-of-type):not(:has(.wp-block-columns)) {
		min-height: 50vh !important;
		height: 50vh !important;
	}

	/* Explicitly preserve gaps for column layouts */
	.wp-block-cover:has(.wp-block-columns) {
		height: auto !important; /* Don't force height on column containers */
	}

	.height-preset-half {
		max-height: 50vh !important;
		margin-block: 1rem;
	}

	/* Mobile optimization for banners only */
	@media (max-width: 768px) {
		.wp-block-cover:not(:first-of-type):not(:has(.wp-block-columns)) {
			height: calc(100vh) !important;
			min-height: calc(100vh) !important;
		}
	}

	/* Use most stable viewport units when available for banners only */
	@supports (height: 100svh) {
		.wp-block-cover:not(:first-of-type):not(:has(.wp-block-columns)) {
			height: 100svh !important;
			min-height: 100svh !important;
		}
	}

/* =============================================================================
   COLUMN LAYOUTS - SLEEK & PROFESSIONAL
   ============================================================================= */

	/* Columns container */
	.wp-block-cover:first-of-type .wp-block-columns {
		width: 100%;
		max-width: 1000px;
		margin: 3rem auto 0;
		display: grid;
		gap: 2rem;
		/* Dynamic grid based on number of columns */
		grid-template-columns: 1fr;
	}

	/* Two column layout */
	.wp-block-cover:first-of-type .wp-block-columns:has(.wp-block-column:nth-child(2):last-child) {
		grid-template-columns: repeat(2, 1fr);
	}

	/* Three column layout */
	.wp-block-cover:first-of-type .wp-block-columns:has(.wp-block-column:nth-child(3)) {
		grid-template-columns: repeat(3, 1fr);
	}

	/* Individual column styling */
	.wp-block-cover:first-of-type .wp-block-column {
		background: rgba(255, 255, 255, 0.1);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		border: 1px solid rgba(255, 255, 255, 0.2);
		border-radius: 16px;
		padding: 2rem 1.5rem;
		transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		/* Modern glass effect */
		box-shadow: 
			0 8px 32px rgba(0, 0, 0, 0.1),
			inset 0 1px 0 rgba(255, 255, 255, 0.2);
		/* Flex layout to push buttons to bottom */
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		min-height: 280px; /* Ensure consistent minimum height */
	}

	/* Column hover effects */
	.wp-block-cover:first-of-type .wp-block-column:hover {
		transform: translateY(-4px);
		background: rgba(255, 255, 255, 0.15);
		box-shadow: 
			0 16px 48px rgba(0, 0, 0, 0.15),
			inset 0 1px 0 rgba(255, 255, 255, 0.3);
	}

	/* Column text */
	.wp-block-cover:first-of-type .wp-block-column p {
		font-size: clamp(1rem, 2vw, 1.25rem);
		font-weight: 500;
		margin-bottom: 1.5rem;
		color: #ffffff;
		text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
		/* Allow text area to grow and center content vertically */
		flex: 1;
		display: flex;
		align-items: center; /* Center text vertically */
		justify-content: center; /* Center text horizontally */
		text-align: center;
		margin: 0; /* Remove bottom margin since we're using flex */
	}

/* =============================================================================
   BUTTONS - MODERN CTA DESIGN
   ============================================================================= */

	/* Button container */
	.wp-block-cover:first-of-type .wp-block-buttons {
		margin: 1.5rem 0 0 0;
		display: flex;
		justify-content: center;
		gap: 1rem;
		flex-wrap: wrap;
	}

	/* Button container within columns - override for consistent positioning */
	.wp-block-cover:first-of-type .wp-block-column .wp-block-buttons {
		margin: auto 0 0 0; /* Push to bottom with auto top margin */
		flex-shrink: 0; /* Prevent shrinking */
	}

	/* Button wrapper */
	.wp-block-cover:first-of-type .wp-block-button {
		margin: 0;
	}

	/* Button styling */
	.wp-block-cover:first-of-type .wp-block-button__link {
		cursor: pointer;
		background-color: var(--darkTurquoiseTransparent);
		color: #ffffff !important;
		border: none;
		border-radius: 50px;
		padding: 1rem 2.5rem;
		font-size: clamp(1rem, 2vw, 3.125rem);
		font-family: var(--mainFont);
		font-weight: 600;
		text-decoration: none;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		position: relative;
		overflow: hidden;
		/* Modern shadow */
		box-shadow: 
			0 4px 16px rgba(132, 145, 21, 0.4),
			0 1px 3px rgba(0, 0, 0, 0.1);
		/* Remove default WordPress button styles */
		border-radius: 50px !important;
	}

	/* Button hover effect */
	.wp-block-cover:first-of-type .wp-block-button__link:hover {
		transform: translateY(-2px);
		background-color: var(--darkTurquoiseTransparent);
		box-shadow: 
			0 8px 25px rgba(229, 255, 0, 0.6),
			0 3px 10px rgba(0, 0, 0, 0.15);
	}

	/* Button active state */
	.wp-block-cover:first-of-type .wp-block-button__link:active {
		transform: translateY(0);
	}

	/* Shine effect on buttons */
	.wp-block-cover:first-of-type .wp-block-button__link::before {
		content: '';
		position: absolute;
		top: 0;
		left: -100%;
		width: 100%;
		height: 100%;
		background: linear-gradient(
			90deg,
			transparent,
			rgba(255, 255, 255, 0.2),
			transparent
		);
		transition: left 0.5s;
	}

	.wp-block-cover:first-of-type .wp-block-button__link:hover::before {
		left: 100%;
	}

	@media (max-width: 700px) {
		.wp-block-cover:first-of-type .wp-block-button__link {
			font-size: 2rem;
		}

		.wp-block-cover__inner-container > .wp-block-heading:first-child {
			font-size: 1.25rem;
		}
	}

/* =============================================================================
   RESPONSIVE DESIGN - NON-COLUMN ELEMENTS
   ============================================================================= */

	/* Mobile layout adjustments */
	@media (max-width: 600px) {
		.wp-block-cover:first-of-type .wp-block-cover__inner-container {
			padding: 1.5rem;
		}
		
		/* Adjust button sizes for mobile */
		.wp-block-cover:first-of-type .wp-block-button__link {
			padding: 0.875rem 2rem;
		}
		
		/* Adjust main heading for mobile */
		.wp-block-cover:first-of-type .has-large-font-size,
		.wp-block-cover:first-of-type h1,
		.wp-block-cover:first-of-type .wp-block-cover__inner-container > p:first-child {
			margin-bottom: 1.5rem;
		}
	}

	/* Small mobile adjustments */
	@media (max-width: 480px) {
		.wp-block-cover:first-of-type .wp-block-cover__inner-container {
			padding: 1rem;
			transform: translateY(-8vh) !important;
		}
		
		/* Even smaller buttons on very small screens */
		.wp-block-cover:first-of-type .wp-block-button__link {
			padding: 0.75rem 1.5rem;
		}
	}

/* =============================================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================================= */

	/* Focus styles for accessibility */
	.wp-block-cover:first-of-type .wp-block-button__link:focus {
		outline: 3px solid #fbbf24;
		outline-offset: 2px;
	}

	/* Reduced motion support */
	@media (prefers-reduced-motion: reduce) {
		.wp-block-cover:first-of-type * {
			animation-duration: 0.01ms !important;
			animation-iteration-count: 1 !important;
			transition-duration: 0.01ms !important;
		}
	}

	/* High contrast mode support */
	@media (prefers-contrast: high) {
		.wp-block-cover:first-of-type .wp-block-cover__background {
			background: rgba(0, 0, 0, 0.8);
		}
		
		.wp-block-cover:first-of-type .wp-block-column {
			background: rgba(0, 0, 0, 0.9);
			border-color: #ffffff;
		}
	}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

	@media print {
		.wp-block-cover:first-of-type {
			height: auto;
			min-height: auto;
			background: #f8f9fa !important;
			color: #000000 !important;
		}
		
		.wp-block-cover:first-of-type .wp-block-cover__background {
			display: none;
		}
		
		.wp-block-cover:first-of-type * {
			color: #000000 !important;
			text-shadow: none !important;
		}
	}