:root {
	--drawer-bg: #161d3c;
	--drawer-line: rgba(255,255,255,.09);
	--drawer-text: #f0f2f7;
	--bar-h: 54px;
}

#menubar {
	display: none;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: var(--bar-h);
	padding: 0 14px 0 6px;
	background-color: var(--primary);
	backdrop-filter: none;
	position: fixed;
	top: 0;
	z-index: 1000;
}
#menubar > a {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}
/* main.css positions #logo-mobile absolutely; drop that here so the bar's own
   flex centring can place it, and fade it out while the drawer is open so its
   logo isn't sitting next to the drawer's copy of the same mark. */
#menubar #logo-mobile {
	position: static;
	width: 150px;
	height: 38px;
	background-size: contain;
	background-position: center right;
	transition: opacity .2s ease;
}
body.drawer-open #menubar #logo-mobile {
	opacity: 0;
}

.nav-toggle {
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	flex: 0 0 auto;
}
.nav-toggle span,
.nav-toggle span:before,
.nav-toggle span:after {
	position: absolute;
	left: 11px;
	width: 22px;
	height: 2px;
	background: #fff;
	border-radius: 2px;
	transition: transform .25s ease, background .2s ease, top .25s ease;
}
.nav-toggle span {
	top: 50%;
	margin-top: -1px;
}
.nav-toggle span:before,
.nav-toggle span:after {
	content: "";
	left: 0;
	top: -7px;
}
.nav-toggle span:after {
	top: 7px;
}
.nav-toggle.open span {
	background: transparent;
}
.nav-toggle.open span:before {
	top: 0;
	transform: rotate(45deg);
}
.nav-toggle.open span:after {
	top: 0;
	transform: rotate(-45deg);
}

.drawer-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,.55);
	z-index: 1050;
	opacity: 0;
	visibility: hidden;
	transition: opacity .28s ease, visibility .28s ease;
}
.drawer-backdrop.is-on {
	opacity: 1;
	visibility: visible;
}

.drawer {
	position: fixed;
	top: 0;
	left: 0;
	width: 86vw;
	max-width: 340px;
	height: 100%;
	height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--drawer-bg);
	z-index: 1100;
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform .28s cubic-bezier(.4,0,.2,1), visibility .28s;
	box-shadow: 2px 0 24px rgba(0,0,0,.35);
	padding-bottom: env(safe-area-inset-bottom);
}
.drawer.is-open {
	transform: translateX(0);
	visibility: visible;
}

.drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--bar-h);
	padding: 0 8px 0 18px;
	background: var(--primary);
	flex: 0 0 auto;
}
#logo-drawer {
	background-image: url(../images/sac-logo-white-500.png);
	background-repeat: no-repeat;
	background-size: 100% auto;
	background-position: center left;
	width: 130px;
	height: 33px;
}
.drawer-close {
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

#drawernav {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
#drawernav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
#drawernav li {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	border-bottom: 1px solid var(--drawer-line);
}
#drawernav li > a {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-height: 52px;
	padding: 13px 18px;
	background: none;
	color: var(--drawer-text);
	font-family: 'Open Sans', sans-serif;
	font-size: 15px;
	line-height: 1.35;
	text-decoration: none;
}
#drawernav li > a.is-current {
	color: var(--tertiary);
	box-shadow: inset 3px 0 0 var(--tertiary);
}
#drawernav li > a:hover,
#drawernav li > a:focus {
	background: rgba(255,255,255,.07);
	color: #fff;
	outline: 0;
}

#drawernav .sub-toggle {
	flex: 0 0 auto;
	position: relative;
	width: 54px;
	padding: 0;
	background: none;
	border: 0;
	border-left: 1px solid var(--drawer-line);
	cursor: pointer;
}
#drawernav .sub-toggle:after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	margin: -7px 0 0 -4px;
	border-right: 2px solid var(--tertiary);
	border-bottom: 2px solid var(--tertiary);
	transform: rotate(45deg);
	transition: transform .22s ease;
}
#drawernav .sub-toggle:hover {
	background: rgba(255,255,255,.07);
}
#drawernav li.is-open > .sub-toggle:after {
	margin-top: -2px;
	transform: rotate(-135deg);
}

#drawernav .sub {
	flex: 0 0 100%;
	display: grid;
	grid-template-rows: 0fr;
	background: rgba(0,0,0,.25);
	transition: grid-template-rows .25s ease;
}
#drawernav li.is-open > .sub {
	grid-template-rows: 1fr;
}
#drawernav .sub > ul {
	overflow: hidden;
	min-height: 0;
}
#drawernav .sub > ul > li:last-child {
	border-bottom: 0;
}
#drawernav li li > a {
	padding-left: 34px;
	font-size: 14px;
}
#drawernav li li li > a {
	padding-left: 50px;
}
#drawernav li li li li > a {
	padding-left: 66px;
}

body.drawer-open {
	position: fixed;
	width: 100%;
	overflow: hidden;
}

@media screen and (max-width: 900px) {
	#menubar {
		display: flex;
	}
	#banner,
	#banner.home {
		margin-top: var(--bar-h);
	}
	#header.desktop,
	#footer.desktop,
	.arrow.desktop {
		display: none;
	}
	#footer.mobile {
		display: block;
	}
}

@media screen and (min-width: 901px) {
	.drawer,
	.drawer-backdrop {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.drawer,
	.drawer-backdrop,
	#drawernav .sub,
	#drawernav .sub-toggle:after,
	.nav-toggle span,
	.nav-toggle span:before,
	.nav-toggle span:after {
		transition: none;
	}
}

@media print {
	#menubar,
	#mobiledrawer,
	.drawer-backdrop {
		display: none;
	}
}
