/*
 * puts a fixed nav bar menu on the top with a height of --nav-height
 * should define the css var --nav-height
 */

nav {
	position: fixed;
	top: 0px;
	width: 100%;
	padding: 4px 32px;

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	z-index: 2;

	overflow-x: hidden;
	overflow-y: hidden;
	gap: 4px 8px;
	box-sizing: border-box;
}

nav img {
	height: var(--nav-height);
}

/* Brand text - hidden on wide screens, shown on mobile */
#navBrand {
	display: none;
	font-family: 'Montserrat', 'Open Sans', sans-serif;
	font-weight: 700;
	font-size: 18px;
	color: white;
	cursor: pointer;
	letter-spacing: -0.5px;
}

nav a {
	align-self: center;
	font-size: 13px;
	font-weight: 500;
	color: unset;
	text-decoration: none;
	white-space: nowrap;
	padding: 6px 8px;
	border-radius: 6px;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

nav a:hover {
	background-color: rgba(255,255,255,0.15);
}

nav a.currentURL {
	background-color: rgba(255,255,255,0.2);
	font-weight: 600;
}

nav #menuIcon {
	display: none;
	padding-left: 10px;
	margin-left: auto;
}

/* Admin/work links - smaller font and muted at wide screens */
nav a[href*="sqlQuery"],
nav a[href*="accessLog"],
nav a[href*="runnerSearch"],
nav a[href*="graphExample"],
nav a[href*="allData"] {
	font-size: 11px;
	opacity: 0.8;
}

/* Large screens: slightly smaller nav items to fit */
@media only screen and (max-width: 1600px) {
	nav a {
		font-size: 12px;
		padding: 5px 6px;
	}
	nav a[href*="sqlQuery"],
	nav a[href*="accessLog"],
	nav a[href*="runnerSearch"],
	nav a[href*="graphExample"],
	nav a[href*="allData"] {
		font-size: 10px;
	}
}

/* Medium-large screens: hide work links */
@media only screen and (max-width: 1400px) {
	nav a[href*="runnerSearch"],
	nav a[href*="graphExample"],
	nav a[href*="allData"] {
		display: none;
	}
}

/* Medium screens: switch to hamburger menu */
@media only screen and (max-width: 1000px) {
	nav {
		flex-wrap: wrap;
		padding: 6px 12px;
		align-content: flex-start;
	}

	#navBrand {
		display: block;
		order: 1;
		font-size: 15px;
		line-height: 1;
	}

	nav img {
		display: none;
	}

	nav #menuIcon {
		order: 2;
		display: block;
		cursor: pointer;
		margin-left: auto;
		height: 18px;
		padding: 0;
	}

	nav > a {
		order: 3;
		width: 100%;
		text-align: right;
		transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
		max-height: 2.5em;
		font-size: 14px !important;
		border: unset !important;
		overflow: hidden;
		opacity: 1;
		padding: 6px 12px;
	}

	/* Show admin/work links in mobile menu */
	nav a[href*="runnerSearch"],
	nav a[href*="graphExample"],
	nav a[href*="allData"] {
		display: block;
		font-size: 12px !important;
		opacity: 0.7;
	}

	nav:not(.menuVisible) > a {
		position: absolute;
		visibility: hidden;
		opacity: 0;
		pointer-events: none;
	}
}

