/**
 * Courses mega menu — full-width "Study Areas" panel, ported from the
 * Next.js reference site.
 */

.fc-mega[hidden] {
	display: none;
}

/* The panel is centred on the viewport, so the menu item must not become the
   containing block and the header must. Elementor gives every container and
   widget "position: relative", so the panel would otherwise centre on the nav
   widget and overflow the right edge once the header goes full width.
   :has() keeps this to the few wrappers that actually hold a panel. */
.fc-has-mega,
header .elementor-element:has(.fc-mega) {
	position: static !important;
}

.ehf-header #masthead,
.ehf-header .site-header {
	position: sticky;
}

/* The builder's plain dropdown is replaced by the panel. */
.fc-has-mega > ul.sub-menu {
	display: none !important;
}

.fc-mega {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 1000;
	width: min(1200px, calc(100vw - 3rem));
	transform: translate(-50%, 8px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.fc-mega-open .fc-mega {
	transform: translate(-50%, 0);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.fc-mega__inner {
	display: flex;
	gap: 2rem;
	padding: 2rem;
	border-radius: 0.75rem;
	background: #fff;
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.fc-mega__main {
	flex: 1;
	min-width: 0;
}

/* The panel lives inside a menu <li>, so the header's link styling (uppercase,
   padding, hover underlines) has to be neutralised first. */
.fc-mega a {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
}

.fc-mega ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fc-mega__eyebrow {
	margin: 0 0 1.25rem;
	color: #077e86;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.fc-mega__areas {
	display: grid;
	grid-template-columns: repeat(var(--fc-mega-cols, 3), minmax(0, 1fr));
	align-content: start;
	gap: 1.5rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fc-mega__area {
	margin: 0;
}

.fc-mega__area > a {
	display: flex;
	align-items: flex-start;
	gap: 0.875rem;
	padding: 0;
	color: inherit;
	text-decoration: none;
}

/* The image is fixed at a small landscape crop — the theme's global
   "img { height: auto }" would otherwise let the full-size file through. */
.fc-mega__area .fc-mega__thumb {
	flex: 0 0 64px;
	width: 64px !important;
	height: 48px !important;
	max-width: 64px;
	border-radius: 0.375rem;
	object-fit: cover;
	transition: opacity 0.2s ease;
}

.fc-mega__area > a:hover .fc-mega__thumb {
	opacity: 0.85;
}

/* Items without a thumbnail keep their sub-links flush left. */
.fc-mega__area:not(:has(.fc-mega__thumb)) ul.fc-mega__sublist {
	margin-left: 0;
}

.fc-mega__text {
	display: block;
	min-width: 0;
}

.fc-mega__title {
	display: block;
	color: #0f172a;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
	transition: color 0.2s ease;
}

.fc-mega__area > a:hover .fc-mega__title {
	color: #077e86;
}

.fc-mega__icon {
	margin-right: 0.375rem;
	font-size: 0.875rem;
}

.fc-mega__desc {
	display: block;
	margin-top: 0.3rem;
	color: #64748b;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.5;
}

/* Third-level items render as a compact link list, indented to line up with
   the tile's text column and separated by a hairline rule.
   The ul selector is needed to outrank the ".fc-mega ul" reset above. */
ul.fc-mega__sublist {
	margin: 0.6rem 0 0 calc(64px + 0.875rem);
	padding: 0 0 0 0.75rem;
	border-left: 2px solid #e2e8f0;
	list-style: none;
}

.fc-mega__sublist li {
	margin: 0;
}

.fc-mega__sublist a {
	display: block;
	padding: 0.2rem 0;
	color: #475569;
	font-size: 0.8125rem;
	line-height: 1.45;
	text-decoration: none;
	transition: color 0.2s ease;
}

.fc-mega__sublist a:hover {
	color: #077e86;
}

.fc-mega__promo {
	position: relative;
	display: flex;
	align-items: flex-end;
	flex: 0 0 288px;
	overflow: hidden;
	border-radius: 0.75rem;
	background: linear-gradient(160deg, #0b3f52, #077e86);
	background-position: center;
	background-size: cover;
	color: #fff;
}

.fc-mega__promo::after {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(6, 44, 56, 0.15), rgba(6, 44, 56, 0.85));
	content: "";
}

.fc-mega__promo-body {
	position: relative;
	z-index: 1;
	padding: 1.5rem;
}

.fc-mega__promo-body h3 {
	margin: 0 0 0.5rem;
	color: #fff;
	font-size: 1.25rem;
	font-weight: 700;
}

.fc-mega__promo-body p {
	margin: 0 0 1.25rem;
	font-size: 0.875rem;
	line-height: 1.5;
	opacity: 0.9;
}

a.fc-mega__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.25rem;
	border-radius: 0.5rem;
	background: #077e86;
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.025em;
	text-decoration: none;
	text-transform: uppercase;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

a.fc-mega__cta:hover {
	background: #055c62;
	color: #fff;
	transform: translateY(-2px);
}

@media (max-width: 1200px) {
	.fc-mega__inner {
		gap: 1.5rem;
		padding: 1.5rem;
	}

	.fc-mega__promo {
		flex-basis: 240px;
	}
}

@media (max-width: 1024px) {
	.fc-mega {
		display: none;
	}
}
