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

#site-navigation {
	position: relative;
}

.main-navigation {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

/* ============================================
   Hamburger Menu Button (Mobile)
   ============================================ */

.menu-toggle {
	display: none;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 10px;
	z-index: 1001;
	position: relative;
	right: 0;
	margin-left: auto;
}

.menu-toggle:focus {
	background-color: rgba(255, 255, 255, 0.2);
}

/* Hamburger Icon */
.menu-toggle {
	color: #ffffff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
}

.menu-toggle::before {
	content: '';
	display: block;
	width: 24px;
	height: 2px;
	background: #ffffff;
	box-shadow: 0 8px 0 #ffffff, 0 -8px 0 #ffffff;
	transition: all 0.3s ease;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Hamburger Icon - Active State */
#site-navigation.toggled .menu-toggle::before {
	background: transparent;
	box-shadow: 0 0 0 transparent, 0 0 0 transparent;
}

#site-navigation.toggled .menu-toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 24px;
	height: 2px;
	background: #ffffff;
	display: block;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

#site-navigation.toggled .menu-toggle::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-45deg);
	width: 24px;
	height: 2px;
	background: #ffffff;
	display: block;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ============================================
   Menu Container
   ============================================ */

.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0;
}

.main-navigation li {
	margin: 0;
	position: relative;
}

.main-navigation a {
	display: block;
	padding: 1em 1.5em;
	text-decoration: none;
	color: #ffffff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
	transition: color 0.3s ease, background-color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
	color: #ffffff;
	text-decoration: underline;
}

/* ============================================
   Desktop Navigation (Default)
   ============================================ */

@media screen and (min-width: 768px) {

	/* Navigation bar - full width, 80px tall, positioned at bottom */
	.main-navigation {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		top: 60px;
		width: 100%;
		height: 80px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: var(--panel-bg);
		backdrop-filter: blur(6px);
	}

	.menu-toggle {
		display: none;
	}

	.main-navigation ul {
		flex-direction: row;
		position: relative;
		background: transparent;
		box-shadow: none;
		width: 100%;
		max-width: 1600px;
		height: 100%;
		overflow: visible;
		padding: 0 2em;
		margin: 0 auto;
		justify-content: center;
		align-items: center;
		gap: 0;
		max-width: 1470px;
	}

	.main-navigation li {
		display: flex;
		height: 100%;
		align-items: center;
		justify-content: center;
		position: relative;
		flex: 1;
	}

	.main-navigation a {
		padding: 0 1rem;
		/* white-space: nowrap; */
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 0.9rem;
	}

	.main-navigation > ul > li > a {
		max-width: 13rem;
		line-height: 1.4;
		text-align: center;
	}

	/* Homepage link repurposed as logo spacer — slightly wider, text hidden, logo shows through */
	.nav-logo-spacer {
		flex: 1.05;
	}

	.nav-logo-spacer a {
		color: transparent;
		pointer-events: none;
	}
}

/* ============================================
   Medium Desktop Navigation (940px+)
   ============================================ */

@media screen and (min-width: 940px) {
	.main-navigation a {
		padding: 0 1.5em;
		font-size: 1rem;
	}

}

/* ============================================
   Large Desktop Navigation (1200px+)
   ============================================ */

@media screen and (min-width: 1200px) {
	.main-navigation a {
		font-size: 1.15rem;
	}
}


/* ============================================
   Mobile Navigation (Fullscreen Overlay)
   ============================================ */

@media screen and (max-width: 767px) {
	.menu-toggle {
		display: block;
	}

	.main-navigation ul {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: #1a1a1a;
		flex-direction: column;
		justify-content: flex-start;
		align-items: stretch;
		width: 100vw;
		height: 100vh;
		z-index: 1000;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		padding: 4em 0 2em 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		margin: 0;
	}

	#site-navigation.toggled ul,
	.main-navigation.toggled ul {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.main-navigation li {
		width: 100%;
		text-align: left;
		margin: 0;
		display: block;
	}

	.main-navigation a {
		padding: 1.5em 2em;
		font-size: 1.25em;
		color: #ffffff;
		width: 100%;
		display: block;
		text-shadow: none;
	}

	.main-navigation a:hover,
	.main-navigation a:focus {
		background-color: rgba(255, 255, 255, 0.1);
		text-decoration: none;
	}

	/* Home link appears first in the mobile menu */
	.mobile-home-item {
		order: -1;
	}

	/* Sub-menus: plain block flow, always visible, indented under their parent */
	.main-navigation ul ul {
		display: block;
		position: static;
		float: none;
		left: auto;
		top: auto;
		height: auto;
		width: 100%;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		background: transparent;
		box-shadow: none;
		padding: 0 0 0.5em 0;
		margin: 0;
		z-index: auto;
		overflow: visible;
		transition: none;
	}

	.main-navigation ul ul li {
		display: block;
		width: 100%;
	}

	.main-navigation ul ul a {
		display: block;
		width: 100%;
		padding: 0.6em 2em 0.6em 3em;
		font-size: 1em;
		color: rgba(255, 255, 255, 0.65);
		background: transparent;
		border-radius: 0;
		text-shadow: none;
	}

	.main-navigation ul ul a:hover,
	.main-navigation ul ul a:focus {
		background-color: rgba(255, 255, 255, 0.08);
		color: #ffffff;
	}

	/* Prevent body scroll when menu is open */
	body.menu-open {
		overflow: hidden;
	}
}

/* ============================================
   Dropdown Menus (Desktop)
   ============================================ */

@media screen and (min-width: 768px) {
	.main-navigation ul ul {
		position: absolute;
		top: 100%;
		left: 50%;
		background: var(--panel-bg);
		backdrop-filter: blur(6px);
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
		min-width: 200px;
		flex-direction: column;
		opacity: 0;
		left: auto;
		visibility: hidden;
		/* transform: translateX(-50%); */
		transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
		padding: 0.5em 0;
		text-align: center;
	}

	.main-navigation li:hover > ul,
	.main-navigation li.focus > ul {
		opacity: 1;
		visibility: visible;
	}

	.main-navigation ul ul li {
		display: block;
		width: 100%;
	}

	.main-navigation ul ul a {
		margin: 0 auto;
	}

	/* Nested dropdowns */
	.main-navigation ul ul ul {
		top: 0;
		left: 100%;
	}
}

/* ============================================
   Accessibility
   ============================================ */

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}


/* Skip link */
.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999999;
}

.skip-link:focus {
	left: 6px;
	top: 7px;
	width: auto;
	height: auto;
	padding: 8px 16px;
	background: #000;
	color: #fff;
	text-decoration: none;
}

