/* The navigation styling: */
nav {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%); /* Centers the pill perfectly in the middle */
	max-width: calc(100vw - 24px); /* Never wider than the phone screen */
	background-color: rgba(26, 26, 26, 0.85); /* Dark translucent pill background */
	z-index: 1000;
	font-weight: bold;
	display: flex;
	align-items: center;
	padding: 0.5rem 1.2rem;
	box-sizing: border-box;
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

	nav ul {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		align-items: center;
	}

		nav ul li {
			position: relative;
		}

		nav ul ul {
			display: none;
			position: absolute;
			top: 100%;
			left: 50%;
			transform: translateX(-50%); /* Centered under its parent so it stays on screen on phones */
			width: max-content;
			max-width: min(320px, calc(100vw - 24px));
			background-color: #1a1a1a;
			border-radius: 8px;
			padding: 5px 0;
			box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
		}

/* Hover only opens the dropdown on devices that actually have a mouse.
		   Phones and tablets use the tap toggle in js/main.js instead. */
@media (hover: hover) {
	nav ul li:hover > ul {
		display: block;
	}
}

/* Opened by tap or keyboard (class added by js/main.js) */
nav ul li.open > ul {
	display: block;
}

nav ul ul li {
	float: none;
}

nav ul li a, nav ul li a:visited {
	text-align: center;
	text-decoration: none;
	color: #ffffff;
	display: block;
	font-weight: bold;
	margin: 0;
	padding: 8px 14px;
	text-transform: uppercase;
	font-size: 13px;
	letter-spacing: 0.05em;
	-webkit-tap-highlight-color: transparent;
}

	nav ul li a:hover, nav ul li a:focus,
	nav ul li.open > a {
		text-decoration: none;
		background-color: rgba(255, 255, 255, 0.15);
		color: #ffffff;
	}

nav ul ul ul {
	position: absolute;
	top: 0;
	left: 100%;
}

/* Apply rounded corners to make it a neat floating pill component */
nav, nav ul li a {
	-moz-border-radius: 20px;
	-webkit-border-radius: 20px;
	border-radius: 20px;
}
