/* Navigation drawer (redesigned 2026-07-18). Loaded after app.css/dark-mode.css and
   overrides their .navList full-width-dropdown styles with a left slide-in drawer.
   The classic markup is preserved at snippets/nav-classic.php. */

.navList.navDrawer {
	top: 0;
	right: 0;
	left: auto;
	margin: 0;
	padding: 0;
	width: 315px;
	max-width: 88vw;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	display: flex;
	flex-direction: column;
	border-bottom: none;
	border-left: 1px solid rgba(0, 0, 0, 0.08);
	transform: translate3d(100px, 0, 0);
	opacity: 0;
	overflow: hidden;
	z-index: 101;
	/* static shadow: it fades in/out with the element's own opacity, so it must
	   not be in the transition list - an animating box-shadow repaints (CPU) every
	   frame while transform/opacity run on the compositor, which shimmers */
	box-shadow: -30px 0px 80px rgba(0, 0, 0, 0.25);
	will-change: transform, opacity;
}

/* short travel + fade entry (app.css's .anim forces opacity 1, so re-pin the
   start state here; .open below wins once it applies) */
.navList.navDrawer.anim {
	opacity: 0;
	transition: transform .25s ease-out, opacity .25s ease-out;
}

.navList.navDrawer.open {
	transform: translate3d(0, 0, 0);
	opacity: 1;
}

/* on screens wider than the page container the drawer floats: lined up with the
   container's right edge (never closer than 15px to the viewport edge), margin
   above and below, rounded corners. The 100px travel + fade entry needs no
   special closed position - opacity 0 hides it. */
@media (min-width: 1201px) {

	.navList.navDrawer {
		top: 15px;
		right: max(15px, (100vw - 1200px) / 2);
		height: calc(100vh - 30px);
		height: calc(100dvh - 30px);
		border: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 16px;
	}

}

/* dimmed page behind the open drawer; clicking it closes (dds-library) */
.navBackdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity .35s;
	z-index: 100;
}

.navList.navDrawer.open ~ .navBackdrop {
	opacity: 1;
	pointer-events: all;
}

/* header: brand + close, then the signed-in user */

.navDrawerHeader {
	position: relative;
	flex: none;
	padding: 18px 20px 14px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.07);
	z-index: 2;
}

.navDrawerBrand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.navDrawerLogo {
	height: 30px;
	width: auto;
}

.navDrawerClose {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 16px;
	opacity: .55;
	cursor: pointer;
}

.navDrawerClose:hover {
	background: rgba(0, 0, 0, 0.06);
	opacity: .8;
}

.navUserName {
	font-weight: 600;
	font-size: 15px;
}

.navUserRole {
	font-size: 12px;
	opacity: .55;
	text-transform: uppercase;
	letter-spacing: .06em;
	margin-top: 1px;
}

/* scrollable sections */

.navDrawerScroll {
	flex: 1;
	overflow-y: auto;
	padding: 4px 12px 12px;
	-webkit-overflow-scrolling: touch;
}

.navDrawer .navSection {
	width: 100%;
	padding: 0;
	margin: 14px 0 0;
}

.navDrawer .navSection label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .45;
	margin: 0 10px 4px;
}

/* icon links (the !importants beat app.css/dark-mode.css's old pill styles,
   which mark theirs !important too - nav.css loads last) */

.navDrawer a.navLink {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 1px 0;
	padding: 10px 12px;
	border-radius: 8px;
	border: none !important;
	background: transparent !important;
	color: inherit !important;
	text-align: left;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.navDrawer a.navLink i {
	flex: none;
	width: 20px;
	text-align: center;
	font-size: 15px;
	color: rgb(34, 136, 224);
	opacity: .85;
}

.navDrawer a.navLink:hover {
	background: rgba(34, 136, 224, 0.07) !important;
}

.navDrawer a.navLink.active {
	background: rgba(34, 136, 224, 0.1) !important;
	color: rgb(34, 136, 224) !important;
	box-shadow: inset 3px 0 0 rgb(34, 136, 224);
	font-weight: 600;
}

/* pinned footer: account + logout */

.navDrawerFooter {
	position: relative;
	flex: none;
	padding: 10px 12px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom));
	border-top: 1px solid rgba(0, 0, 0, 0.07);
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.07);
	z-index: 2;
}

.navDrawer a.navLink.logout,
.navDrawer a.navLink.logout i {
	color: rgb(198, 46, 46) !important;
}

.navDrawer a.navLink.logout:hover {
	background: rgba(198, 46, 46, 0.07) !important;
}

/* dark mode */

@media (prefers-color-scheme: dark) {

	.navList.navDrawer {
		background: rgb(24, 26, 29) !important;
		border-color: rgba(151, 151, 151, 0.15); /* covers the edge border and the wide-screen full border */
	}

	.navDrawerHeader,
	.navDrawerFooter {
		border-color: rgba(151, 151, 151, 0.15);
	}

	.navDrawerClose:hover {
		background: rgba(255, 255, 255, 0.08);
	}

	.navDrawer a.navLink:hover {
		background: rgba(34, 136, 224, 0.16) !important;
	}

	.navDrawer a.navLink.active {
		background: rgba(34, 136, 224, 0.2) !important;
		color: rgb(120, 180, 235) !important;
	}

}
