/* =====================================================================
   BAEA Header — styles for the "BAEA Header" block
   All rules are scoped to the header, so they no longer reset the rest of
   the site (the old global "* { margin:0; padding:0 }" did).
   ===================================================================== */

:root {
	--baea-green: #339a5a;
	--baea-green-dark: #267a46;
	--baea-red: #ae211f;
	--baea-charcoal: #312c2c;
	--baea-gold: #ffde3f;
	--baea-gold-light: #fff3c9;
	--baea-white: #ffffff;
	--baea-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
	--baea-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
	--baea-transition: all 0.3s ease;
	--baea-topbar-bg: #1f5e3c;
	--baea-topbar-text: #fef9e6;
	--baea-menu-text: #1e293b;
	--baea-menu-border: #e2e8f0;
	--baea-menu-hover: #f1f5f9;
	--baea-font: 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--baea-font-display: 'Anek Bangla', 'Hind Siliguri', system-ui, sans-serif;
	/* Same font stack as the original HTML header (used for the logo text) */
	--baea-font-logo: 'Segoe UI', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

/* Twenty Twenty-Four wraps template parts in <header class="wp-block-template-part">.
   Making that wrapper "transparent" lets the BAEA header stay sticky while scrolling. */
.wp-block-template-part:has(> .baea-header) {
	display: contents;
}
/* No theme block-gap between the top bar and the header */
.wp-site-blocks > .baea-header,
.wp-site-blocks > .mobile-nav-overlay,
.wp-site-blocks > .mobile-nav,
.wp-block-template-part > .baea-header {
	margin-block-start: 0 !important;
}

/* ---------- Scoped reset ---------- */
.baea-top-bar,
.baea-header,
.mobile-nav,
.mobile-nav-overlay {
	box-sizing: border-box;
	font-family: var(--baea-font);
}
.baea-top-bar *,
.baea-header *,
.mobile-nav * {
	box-sizing: border-box;
}
.baea-top-bar ul,
.baea-header ul,
.mobile-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.baea-top-bar a,
.baea-header a,
.mobile-nav a {
	text-decoration: none;
}
/* Hide focus ring for mouse clicks, keep it for keyboard users */
.baea-top-bar :focus:not(:focus-visible),
.baea-header :focus:not(:focus-visible),
.mobile-nav :focus:not(:focus-visible) {
	outline: none;
}
.baea-top-bar :focus-visible,
.baea-header :focus-visible,
.mobile-nav :focus-visible {
	outline: 2px solid var(--baea-green);
	outline-offset: 2px;
}
.baea-header a,
.mobile-nav a,
.mobile-nav button {
	-webkit-tap-highlight-color: transparent;
}
body.baea-menu-open {
	overflow: hidden;
}

/* ========== TOP BAR (desktop only) ========== */
.baea-top-bar {
	background: var(--baea-topbar-bg);
	color: var(--baea-topbar-text);
	font-size: 0.8rem;
	padding: 0.5rem 2rem;
	width: 100%;
	position: relative;
	z-index: 999;
	border-bottom: 1px solid var(--baea-gold);
}
.baea-top-bar .top-bar-container {
	max-width: 1320px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}
.baea-top-bar .top-contact-info {
	display: flex;
	gap: 1.8rem;
	align-items: center;
	flex-wrap: wrap;
}
.baea-top-bar .top-contact-info > a,
.baea-top-bar .top-contact-info > span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--baea-topbar-text);
}
.baea-top-bar .top-contact-info > a:hover {
	color: var(--baea-gold);
}
.baea-top-bar .top-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	fill: #c3c4c7;
}
.baea-top-bar .top-social-links {
	display: flex;
	gap: 1rem;
	align-items: center;
}
.baea-top-bar .top-social-links a {
	color: var(--baea-gold);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	transition: var(--baea-transition);
}
.baea-top-bar .top-social-links a:hover {
	color: var(--baea-white);
	background: var(--baea-green);
	transform: translateY(-2px);
}
.baea-top-bar .top-social-links svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* ========== MAIN HEADER (sticky) ========== */
.baea-header {
	background: var(--baea-white);
	box-shadow: var(--baea-shadow-sm);
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100%;
	transition: var(--baea-transition);
	border-bottom: 2px solid var(--baea-gold);
}
.admin-bar .baea-header {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar .baea-header {
		top: 46px;
	}
}
@media (max-width: 600px) {
	.admin-bar .baea-header {
		top: 0;
	}
}
.baea-header.scrolled {
	box-shadow: var(--baea-shadow-md);
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(2px);
}
.baea-header .header-container {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0.5rem 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 0.1rem;
}

