/* ================================================================
 * JA Canada Mega Menu — Frontend Styles
 *
 * Identical to the HTML embed CSS. Selectors and values are
 * unchanged so the rendered output is byte-for-byte the same.
 * ================================================================ */

.ja-header, .ja-header * { box-sizing: border-box; }

/* ============ PRE-NAV ============ */
.ja-prenav {
	background: #285F74;
	width: 100%;
	padding: 0 24px;
	position: relative;
	z-index: 1001;
}
.ja-prenav-inner {
	max-width: 100%;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 0;
	min-height: 36px;
}
.ja-prenav a,
.ja-prenav span {
	font-family: 'Montserrat', system-ui, sans-serif;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.88);
	text-decoration: none;
	padding: 8px 16px;
	white-space: nowrap;
	transition: color 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	position: relative;
}
.ja-prenav a::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 1em;
	background: rgba(255, 255, 255, 0.4);
}
.ja-prenav a:first-child::before { display: none; }
.ja-prenav a:hover { color: #FFFFFF; }
.ja-prenav .ja-lang-active { color: #FFFFFF; }
.ja-prenav .ja-globe { width: 14px; height: 14px; opacity: 0.88; }

@media (max-width: 900px) {
	.ja-prenav { padding: 0 16px; }
	.ja-prenav-inner { justify-content: center; }
	.ja-prenav a,
	.ja-prenav span {
		font-size: 0.75rem;
		padding: 9px 12px;
		letter-spacing: 0.06em;
	}
}
@media (max-width: 600px) {
	.ja-prenav-inner { justify-content: center; gap: 0; }
	.ja-prenav a,
	.ja-prenav span { font-size: 0.72rem; padding: 9px 10px; }
	.ja-prenav a::before { background: rgba(255, 255, 255, 0.3); }
}
@media (max-width: 420px) {
	.ja-prenav a,
	.ja-prenav span {
		font-size: 0.68rem;
		padding: 8px 8px;
		letter-spacing: 0.04em;
	}
}

/* ============ MAIN NAV ============ */
.ja-nav {
	background: #F0F4F5;
	width: 100%;
	position: relative;
	font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
	z-index: 1000;
}
.ja-nav-inner {
	margin: 0 auto;
	padding: 18px 24px;
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Logo.
 * Size is forced with !important because themes and Elementor commonly
 * apply `img { max-width: 100%; height: auto }` with !important, which
 * would let the logo render at native (often 600px+) size. We pin both
 * height and max-height/max-width so the constraint can't slip. */
.ja-header .ja-nav-logo {
	display: flex !important;
	align-items: center !important;
	gap: 16px !important;
	text-decoration: none !important;
	flex-shrink: 0 !important;
	flex-grow: 0 !important;
	flex-basis: auto !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
}
.ja-header .ja-nav-logo img,
.ja-header .ja-nav-logo svg {
	height: 56px !important;
	width: auto !important;
	max-height: 56px !important;
	max-width: 320px !important;
	min-height: 0 !important;
	min-width: 0 !important;
	display: block !important;
	object-fit: contain !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

/* Nav items list */
.ja-nav-items {
	display: flex;
	align-items: center;
	gap: 2px;
	list-style: none;
	margin: 0 0 0 auto;
	padding: 0;
}
.ja-nav-item {
	position: static;
	display: inline-flex;
	align-items: center;
}

/* Channel label link + caret button as split trigger */
.ja-nav-link {
	padding: 12px 4px 12px 18px;
	font-size: 1rem;
	font-weight: 700;
	color: #1B3A47;
	text-decoration: none;
	transition: color 0.2s;
	font-family: inherit;
	letter-spacing: 0.01em;
}

/* ============================================================
 * AGGRESSIVE BUTTON RESET
 *
 * Elementor and many themes apply opinionated styles to every
 * <button> element — borders, backgrounds, padding, min sizes,
 * box-shadows, text-transform, letter-spacing. They use selectors
 * like `.elementor button` (specificity 0,0,1,1) or `body button`
 * which can override our component styles.
 *
 * We neutralize all of those by resetting EVERY button inside
 * .ja-header with !important. Component-specific buttons
 * (.ja-nav-caret, .ja-nav-mobile-toggle, .ja-nav-donate) then
 * apply their own padding/sizing on top, also with !important
 * so the responsive breakpoint overrides keep working.
 * ============================================================ */
.ja-header button,
.ja-header button:hover,
.ja-header button:focus,
.ja-header button:active,
.ja-nav button,
.ja-nav button:hover,
.ja-nav button:focus,
.ja-nav button:active {
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	outline: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-weight: inherit;
	font-family: inherit;
	color: inherit;
	margin: 0 !important;
	transform: none !important;
	transition: color 0.2s;
}

/* Caret button specifics. */
.ja-nav .ja-nav-caret {
	padding: 12px 18px 12px 4px !important;
	cursor: pointer;
	color: #1B3A47;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}
.ja-nav-caret svg {
	width: 10px;
	height: 10px;
	transition: transform 0.2s;
}
.ja-nav-item:hover .ja-nav-link,
.ja-nav-item:hover .ja-nav-caret,
.ja-nav-item.is-active .ja-nav-link,
.ja-nav-item.is-active .ja-nav-caret {
	color: #2EA3A9;
}
.ja-nav-item.is-active .ja-nav-caret svg {
	transform: rotate(180deg);
}

/* Donate */
.ja-nav-donate {
	display: inline-flex;
	align-items: center;
	padding: 14px 34px;
	background: #285F74;
	color: #FFFFFF;
	border-radius: 999px;
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	transition: background 0.2s;
	flex-shrink: 0;
	font-family: inherit;
}
.ja-nav-donate:hover {
	background: #1B3A47;
	color: #FFFFFF;
}

/* ============ MEGA PANEL ============ */
.ja-mega {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #FFFFFF;
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	z-index: 999;
}
.ja-mega.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.ja-mega-inner {
	display: grid;
	grid-template-columns: 500px 1fr;
	min-height: 360px;
}

/* Left feature */
.ja-mega-feature {
	position: relative;
	background-size: cover;
	background-position: center;
	background-color: #1B3A47;
	padding: 48px 40px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	color: #FFFFFF;
	min-height: 360px;
}
.ja-mega-feature::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(40, 95, 116, 0.85), rgba(46, 163, 169, 0.55));
	z-index: 1;
}
.ja-mega-feature > * { position: relative; z-index: 2; }
.ja-mega-feature-title {
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 16px;
	line-height: 1.1;
}
.ja-mega-feature-desc {
	font-size: 0.95rem;
	line-height: 1.55;
	margin: 0 0 28px;
	font-weight: 400;
}
.ja-mega-feature-link {
	color: #FFFFFF;
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.5);
	padding-bottom: 4px;
	align-self: flex-start;
	transition: border-color 0.2s;
}
.ja-mega-feature-link:hover {
	color: #FFFFFF;
	border-bottom-color: #FFFFFF;
}

/* Per-panel overlay colors */
.ja-mega[data-panel="about"] .ja-mega-feature::before {
	background: linear-gradient(135deg, rgba(227, 201, 0, 0.85), rgba(200, 170, 0, 0.55));
}
.ja-mega[data-panel="learn"] .ja-mega-feature::before {
	background: linear-gradient(135deg, rgba(27, 58, 71, 0.85), rgba(46, 163, 169, 0.45));
}
.ja-mega[data-panel="impact"] .ja-mega-feature::before {
	background: linear-gradient(135deg, rgba(37, 110, 83, 0.85), rgba(73, 158, 89, 0.55));
}
.ja-mega[data-panel="get-involved"] .ja-mega-feature::before {
	background: linear-gradient(135deg, rgba(46, 163, 169, 0.75), rgba(120, 180, 190, 0.55));
}

/* About panel uses dark typography since its overlay is lighter */
.ja-mega[data-panel="about"] .ja-mega-feature,
.ja-mega[data-panel="about"] .ja-mega-feature-link {
	color: #22404D;
}
.ja-mega[data-panel="about"] .ja-mega-feature-link {
	border-bottom-color: rgba(34, 64, 77, 0.5);
}
.ja-mega[data-panel="about"] .ja-mega-feature-link:hover {
	color: #22404D;
	border-bottom-color: #22404D;
}

/* Right columns */
.ja-mega-content {
	padding: 48px 64px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-content: start;
	max-width: 1100px;
}
.ja-mega-col {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.ja-mega-col-heading {
	font-size: 1rem;
	font-weight: 700;
	color: #1B3A47;
	margin: 0 0 4px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
}
a.ja-mega-col-heading:hover { color: #2EA3A9; }
.ja-mega-col-desc {
	font-size: 0.9rem;
	color: #5A6670;
	line-height: 1.55;
	margin: 0;
	font-weight: 400;
}
.ja-mega-link {
	font-size: 0.95rem;
	font-weight: 700;
	color: #1B3A47;
	text-decoration: none;
	transition: color 0.2s;
	display: inline-flex;
	align-items: center;
}
.ja-mega-link:hover { color: #2EA3A9; }
.ja-mega-ext-icon {
	width: 10px;
	height: 10px;
	margin-left: 6px;
	opacity: 0.6;
}

/* Mobile hamburger.
 * `display: none` uses !important because Elementor's button rules
 * apply `display: inline-block` with similar specificity and would
 * otherwise show this on desktop. Mobile breakpoint flips it back. */
.ja-nav-mobile-toggle {
	display: none !important;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	cursor: pointer;
	flex-shrink: 0;
}
.ja-nav-mobile-toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background: #1B3A47;
	margin: 5px auto;
	transition: 0.25s;
}
.ja-nav.is-mobile-open .ja-nav-mobile-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ja-nav.is-mobile-open .ja-nav-mobile-toggle span:nth-child(2) { opacity: 0; }
.ja-nav.is-mobile-open .ja-nav-mobile-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
	.ja-nav-inner { padding: 16px 24px; }
	.ja-nav-link { padding: 10px 2px 10px 12px; font-size: 0.95rem; }
	.ja-nav .ja-nav-caret { padding: 10px 12px 10px 2px !important; }
	.ja-nav-donate { padding: 12px 26px; font-size: 0.95rem; }
	.ja-mega-content { padding: 40px; gap: 40px; }
	.ja-mega-inner { grid-template-columns: 400px 1fr; }
}
@media (max-width: 900px) {
	.ja-nav-inner { padding: 14px 20px; flex-wrap: wrap; }
	.ja-nav-items,
	.ja-nav-donate { display: none; }
	/* Three-class selector deliberately. The button reset above defines
	 * separate `.ja-header button:hover`, `:focus`, `:active` rules with
	 * `margin: 0 !important` — each pseudo-class adds to specificity
	 * (0,2,1). A two-class override (0,2,0) loses to those on touch,
	 * making the hamburger snap to the middle on tap and back to the
	 * right when focus moves away. (0,3,0) beats all four reset
	 * variants at any state. */
	.ja-header .ja-nav .ja-nav-mobile-toggle {
		display: block !important;
		margin-left: auto !important;
	}

	.ja-nav.is-mobile-open .ja-nav-items {
		display: flex;
		flex-direction: column;
		width: 100%;
		gap: 0;
		margin: 12px 0 0;
		padding: 12px 0 0;
		border-top: 1px solid #D8DEE1;
		max-height: calc(100vh - 180px);
		overflow-y: auto;
	}
	.ja-nav.is-mobile-open .ja-nav-donate {
		display: inline-flex;
		margin: 16px 0 4px;
		width: 100%;
		justify-content: center;
	}
	.ja-nav-item {
		width: 100%;
		border-bottom: 1px solid #E5E9EB;
		justify-content: space-between;
	}
	.ja-nav-link {
		flex: 1;
		padding: 16px 8px 16px 4px;
	}
	.ja-nav .ja-nav-caret {
		padding: 12px 16px !important;
		min-width: 48px !important;
		min-height: 44px !important;
	}
	.ja-mega {
		position: static;
		box-shadow: none;
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: #F7FAFB;
		grid-column: 1 / -1;
		width: 100%;
	}
	.ja-mega.is-open { display: block; }
	.ja-mega-inner {
		grid-template-columns: 1fr;
		min-height: 0;
	}
	.ja-mega-feature {
		padding: 28px 24px;
		min-height: 180px;
	}
	.ja-mega-feature-title { font-size: 1.5rem; margin-bottom: 10px; }
	.ja-mega-feature-desc { margin-bottom: 20px; }
	.ja-mega-content {
		grid-template-columns: 1fr;
		padding: 24px 20px;
		gap: 24px;
	}
}
@media (max-width: 500px) {
	.ja-header .ja-nav-logo img,
	.ja-header .ja-nav-logo svg {
		height: 52px !important;
		max-height: 52px !important;
	}
}
