/* =============================================================
   HEADER / NAVIGATION BAR
   Figma: Dark pill, floating sticky, matches navigation design
   ============================================================= */

/* ─── Sticky wrapper ─────────────────────────────────────── */
.cypro-header {
	position: fixed;
	top: 16px;
	left: 50%;
	transform: translateX(-50%);
	width: calc(100% - 48px);
	max-width: var(--container-max-width);
	z-index: 1000;
	/* Smooth entrance animation */
	animation: header-slide-in 0.4s ease-out both;
}

@keyframes header-slide-in {
	from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Pill container ─────────────────────────────────────── */
.cypro-header__pill {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-5);
	background-color: rgba(0, 41, 58, 0.85); /* High-end dark translucent */
	backdrop-filter: blur(16px) saturate(180%);
	-webkit-backdrop-filter: blur(16px) saturate(180%);
	border-radius: var(--border-radius-full);
	padding: 10px 24px;
	height: 60px;
	box-shadow: 
		0 10px 30px rgba(0, 0, 0, 0.3),
		inset 0 1px 1px rgba(255, 255, 255, 0.1); /* Subtle depth */
	border: none !important; /* Flat style */
	transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Scrolled state — slightly more opaque + stronger shadow */
.cypro-header.is-scrolled .cypro-header__pill {
	background-color: rgba(0, 41, 58, 0.95);
	box-shadow: 
		0 20px 50px rgba(0, 0, 0, 0.5),
		inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* When the webinar banner docks directly underneath the header, 
   remove the shadow so it doesn't cast a muddy tint over the green banner */
.cypro-header.is-scrolled.has-docked-banner .cypro-header__pill {
	box-shadow: none !important;
}

/* ─── Logo / Branding ────────────────────────────────────── */
.site-branding {
	flex-shrink: 0;
}

.site-logo-link {
	display: inline-flex;
	align-items: center;
	transition: transform var(--transition-normal), filter var(--transition-normal);
}

.site-logo-link:hover {
	transform: scale(1.05);
	filter: drop-shadow(0 0 8px rgba(150, 243, 129, 0.4));
}

.site-logo {
	height: 30px; /* Reduced from 36px for a more refined look */
	width: auto;
	display: block;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	will-change: transform, filter;
}

.site-logo-text {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 18px; /* Slightly smaller text too */
	color: var(--color-surface-white);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.site-logo-link:hover .site-logo-text {
	transform: scale(1.05);
	color: var(--color-accent);
}

/* ─── Primary Navigation ─────────────────────────────────── */
.main-navigation {
	flex: 1;
	display: flex;
	justify-content: center;
	min-width: 0; /* Let flex container shrink if space is tight */
}

.primary-menu__list {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu__list > .menu-item {
	display: flex;
	align-items: center;
	align-self: stretch; /* Fills the 60px height of the parent */
	flex-shrink: 0;
}

.primary-menu__list > .menu-item > a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px; /* Reduced from 18px to prevent overlap */
	font-family: 'Rubik', var(--font-body), sans-serif;
	font-size: var(--font-size-body-xs);    /* 14px */
	font-weight: 700; /* Bold per Figma */
	color: rgba(255, 255, 255, 0.80);
	text-decoration: none;
	border-radius: var(--border-radius-full);
	transition: color var(--transition-fast),
	            background-color var(--transition-fast);
	white-space: nowrap;
	letter-spacing: 0.01em;
}

.primary-menu__list > .menu-item > a:hover,
.primary-menu__list > .menu-item > a:focus-visible {
	color: var(--color-surface-white);
	background-color: rgba(255, 255, 255, 0.08);
}

/* Active / current state — Figma shows accent green text */
.primary-menu__list > .current-menu-item > a,
.primary-menu__list > .current-menu-ancestor > a,
.primary-menu__list > .current-page-ancestor > a {
	color: var(--color-accent);          /* #96F381 */
	background-color: transparent;
}

/* Nav item with leading icon (Webinar) */
.primary-menu__list > .menu-item.nav-item--icon > a {
	display: flex;
	align-items: center;
}

.primary-menu__list > .menu-item.nav-item--icon > a svg,
.primary-menu__list > .menu-item.nav-item--icon > a .material-icons {
	flex-shrink: 0;
	opacity: 0.8;
	font-size: 18px; /* Slightly larger for visibility */
}

/* WordPress sets current-menu-item so we handle both */
.primary-menu__list > .menu-item.current_page_item > a,
.primary-menu__list > .menu-item.page_item.current_page_item > a,
.primary-menu__list > .current-menu-item > a {
	color: var(--color-accent) !important;
}

/* ─── Mega Menu support ──────────────────────────────────── */
.menu-item.has-mega-menu {
	position: static !important; /* Force static so mega menu aligns to the header container */
}

/* Mega menu panel base managed by Pure CSS */
.mega-menu-panel {
	position: absolute;
	top: calc(100% + 15px);
	left: 50% !important;
	width: calc(100vw - 64px);
	max-width: var(--container-max-width);
	z-index: 1001;
	
	/* Hidden state */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(-50%) translateY(12px) !important;
	transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
	            transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
	            visibility 0.25s step-end;
	will-change: transform, opacity;
}

/* Invisible bridge physically bound to the animated panel */
.mega-menu-panel::before {
	content: '';
	position: absolute;
	top: -30px; 
	left: 0;
	width: 100%;
	height: 30px;
	background: transparent;
}

/* Hover state: Pure CSS reliability */
.menu-item.has-mega-menu:hover .mega-menu-panel,
.mega-menu-panel:hover {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0) !important;
	transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
	            transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
	            visibility 0s step-start;
}

/* ─── Mega Menu Item Hover Effect ────────────────────────── */
/* Service items in the mega menu grid */
.mega-service-item {
	position: relative;
}

.mega-service-item > a {
	position: relative;
	display: block;
	padding: 16px 18px;
	border-radius: 12px;
	border: 1.5px solid transparent;
	transition: background-color 0.2s ease,
	            border-color 0.2s ease,
	            transform 0.2s ease,
	            box-shadow 0.2s ease;
	text-decoration: none;
	height: 100%;
	overflow: hidden;
}

/* Left accent border indicator — hidden by default */
.mega-service-item > a::before {
	content: '';
	position: absolute;
	left: 0;
	top: 12px;
	bottom: 12px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background-color: #003143;
	transform: scaleY(0);
	transform-origin: center;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mega-service-item:hover > a {
	background-color: #f4f7f8;
	border-color: rgba(0, 49, 67, 0.08);
	transform: translateX(3px);
	box-shadow: 0 4px 16px rgba(0, 49, 67, 0.06);
}

.mega-service-item:hover > a::before {
	transform: scaleY(1);
}

.mega-service-item:hover h4 {
	color: #003143;
}

/* Arrow icon that appears on hover */
.mega-service-item > a::after {
	content: '';
	position: absolute;
	top: 16px;
	right: 14px;
	width: 18px;
	height: 18px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003143' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mega-service-item:hover > a::after {
	opacity: 0.6;
	transform: translateX(0);
}

.mega-item-header h4 {
	position: relative;
	display: inline-block;
}

.mega-sub-list li a {
	position: relative;
	transition: all 0.2s ease;
}

.mega-sub-list li a::before {
	content: '·';
	position: absolute;
	left: -12px;
	opacity: 0;
	transition: all 0.2s ease;
}

.mega-sub-list li a:hover {
	padding-left: 4px;
}

.mega-sub-list li a:hover::before {
	opacity: 1;
	left: -10px;
	color: var(--color-accent);
}

/* ─── Header Actions (right zone) ────────────────────────── */
.header-actions {
	display: flex;
	align-items: center;
	gap: var(--spacing-3);
	flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher__btn {
	display: flex;
	align-items: center;
	gap: 5px;
	background: rgba(255, 255, 255, 0.10);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: var(--border-radius-full);
	padding: 6px 12px;
	font-family: var(--font-body);
	font-size: var(--font-size-body-xs);
	font-weight: 600;
	color: var(--color-surface-white);
	cursor: pointer;
	transition: background-color var(--transition-fast);
}

.lang-switcher__btn:hover {
	background: rgba(255, 255, 255, 0.16);
}

.lang-switcher__btn svg {
	flex-shrink: 0;
}

.lang-switcher__code {
	letter-spacing: 0.04em;
}

/* CTA Button — Figma: "Get Connected" green pill */
.nav-cta-btn {
	font-size: 14px;
	padding: 8px 20px;
	min-height: 38px;
	letter-spacing: 0.01em;
}

/* ─── Hamburger ──────────────────────────────────────────── */
.menu-toggle {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hamburger {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 24px;
}

.hamburger span {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--color-surface-white);
	border-radius: 2px;
	transition: all var(--transition-fast);
}

.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
	opacity: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Compact desktop (laptops) to prevent menu overlapping */
@media (min-width: 1200px) and (max-width: 1400px) {
	.cypro-header {
		width: calc(100% - 24px);
	}
	.cypro-header__pill {
		padding: 8px 12px;
		gap: var(--spacing-2);
	}
	.primary-menu__list > .menu-item > a {
		padding: 8px 6px;
		font-size: 13px !important; /* Scale text down gracefully */
	}
	.header-actions {
		gap: 6px;
	}
	.nav-cta-btn {
		padding: 8px 12px !important;
		font-size: 13px !important;
	}
}

/* Tablet max-width */
@media (max-width: 1199px) {
	.cypro-header {
		width: calc(100% - 32px);
		top: 12px;
	}

	.cypro-header__pill {
		height: 56px;
		padding: 8px 16px;
	}

	.desktop-only { display: none !important; }
	.main-navigation { display: none; }
}

/* Mobile */
@media (max-width: 767px) {
	.cypro-header {
		width: calc(100% - 24px);
		top: 10px;
	}

	.cypro-header__pill {
		height: 52px;
		padding: 8px 14px;
	}

	.main-navigation {
		display: none; /* Hidden on mobile, use mobile-menu instead */
	}
}

/* Desktop — show desktop-only items */
@media (min-width: 1200px) {
	.mobile-only { display: none !important; }
}

/* ─── Page body offset ───────────────────────────────────── */
/* This is handled per-template via padding-top in page CSS */

/* ─── Skip link ──────────────────────────────────────────── */
.skip-link {
	position: absolute;
	top: -100%;
	left: 0;
	z-index: 10000;
	background: var(--color-primary-dark-1);
	color: var(--color-surface-white);
	padding: var(--spacing-3) var(--spacing-5);
	border-radius: 0 0 var(--border-radius-md) 0;
}

.skip-link:focus {
	top: 0;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ─── GTranslate Language Switcher Override ──────────────── */
.lang-switcher .gtranslate_wrapper {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px; /* Gap for inline flags mode */
	flex-shrink: 0;
}

/* Explicit style for flag links to prevent them from getting horizontally squished */
.lang-switcher .gtranslate_wrapper a.gflag,
.lang-switcher .gtranslate_wrapper a.glink {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	overflow: hidden;
	transition: transform 0.2s ease, filter 0.2s ease;
}

.lang-switcher .gtranslate_wrapper a.gflag:hover,
.lang-switcher .gtranslate_wrapper a.glink:hover {
	transform: scale(1.1);
}

/* Base button styling */
.lang-switcher a.gt_selector {
	display: flex !important;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.10) !important;
	border: 1px solid rgba(255, 255, 255, 0.15) !important;
	border-radius: var(--border-radius-full) !important;
	padding: 6px 12px 6px 16px !important;
	font-family: var(--font-body) !important;
	font-size: var(--font-size-body-xs) !important;
	font-weight: 600 !important;
	color: var(--color-surface-white) !important;
	transition: background-color var(--transition-fast);
}

.lang-switcher a.gt_selector:hover {
	background: rgba(255, 255, 255, 0.16) !important;
}

/* Dropdown menu positioning and styling */
.lang-switcher .gt_options {
	top: calc(100% + 12px) !important;
	left: auto !important;
	right: 0 !important;
	min-width: 160px;
	border-radius: 12px !important;
	overflow: hidden !important;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	background: #ffffff !important;
	padding: 8px !important;
}

.lang-switcher .gt_options a {
	color: #003143 !important;
	padding: 10px 14px !important;
	display: flex !important;
	align-items: center !important;
	gap: 12px !important;
	border-radius: 8px !important;
	font-family: var(--font-body) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	transition: background-color 0.2s ease, color 0.2s ease !important;
}

.lang-switcher .gt_options a:hover {
	background: #f4f7f8 !important;
	color: var(--color-accent-dark, #003143) !important;
}

.lang-switcher .gt_option img, 
.lang-switcher a.gt_selector img,
.lang-switcher .gtranslate_wrapper a.gflag img,
.lang-switcher .gtranslate_wrapper a.glink img {
	width: 20px !important;
	height: auto !important;
	min-width: 20px !important; /* Force width */
	border-radius: 2px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	flex-shrink: 0 !important; /* Prevent squishing */
	object-fit: cover;
}