/* ---------- Logo ---------- */
.baea-header .logo-area {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
.baea-header .logo-area > a {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}
.baea-header .logo-img {
	height: 55px;
	width: auto;
	display: block;
	object-fit: contain;
	transition: transform 0.2s;
}
.baea-header .logo-img:hover {
	transform: scale(1.02);
}
.baea-header .logo-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--baea-green);
	color: var(--baea-white);
	font-weight: 700;
	font-size: 0.8rem;
}
.baea-header .logo-text {
	font-family: var(--baea-font-logo);
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}
.baea-header .logo-text h1 {
	display: block;
	margin: 0;
	padding: 0;
	/* Same as the original HTML header: Twenty Twenty-Four's heading font (Cardo) */
	font-family: var(--wp--preset--font-family--heading, 'Cardo', Georgia, serif);
	font-size: 1.25rem;
	font-weight: 700;
	font-style: normal;
	text-transform: none;
	color: var(--baea-green);
	letter-spacing: -0.2px;
	line-height: 1.2;
}
.baea-header .baea-badge {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--baea-charcoal);
	display: inline-block;
	white-space: nowrap;
	line-height: 1.2;
}
.baea-header .est-year {
	color: var(--baea-red);
	font-weight: 700;
	margin-left: 2px;
}
.baea-header .separator {
	margin: 0 2px;
}

/* ---------- Desktop navigation ---------- */
.baea-header .baea-primary-nav {
	display: flex;
	align-items: center;
}
.baea-header .nav-menu {
	display: flex;
	align-items: center;
	gap: 0.05rem;
}
.baea-header .nav-menu .menu-item {
	position: relative;
}
.baea-header .nav-link {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0.45rem 0.7rem;
	font-weight: 600;
	font-size: var(--baea-menu-size, 0.96rem);
	color: var(--baea-charcoal);
	border-radius: 40px;
	transition: var(--baea-transition);
	white-space: nowrap;
}
.baea-header .nav-link:hover,
.baea-header .nav-item.is-open > .nav-link,
.baea-header .nav-item.is-current > .nav-link {
	background: var(--baea-gold-light);
	color: var(--baea-green);
}
.baea-header .dropdown-arrow {
	font-size: 0.65rem;
	margin-left: 3px;
}

