/* ─── Navbar ─────────────────────────────────────────────────── */
#navbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background-color: var(--color-white);
	border-bottom: 1.2px dashed var(--color-border);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 3-column grid: left | center | right */
.navbar-content {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	max-width: var(--container-6xl);

	margin: 0 auto;
	padding: 0 5%;
	height: 64px;
}

/* ─── Left: nav links ───────────────────────────────────────── */
.navbar-left {
	display: flex;
	align-items: center;
	justify-self: start;
}

.navbar-left ul {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.navbar-left ul li a {
	display: block;
	font-size: .83rem;
	font-weight: 600;
	color: var(--color-text-tertiary);
	padding: 6px 12px;
	border-radius: 6px;
	transition: color 0.2s ease, background-color 0.2s ease;
	opacity: 1;
}

.navbar-left ul li a:hover {
	color: var(--color-primary);
	background-color: var(--color-primary-light);
	font-weight: 700;
}

.navbar-left ul li a.active {
	color: var(--color-primary);
	font-weight: 700;
}

/* ─── Center: logo ──────────────────────────────────────────── */
.navbar-logo {
	justify-self: center;
}

.navbar-logo img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: contain;
}

/* ─── Right: actions ────────────────────────────────────────── */
.navbar-right {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 12px;
}

/* ─── Dark mode toggle ──────────────────────────────────────── */
#dark-mode-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--color-border-strong);
	border-radius: 8px;
	background: transparent;
	color: var(--color-text-tertiary);
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}

#dark-mode-toggle:hover {
	background-color: var(--color-bg);
	border-color: var(--color-text-muted);
	color: var(--color-text-secondary);
}

#dark-mode-toggle svg {
	display: block;
}

/* ─── Hamburger ─────────────────────────────────────────────── */
.navbar-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	position: relative;
	gap: 5px;
	width: 36px;
	height: 36px;
	padding: 6px;
	border: none;
	background: transparent;
	cursor: pointer;

	margin-left: .4rem;
	/* padding-left: .7rem; */
}

.navbar-burger::before {
	content: '';
	position: absolute;
	width: 1px;
	left: -.3rem;
	border-left: 1px dashed var(--color-border);
	height: 70%;
	background-color: transparent;
	pointer-events: none;
}

.navbar-burger span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: var(--color-text-tertiary);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.25s ease;
	transform-origin: center;
}

.navbar-burger.is-open span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.navbar-burger.is-open span:nth-child(2) {
	opacity: 0;
}

.navbar-burger.is-open span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}



/* ─── Responsive (mobile) ───────────────────────────────────── */
@media (max-width: 767px) {
	.navbar-content {
		display: flex;
		justify-content: flex-start;
		gap: 8px;
	}

	.navbar-logo {
		margin-right: auto;
	}

	.navbar-burger {
		display: flex;
		position: relative;
		z-index: 102;
	}

	.navbar-left {
		display: none;
		position: fixed;
		top: 64px;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100vw;
		flex-direction: column;
		align-items: stretch;
		background-color: var(--color-white);
		border-top: 1px solid var(--color-border);
		box-shadow: 0 8px 24px var(--color-shadow-hover);
		padding: 24px 6%;
		z-index: 101;
		overflow-y: auto;
	}

	.navbar-left.is-open {
		display: flex;
	}

	.navbar-left ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.navbar-left ul li a {
		padding: 14px 12px;
		font-size: 16px;
		border-radius: 8px;
	}

	.navbar-right {
		display: flex;
		gap: 8px;
		align-items: center;
		position: relative;
		z-index: 102;
	}
}


/* ─── Dark mode overrides ───────────────────────────────────── */
:root.dark {
	#navbar {
		background-color: #242424;
	}

	.navbar-left ul li a {
		color: var(--color-text-tertiary);
	}

	.navbar-left ul li a:hover {
		color: var(--color-text-primary);
		background-color: rgba(255, 255, 255, 0.07);
	}

	#dark-mode-toggle {
		color: var(--color-text-tertiary);
		border-color: var(--color-border-strong);
	}

	#dark-mode-toggle:hover {
		background-color: rgba(255, 255, 255, 0.07);
		border-color: rgba(255, 255, 255, 0.25);
		color: var(--color-text-primary);
	}

	.navbar-burger span {
		background-color: var(--color-text-tertiary);
	}

	.navbar-left ul li a.active {
		color: var(--color-primary);
	}
}