/**
 * VH Citizenship — Global Header, Navigation, Mega Menu, Language Selector
 * (VHC-P3 §3-7). Delivered as a single Elementor HTML widget inside the
 * existing "Header - Finance" Theme Builder template (see VHC-P3 docs for
 * why: no visual Elementor editor access this session made hand-authoring
 * deeply-nested native Container/widget JSON an unacceptable reliability
 * risk for something this interactive; this keeps the content inside
 * Elementor's Theme Builder condition system while giving directly
 * reviewable, correct markup).
 */

.vhc-header {
	position: sticky;
	top: 0;
	z-index: var(--vhc-z-header);
	background-color: var(--vhc-color-bg);
	border-bottom: 1px solid transparent;
	transition: box-shadow 220ms var(--vhc-ease-out), border-color 220ms var(--vhc-ease-out), padding-block 220ms var(--vhc-ease-out);
}
.vhc-header.is-scrolled {
	box-shadow: 0 1px 0 var(--vhc-color-border), 0 8px 24px -12px rgba(15, 35, 23, 0.18);
	border-bottom-color: var(--vhc-color-border);
}

.vhc-header__inner {
	position: relative; /* anchors .vhc-mega — see mega-menu positioning comment below */
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--vhc-space-md);
	padding-block: var(--vhc-space-sm);
	transition: padding-block 220ms var(--vhc-ease-out);
}
.vhc-header.is-scrolled .vhc-header__inner {
	padding-block: var(--vhc-space-2xs);
}

.vhc-header__logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
.vhc-header__logo img {
	height: clamp(2.75rem, 2.2rem + 1.5vw, 3rem);
	width: auto;
	display: block;
	transition: height 220ms var(--vhc-ease-out);
}

/* Desktop nav */
.vhc-nav {
	display: none;
}
@media (min-width: 1200px) {
	.vhc-nav {
		display: flex;
		align-items: center;
		gap: clamp(0.25rem, 0.1rem + 0.5vw, var(--vhc-space-sm));
		flex: 1;
		justify-content: center;
		min-width: 0;
	}
}
.vhc-nav__item {
	/* NOT position:relative — .vhc-mega (a descendant) is deliberately
	   anchored to .vhc-header__inner instead (see .vhc-mega comment), so
	   it stays within the viewport regardless of which nav item triggered
	   it. A relative nav-item here would become the nearer positioned
	   ancestor and silently override that anchor — confirmed as the exact
	   cause of the Residency mega menu clipping off the right edge. */
	position: static;
}
.vhc-nav__link {
	display: flex;
	align-items: center;
	gap: 0.3em;
	padding: var(--vhc-space-2xs) var(--vhc-space-xs);
	font-size: var(--vhc-fs-nav);
	font-weight: 500;
	color: var(--vhc-color-text);
	text-decoration: none;
	letter-spacing: 0.01em;
	white-space: nowrap;
	transition: color 160ms var(--vhc-ease-out);
}
.vhc-nav__link:hover,
.vhc-nav__link[aria-expanded="true"] {
	color: var(--vhc-color-accent-gold);
}
.vhc-nav__link.is-current {
	color: var(--vhc-color-accent-gold);
}
.vhc-nav__caret {
	width: 0.6em;
	height: 0.6em;
	flex-shrink: 0;
	transition: transform 200ms var(--vhc-ease-out);
}
.vhc-nav__link[aria-expanded="true"] .vhc-nav__caret {
	transform: rotate(180deg);
}

/* Mega menu */
/* Anchored to .vhc-header__inner (the page-width container), not to the
   individual trigger link: at 58rem wide the panel is wider than the gap
   between a left-side trigger (Citizenship/Residency) and the viewport
   edge, so centering it under the trigger pushed it off-screen left —
   confirmed visually, not guessed. Flush-left against the container's own
   padding box instead, same edge the logo/content already align to. */
/**
 * The colors/fonts/treatment below reproduce the owner's original "Mega
 * Menu CBI/RBI" Elementor templates exactly, per explicit request — not
 * the site's general IBM Plex/token design language used everywhere else
 * in the header. Values pulled directly from the live Elementor Kit's
 * global colors and the templates' own rendered CSS, not approximated:
 *   --e-global-color-b20d0b7  = #F4EFE5 (Kit "Custom Color 2", cream)
 *   --e-global-color-vamtam_accent_1/6 = #0F2317 (dark green)
 *   --e-global-color-vamtam_accent_2  = #BB7822 (gold)
 *   --e-global-color-vamtam_accent_4  = #E4EDF3 (light blue-tint, unused
 *       here — promo panel uses the real photo+gradient treatment instead)
 * Referenced as the live CSS custom properties (not hardcoded hex) so
 * they stay in sync if the Kit's global colors are ever edited.
 */