/* ---------- Dropdowns (any depth) ---------- */
.baea-header .submenu {
	position: absolute;
	top: 110%;
	left: 0;
	background: var(--baea-white);
	min-width: 250px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
	border-radius: 16px;
	padding: 0.6rem 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: var(--baea-transition);
	z-index: 100;
	border: 1px solid #eef2f0;
}
/* invisible bridge so the menu doesn't close while the mouse crosses the gap */
.baea-header .submenu::before {
	content: '';
	position: absolute;
	top: -14px;
	left: 0;
	right: 0;
	height: 14px;
}
/* 3rd level opens to the side */
.baea-header .submenu .submenu {
	top: -0.6rem;
	left: 100%;
	transform: translateY(8px);
}
.baea-header .submenu .submenu::before {
	top: 0;
	left: -14px;
	right: auto;
	width: 14px;
	height: 100%;
}
/* Items near the right edge open leftwards so they don't go off-screen */
.baea-header .nav-menu > .nav-item:nth-last-child(-n+2) > .submenu {
	left: auto;
	right: 0;
}
.baea-header .nav-menu > .nav-item:nth-last-child(-n+2) .submenu .submenu {
	left: auto;
	right: 100%;
}
.baea-header .nav-menu > .nav-item:nth-last-child(-n+2) .submenu .submenu::before {
	left: auto;
	right: -14px;
}
/* open state: mouse hover, tap (.is-open) or keyboard focus */
.baea-header .menu-item:hover > .submenu,
.baea-header .menu-item.is-open > .submenu,
.baea-header .menu-item:has(:focus-visible) > .submenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.baea-header .submenu-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0.55rem 1.5rem;
	color: var(--baea-charcoal);
	font-size: var(--baea-submenu-size, 0.88rem);
	font-weight: 500;
	transition: all 0.2s;
}
.baea-header .submenu-link:hover,
.baea-header .submenu .menu-item.is-current > .submenu-link,
.baea-header .submenu .menu-item.is-open > .submenu-link {
	background: var(--baea-gold-light);
	color: var(--baea-green);
	padding-left: 1.8rem;
}
.baea-header .dropdown-arrow--side {
	font-size: 0.8rem;
	margin-left: 0;
}

