/**
 * AlexaHire Mega Menu CSS
 *
 * Provides dropdown and mega-menu styles for .ah-nav.
 * Mobile breakpoint: 1024px — dropdowns become accordion-style.
 */

/* ============================================================
   Base Navigation
   ============================================================ */

.ah-nav {
	display: flex;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ah-nav__item {
	position: static;
}

.ah-nav__link {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 14px;
	color: #374151;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 8px;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.ah-nav__link:hover,
.ah-nav__link:focus-visible {
	background: #f0f7ff;
	color: #2563eb;
	outline: none;
}

.ah-nav__link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

/* Chevron icon inside link */
.ah-nav__link .ah-nav__chevron {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
	color: #9ca3af;
}

/* ============================================================
   Dropdown Wrapper
   ============================================================ */

.ah-nav__item--has-dropdown {
	position: relative;
}

.ah-nav__dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 220px;
	background: #ffffff;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
	border-radius: 12px;
	border-top: 3px solid #2563eb;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 1000;
	visibility: hidden;
	padding: 8px 0;
}

/* Arrow pointer */
.ah-nav__dropdown::before {
	content: '';
	position: absolute;
	top: -9px;
	left: 20px;
	width: 0;
	height: 0;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-bottom: 7px solid #2563eb;
}

/* ============================================================
   Dropdown Open State (Hover)
   ============================================================ */

.ah-nav__item--has-dropdown:hover > .ah-nav__dropdown,
.ah-nav__item--has-dropdown:focus-within > .ah-nav__dropdown {
	opacity: 1;
	pointer-events: all;
	transform: translateY(0);
	visibility: visible;
}

.ah-nav__item--has-dropdown:hover > .ah-nav__link .ah-nav__chevron,
.ah-nav__item--has-dropdown:focus-within > .ah-nav__link .ah-nav__chevron {
	transform: rotate(180deg);
}

/* ============================================================
   Dropdown Links
   ============================================================ */

.ah-nav__dropdown-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	color: #374151;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 8px;
	margin: 0 8px;
	transition: background 0.15s ease, color 0.15s ease;
}

.ah-nav__dropdown-link:hover,
.ah-nav__dropdown-link:focus-visible {
	background: #f0f7ff;
	color: #2563eb;
	outline: none;
}

.ah-nav__dropdown-link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

/* Optional icon inside dropdown link */
.ah-nav__dropdown-link-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: #6b7280;
	transition: color 0.15s ease;
}

.ah-nav__dropdown-link:hover .ah-nav__dropdown-link-icon,
.ah-nav__dropdown-link:focus-visible .ah-nav__dropdown-link-icon {
	color: #2563eb;
}

/* ============================================================
   Mega Menu Group Layout
   ============================================================ */

.ah-nav__dropdown--mega {
	min-width: 480px;
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	padding: 8px;
}

.ah-nav__dropdown-group {
	flex: 1;
	min-width: 200px;
	padding: 0;
}

.ah-nav__dropdown-group-title {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #9ca3af;
	padding: 12px 20px 4px;
	margin: 0;
}

.ah-nav__dropdown-divider {
	height: 1px;
	background: #f3f4f6;
	margin: 6px 12px;
}

/* ============================================================
   Dropdown right-aligned variant
   ============================================================ */

.ah-nav__item--has-dropdown.ah-dropdown--right .ah-nav__dropdown {
	left: auto;
	right: 0;
}

.ah-nav__item--has-dropdown.ah-dropdown--right .ah-nav__dropdown::before {
	left: auto;
	right: 20px;
}

/* ============================================================
   Smooth Entry Animation
   ============================================================ */

@keyframes ah-dropdown-in {
	from {
		opacity: 0;
		transform: translateY(-6px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.ah-nav__item--has-dropdown:hover > .ah-nav__dropdown {
	animation: ah-dropdown-in 0.18s ease forwards;
}

/* ============================================================
   Mobile Styles — max-width: 1024px
   (Desktop .ah-nav is strictly hidden on mobile/tablet.
    Mobile navigation is handled entirely by .ah-mobile-drawer)
   ============================================================ */

@media (max-width: 1024px) {
	.ah-nav {
		display: none !important;
		visibility: hidden !important;
	}
}

/* ============================================================
   Focus / keyboard accessibility
   ============================================================ */

.ah-nav__item--has-dropdown:focus-within > .ah-nav__link {
	color: #2563eb;
}

/* High-contrast / forced-colors support */
@media (forced-colors: active) {
	.ah-nav__dropdown {
		border: 2px solid ButtonText;
	}
}

/* 3-Column Jobs Mega Menu Desktop */
@media (min-width: 1025px) {
	.ah-jobs-mega {
		min-width: 720px;
		display: grid;
		grid-template-columns: 1fr 1fr 1.15fr;
		gap: 12px;
		padding: 16px;
		border-radius: 16px;
		box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.8);
	}
	.ah-group--highlight {
		background: #f8fbff;
		border: 1px solid #e0eefd;
		border-radius: 12px;
		padding: 6px 4px;
	}
}