.vhc-mega {
	position: absolute;
	top: 100%;
	inset-inline-start: 0;
	inset-inline-end: 0;
	transform: translateY(8px);
	width: 100%;
	background-color: var(--e-global-color-b20d0b7, #F4EFE5);
	border: 1px solid var(--vhc-color-border);
	border-radius: var(--vhc-radius-md);
	box-shadow: var(--vhc-shadow-lg);
	padding: var(--vhc-space-md);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 180ms var(--vhc-ease-out), transform 180ms var(--vhc-ease-out), visibility 180ms;
	z-index: var(--vhc-z-mega-menu);
	max-height: calc(100vh - 6rem);
	overflow-y: auto;
	/* Sleek, light, thin scrollbar instead of the OS-default thick/dark
	   one — Firefox via scrollbar-width/-color, Chrome/Edge/Safari via
	   the ::-webkit-scrollbar pseudo-elements below. */
	scrollbar-width: thin;
	scrollbar-color: rgba(187, 120, 34, 0.4) transparent;
}
.vhc-mega::-webkit-scrollbar {
	width: 6px;
}
.vhc-mega::-webkit-scrollbar-track {
	background: transparent;
}
.vhc-mega::-webkit-scrollbar-thumb {
	background-color: rgba(187, 120, 34, 0.4);
	border-radius: var(--vhc-radius-pill);
}
.vhc-mega::-webkit-scrollbar-thumb:hover {
	background-color: rgba(187, 120, 34, 0.65);
}
.vhc-nav__item.is-open .vhc-mega {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.vhc-mega__grid {
	display: grid;
	grid-template-columns: 1.1fr 1.4fr 1fr;
	gap: var(--vhc-space-md);
}
.vhc-mega__grid--3col {
	grid-template-columns: 1.15fr 1fr 1.05fr;
}

.vhc-mega__label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Geologica', var(--vhc-font-body);
	font-weight: 700;
	font-size: 1.05rem;
	text-transform: uppercase;
	letter-spacing: -0.02em;
	color: #000000;
	text-decoration: none;
	margin-block-end: var(--vhc-space-sm);
}
.vhc-mega__label i {
	color: var(--e-global-color-vamtam_accent_2, #BB7822);
	font-size: 0.95rem;
}
a.vhc-mega__label:hover {
	color: var(--e-global-color-vamtam_accent_2, #BB7822);
}
.vhc-mega__label--spaced {
	margin-block-start: var(--vhc-space-md);
}

/* Column 1 — grouped programme/country cards, each with a one-line hook,
   separated by a thin gold divider (the original templates' real content
   structure, reproduced exactly — VHC-P0-010 §3 flagged those templates'
   stray visually-hidden "Inactive" heading artifacts; this hand-authored
   markup simply never reintroduces that bug rather than needing a fix). */
.vhc-mega__country-list {
	display: grid;
}
.vhc-mega__country {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.5rem 0.6rem 1.1rem;
	text-decoration: none;
	border-block-end: 0.5px solid var(--e-global-color-vamtam_accent_2, #BB7822);
}
.vhc-mega__country-list .vhc-mega__country:last-child {
	border-block-end: none;
}
.vhc-mega__flag {
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.vhc-mega__country-text {
	min-width: 0;
}
.vhc-mega__country-name {
	display: block;
	font-family: 'Geologica', var(--vhc-font-body);
	font-weight: 600;
	font-size: 1rem;
	color: var(--e-global-color-vamtam_accent_1, #0F2317);
}
.vhc-mega__country-hook {
	display: block;
	font-size: var(--vhc-fs-caption);
	color: rgba(0, 0, 0, 0.83);
	margin-block-start: 0.15em;
}
.vhc-mega__country:hover {
	background-color: rgba(0, 0, 0, 0.04);
}
.vhc-mega__view-all {
	display: inline-block;
	margin-block-start: var(--vhc-space-sm);
	font-size: var(--vhc-fs-caption);
	font-weight: 600;
	color: var(--e-global-color-vamtam_accent_2, #BB7822);
	text-decoration: none;
}
.vhc-mega__view-all:hover {
	text-decoration: underline;
}

/* Column 2 — guidance/guide links, same card+divider treatment as the
   country list, optionally with a one-line description (RBI's real
   "Guides" column carries these; CBI's "Learn" column doesn't, so --desc
   is opt-in via a modifier rather than assumed on every list). */
.vhc-mega__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
}
.vhc-mega__list li {
	border-block-end: 0.5px solid var(--e-global-color-vamtam_accent_2, #BB7822);
}
.vhc-mega__list li:last-child {
	border-block-end: none;
}
.vhc-mega__list a {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.6rem 0.5rem 0.6rem 1.1rem;
	font-family: 'Geologica', var(--vhc-font-body);
	font-weight: 600;
	font-size: 1rem;
	color: var(--e-global-color-vamtam_accent_1, #0F2317);
	text-decoration: none;
	transition: background-color 140ms var(--vhc-ease-out);
}
.vhc-mega__list-icon {
	flex-shrink: 0;
	width: 1.1rem;
	text-align: center;
	color: var(--e-global-color-vamtam_accent_2, #BB7822);
	font-size: 0.95rem;
}
.vhc-mega__list--desc a {
	padding-block-end: 0.1rem;
}
.vhc-mega__list a:hover {
	background-color: rgba(0, 0, 0, 0.04);
}
.vhc-mega__list-desc {
	display: block;
	padding: 0 0 0.6rem 2.85rem;
	font-size: var(--vhc-fs-caption);
	color: rgba(0, 0, 0, 0.83);
	line-height: var(--vhc-lh-body);
}

/* Column 3 — promotional highlight panel: a real photograph from the
   site's own media library (uploads/2026/06/Grenada.jpg — already used
   for this exact slot in both the original CBI and RBI templates) under
   a dark-green gradient, exactly as originally built. Set via inline
   style="--vhc-mega-promo-img:url(...)" per markup (see header-markup),
   not hardcoded here, so CBI/RBI can share this one ruleset. */
.vhc-mega__promo {
	position: relative;
	min-height: 15rem;
	border-radius: var(--vhc-radius-sm);
	padding: var(--vhc-space-md) var(--vhc-space-sm) var(--vhc-space-sm);
	background-image: var(--vhc-mega-promo-img);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
}
/* Darkest at the BOTTOM, where the title/description/button sit, fading
   to the bare photo at the top — the original template's gradient direction
   (dark at 45% fading OUT toward the bottom) left the text zone as the
   MOST transparent part, washing out the gold CTA against a bright photo.
   Flipped here for legibility; everything else about the panel matches
   the original (same photo, same dark-green color, same 88% opacity). */
.vhc-mega__promo::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: linear-gradient(0deg, var(--e-global-color-vamtam_accent_1, #0F2317) 0%, var(--e-global-color-vamtam_accent_1, #0F2317) 45%, rgba(15, 35, 23, 0) 100%);
	opacity: 0.88;
}
.vhc-mega__promo > * {
	position: relative;
}
.vhc-mega__promo-title {
	font-family: 'Geologica', var(--vhc-font-body);
	font-weight: 700;
	font-size: 1.25rem;
	color: #ffffff;
	margin-block-end: var(--vhc-space-2xs);
}
.vhc-mega__promo-desc {
	font-size: var(--vhc-fs-caption);
	color: rgba(255, 255, 255, 0.88);
	line-height: var(--vhc-lh-body);
	margin-block-end: var(--vhc-space-sm);
}
/* Solid pill, not text-on-photo: guarantees legibility regardless of what
   part of the photo sits behind it (the plain gold-text link this replaced
   was unreadable in real screenshot checks against the brighter parts of
   the image, even after the gradient fix above). */
.vhc-mega__promo .vhc-btn--link {
	display: inline-flex;
	white-space: nowrap;
	background-color: var(--e-global-color-vamtam_accent_2, #BB7822);
	color: var(--e-global-color-vamtam_accent_1, #0F2317);
	padding: 0.5rem 0.9rem;
	border-radius: var(--vhc-radius-pill);
	font-weight: 600;
	font-size: var(--vhc-fs-caption);
}
.vhc-mega__promo .vhc-btn--link:hover {
	background-color: #ffffff;
	color: var(--e-global-color-vamtam_accent_1, #0F2317);
}
.vhc-mega__promo .vhc-btn--link:hover {
	color: #ffffff;
}

/* Header-right cluster: language + CTA */
.vhc-header__right {
	display: flex;
	align-items: center;
	gap: var(--vhc-space-sm);
	flex-shrink: 0;
}

.vhc-lang {
	position: relative;
}
/* Elementor's global Kit CSS (post-5.css) ships a default <button> padding/
   border/font (~1.75em/0.875em) that beats these plain-class rules on load
   order. All custom <button>-based controls in the header/mobile-nav need
   !important on the properties the Kit also declares, or they inherit huge
   Kit padding — see vhc-typography-global.css for the same pattern. */
.vhc-lang__trigger {
	display: flex;
	align-items: center;
	gap: 0.3em;
	background: none !important;
	border: 1px solid var(--vhc-color-border) !important;
	border-radius: var(--vhc-radius-pill);
	padding: 0.35rem 0.75rem !important;
	font-size: var(--vhc-fs-caption) !important;
	font-family: var(--vhc-font-body);
	font-weight: 600;
	color: var(--vhc-color-text);
	cursor: pointer;
	letter-spacing: 0.02em;
	line-height: normal;
}
.vhc-lang__trigger:hover { border-color: var(--vhc-color-accent-gold); }
.vhc-lang__menu {
	position: absolute;
	top: calc(100% + 8px);
	inset-inline-end: 0;
	background: var(--vhc-color-bg);
	border: 1px solid var(--vhc-color-border);
	border-radius: var(--vhc-radius-sm);
	box-shadow: var(--vhc-shadow-md);
	padding: var(--vhc-space-3xs);
	min-width: 9rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 160ms var(--vhc-ease-out), transform 160ms var(--vhc-ease-out), visibility 160ms;
	z-index: var(--vhc-z-dropdown);
}
.vhc-lang.is-open .vhc-lang__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.vhc-lang__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.5rem 0.6rem !important;
	font-size: var(--vhc-fs-caption) !important;
	font-family: var(--vhc-font-body);
	color: var(--vhc-color-text);
	background: none !important;
	border: none !important;
	border-radius: var(--vhc-radius-sm);
	cursor: pointer;
	text-align: start;
	line-height: normal;
}
.vhc-lang__option:hover { background-color: var(--vhc-color-surface); }
.vhc-lang__option[aria-disabled="true"] {
	color: var(--vhc-color-text-muted);
	cursor: not-allowed;
}
.vhc-lang__option[aria-disabled="true"]:hover { background: none; }
.vhc-lang__soon {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--vhc-color-text-muted);
}

.vhc-header__cta {
	display: none;
}
@media (min-width: 1200px) {
	.vhc-header__cta { display: inline-flex; }
}

/* Mobile trigger */
.vhc-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0 !important;
	background: none !important;
	border: none !important;
	cursor: pointer;
	color: var(--vhc-color-primary);
	flex-shrink: 0;
}
@media (min-width: 1200px) {
	.vhc-menu-toggle { display: none; }
}
.vhc-menu-toggle__bars {
	position: relative;
	width: 1.5rem;
	height: 1rem;
	flex-shrink: 0;
}
.vhc-menu-toggle__bars span {
	position: absolute;
	inset-inline: 0;
	height: 2px;
	background: currentColor;
	transition: transform 220ms var(--vhc-ease-out), opacity 220ms var(--vhc-ease-out);
}
.vhc-menu-toggle__bars span:nth-child(1) { top: 0; }
.vhc-menu-toggle__bars span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.vhc-menu-toggle__bars span:nth-child(3) { bottom: 0; }
.vhc-menu-toggle[aria-expanded="true"] .vhc-menu-toggle__bars span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.vhc-menu-toggle[aria-expanded="true"] .vhc-menu-toggle__bars span:nth-child(2) {
	opacity: 0;
}
.vhc-menu-toggle[aria-expanded="true"] .vhc-menu-toggle__bars span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
	.vhc-header__mobile-lang { display: none; }
}

/* Reduced motion: kill transform/opacity transitions, keep instant state changes */
@media (prefers-reduced-motion: reduce) {
	.vhc-header,
	.vhc-header__inner,
	.vhc-header__logo img,
	.vhc-mega,
	.vhc-lang__menu,
	.vhc-nav__caret,
	.vhc-menu-toggle__bars span {
		transition-duration: 0.01ms !important;
	}
}