/* ---------- Login button ---------- */
.baea-header .header-action {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
.baea-header .btn-member-login,
.mobile-nav .btn-member-login {
	background: #fff;
	color: #c0392b;
	border: 1.5px solid #f5c6c6;
	padding: 0.55rem 1.5rem;
	border-radius: 50px;
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: var(--baea-transition);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}
.baea-header .btn-member-login:hover,
.mobile-nav .btn-member-login:hover {
	background: #fef2f2;
	color: #a12620;
	border-color: #e6a8a8;
	transform: translateY(-1px);
}

/* ---------- Mobile toggle (hidden on desktop) ---------- */
.baea-header .mobile-toggle {
	display: none;
	flex-direction: column;
	justify-content: space-between;
	width: 30px;
	height: 22px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 1100;
}
.baea-header .mobile-toggle span {
	width: 100%;
	height: 2.5px;
	background: var(--baea-green);
	border-radius: 4px;
	transition: all 0.25s ease;
}
.mobile-nav-overlay,
.mobile-nav {
	display: none;
}

/* ========== RESPONSIVE ========== */
/* Small laptops: tighter spacing so the whole row, with the login button, fits. */
@media (min-width: 1151px) and (max-width: 1300px) {
	.baea-header .header-container {
		padding-left: 1rem;
		padding-right: 1rem;
	}
	.baea-header .nav-link {
		padding: 0.45rem 0.5rem;
		font-size: calc(var(--baea-menu-size, 0.96rem) * 0.96);
	}
	.baea-header .logo-text h1 {
		font-size: 1.15rem;
	}
	.baea-header .logo-img {
		height: 50px;
	}
	.baea-header .btn-member-login {
		padding: 0.5rem 1rem;
		font-size: 0.88rem;
	}
}

@media (max-width: 1100px) {
	.baea-header .nav-link {
		padding: 0.45rem 0.6rem;
		font-size: calc(var(--baea-menu-size, 0.96rem) * 0.96);
	}
	.baea-header .logo-text h1 {
		font-size: 1.15rem;
	}
	.baea-header .logo-img {
		height: 50px;
	}
	.baea-header .btn-member-login {
		padding: 0.5rem 1rem;
		font-size: 0.88rem;
	}
}

@media (max-width: 1000px) {
	.baea-header .nav-link {
		padding: 0.45rem 0.55rem;
		font-size: calc(var(--baea-menu-size, 0.96rem) * 0.92);
	}
	.baea-header .logo-text h1 {
		font-size: 1.05rem;
	}
	.baea-header .baea-badge {
		font-size: 0.6rem;
	}
	.baea-header .btn-member-login {
		padding: 0.45rem 1rem;
		font-size: 0.82rem;
	}
}

@media (max-width: 900px) {
	.baea-top-bar {
		display: none;
	}
}

/* The menu button replaces the menu row from 1150px down, so the row never runs off the screen. */
@media (max-width: 1150px) {
	.baea-header .baea-primary-nav,
	.baea-header .header-action {
		display: none;
	}
	.baea-header .header-container {
		flex-wrap: wrap;
		padding: 0.7rem 1rem;
	}
	.baea-header .mobile-toggle {
		display: flex;
	}

	/* Overlay */
	.mobile-nav-overlay {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
		backdrop-filter: blur(4px);
		z-index: 100050;
		opacity: 0;
		visibility: hidden;
		transition: 0.3s;
		display: block;
	}
	.mobile-nav-overlay.active {
		opacity: 1;
		visibility: visible;
	}

	/* Off-canvas panel */
	.mobile-nav {
		position: fixed;
		top: 0;
		right: -100%;
		width: 85%;
		max-width: 360px;
		height: 100%;
		background: var(--baea-white);
		box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
		z-index: 100060;
		padding: 2rem 1.5rem;
		overflow-y: auto;
		transition: right 0.35s ease;
		display: flex;
		flex-direction: column;
		border-left: 3px solid var(--baea-green);
		visibility: hidden;
	}
	.mobile-nav.active {
		right: 0;
		visibility: visible;
	}
	/* Panel top row: logo (left) + close button (right) */
	.mobile-nav .mobile-nav__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		margin-bottom: 1.25rem;
		padding-bottom: 1rem;
		border-bottom: 1px solid var(--baea-menu-border);
	}
	.mobile-nav .logo-area {
		min-width: 0;
	}
	.mobile-nav .logo-area > a {
		display: flex;
		align-items: center;
		gap: 0.6rem;
		text-decoration: none;
	}
	.mobile-nav .logo-img {
		display: block;
		height: 46px;
		width: auto;
		flex-shrink: 0;
		object-fit: contain;
	}
	.mobile-nav .logo-text {
		display: flex;
		flex-direction: column;
		min-width: 0;
		line-height: 1.2;
		font-family: var(--baea-font-logo);
	}
	.mobile-nav .logo-title {
		font-family: var(--wp--preset--font-family--heading, 'Cardo', Georgia, serif);
		font-size: 0.98rem;
		font-weight: 700;
		color: var(--baea-green);
		letter-spacing: -0.2px;
		line-height: 1.15;
	}
	.mobile-nav .baea-badge {
		margin-top: 2px;
		font-size: 0.62rem;
		font-weight: 500;
		color: var(--baea-charcoal);
		white-space: nowrap;
	}
	.mobile-nav .est-year {
		color: var(--baea-red);
		font-weight: 700;
		margin-left: 2px;
	}
	.mobile-nav .separator {
		margin: 0 2px;
	}
	.mobile-nav .logo-fallback {
		display: flex;
		flex-shrink: 0;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		border-radius: 12px;
		background: var(--baea-green);
		color: var(--baea-white);
		font-weight: 700;
		font-size: 0.8rem;
	}
	.mobile-nav .mobile-close {
		flex-shrink: 0;
		background: var(--baea-menu-hover);
		border: none;
		width: 36px;
		height: 36px;
		border-radius: 50%;
		font-size: 1.5rem;
		cursor: pointer;
		color: var(--baea-charcoal);
		line-height: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: all 0.2s;
		padding: 0;
	}
	.mobile-nav .mobile-close:hover {
		background: var(--baea-gold-light);
		color: var(--baea-red);
	}

	.mobile-nav .mobile-menu-list {
		display: flex;
		flex-direction: column;
		gap: 0.25rem;
	}
	.mobile-nav .mobile-menu-list li {
		width: 100%;
	}
	.mobile-nav .mobile-link {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.8rem 0.5rem;
		font-weight: 600;
		font-size: var(--baea-mobile-size, 1rem);
		color: var(--baea-menu-text);
		border-bottom: 1px solid var(--baea-menu-border);
		transition: all 0.2s;
		border-radius: 8px;
	}
	.mobile-nav .mobile-link:hover,
	.mobile-nav .is-current > .mobile-link,
	.mobile-nav .is-current > .mobile-item-row > .mobile-link {
		color: var(--baea-green);
		background: var(--baea-menu-hover);
		padding-left: 0.8rem;
	}

	/* Parent row: link + toggle button */
	.mobile-nav .mobile-item-row {
		display: flex;
		align-items: stretch;
		border-bottom: 1px solid var(--baea-menu-border);
	}
	.mobile-nav .mobile-item-row > .mobile-link {
		flex: 1;
		border-bottom: none;
	}
	.mobile-nav .mobile-submenu-toggle {
		flex: 0 0 44px;
		background: transparent;
		border: none;
		border-radius: 8px;
		cursor: pointer;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.mobile-nav .mobile-submenu-toggle:hover {
		background: var(--baea-menu-hover);
	}
	.mobile-nav .mobile-dropdown-icon {
		transition: transform 0.2s;
		font-size: 0.7rem;
		color: var(--baea-green);
	}
	.mobile-nav .mobile-menu-item-has-children.open > .mobile-item-row .mobile-dropdown-icon {
		transform: rotate(180deg);
	}

	/* Submenus */
	.mobile-nav .mobile-submenu {
		padding-left: 1rem;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
		background: #f8fafc;
		border-radius: 12px;
	}
	.mobile-nav .mobile-submenu.show {
		max-height: 1200px;
	}
	.mobile-nav .mobile-submenu .mobile-submenu {
		background: #f1f5f9;
	}
	.mobile-nav .mobile-submenu .mobile-link {
		padding: 0.7rem 1rem;
		font-size: calc(var(--baea-mobile-size, 1rem) * 0.9);
		font-weight: 500;
		border-bottom: none;
		color: #475569;
	}
	.mobile-nav .mobile-submenu .mobile-item-row {
		border-bottom: none;
	}
	.mobile-nav .mobile-submenu .mobile-link:hover {
		color: var(--baea-green);
		background: #eef2ff;
		padding-left: 1.3rem;
	}

	.mobile-nav .mobile-action-btn {
		margin-top: 2rem;
		padding-top: 1rem;
		border-top: 1px solid var(--baea-menu-border);
		text-align: center;
	}
	.mobile-nav .mobile-action-btn .btn-member-login {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 480px) {
	.baea-header .header-container {
		padding: 0.7rem 1rem;
	}
	.baea-header .logo-img {
		height: 40px;
	}
	.baea-header .logo-text h1 {
		font-size: 0.85rem;
		line-height: 1.1;
	}
	.baea-header .baea-badge {
		font-size: 0.55rem;
	}
}

/* Small phones: shrink the panel logo so the name stays on 2 lines */
@media (max-width: 400px) {
	.mobile-nav {
		padding: 1.5rem 1rem;
	}
	.mobile-nav .mobile-nav__head {
		gap: 0.5rem;
	}
	.mobile-nav .logo-area > a {
		gap: 0.45rem;
	}
	.mobile-nav .logo-img,
	.mobile-nav .logo-fallback {
		height: 38px;
	}
	.mobile-nav .logo-fallback {
		width: 38px;
	}
	.mobile-nav .logo-title {
		font-size: 0.86rem;
	}
	.mobile-nav .baea-badge {
		font-size: 0.58rem;
	}
	.mobile-nav .mobile-close {
		width: 32px;
		height: 32px;
		font-size: 1.3rem;
	}
}
@media (max-width: 360px) {
	.mobile-nav .logo-img,
	.mobile-nav .logo-fallback {
		height: 32px;
	}
	.mobile-nav .logo-fallback {
		width: 32px;
		font-size: 0.6rem;
	}
	.mobile-nav .logo-title {
		font-size: 0.74rem;
		letter-spacing: -0.3px;
	}
	.mobile-nav .baea-badge {
		font-size: 0.52rem;
	}
	.mobile-nav .mobile-close {
		width: 28px;
		height: 28px;
		font-size: 1.15rem;
	}
}
