/**
 * BMD Global Menu
 * Ported from sage-bmd partials/nav/_top-nav.scss, _global-nav.scss and the vertical-nav mixin.
 * Override the custom properties on .bmd-gm to re-skin per site.
 */

.bmd-gm {
	--bmd-gm-font: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
	--bmd-gm-bar-bg: #212529;
	--bmd-gm-bar-height: 3rem;
	--bmd-gm-icon-color: #d3d3d3;
	--bmd-gm-bg: linear-gradient(to bottom right, #0098bb, #026697);
	--bmd-gm-text: #f9f9f9;
	--bmd-gm-border: #19759f;
	--bmd-gm-sub-bg: #005177;
	--bmd-gm-sub-hover: #006291;
	--bmd-gm-highlight: #28a745;
	--bmd-gm-highlight-border: #23923d;
	--bmd-gm-highlight-sub: #1e7e34;
	--bmd-gm-highlight-sub-hover: #19692c;
	--bmd-gm-logo-height: 32px;
	--bmd-gm-overlay: rgba(0, 0, 0, .3);
	--bmd-gm-z: 9990;
	--bmd-gm-width: 85%;
}

@media (min-width: 576px) {
	.bmd-gm { --bmd-gm-width: 70%; }
}

@media (min-width: 768px) {
	.bmd-gm { --bmd-gm-width: 50%; }
}

@media (min-width: 1200px) {
	.bmd-gm { --bmd-gm-width: 25%; }
}

/* Reset so host themes' element styles don't leak in */
.bmd-gm,
.bmd-gm *,
.bmd-gm *::before,
.bmd-gm *::after {
	box-sizing: border-box;
}

.bmd-gm ul,
.bmd-gm li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bmd-gm button {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.bmd-gm a,
.bmd-gm a:hover,
.bmd-gm a:focus {
	color: var(--bmd-gm-text);
	text-decoration: none;
	box-shadow: none;
}

.bmd-gm .bmd-gm-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Lock page scroll on <html> only -- overflow on <body> would make it a scroll container and break the sticky bar */
html.bmd-gm-lock {
	overflow: hidden;
}

/*
 * Note: the drawer and overlay are position:fixed, so a host theme must not put transform/filter/perspective on <body>
 * (even translateX(0)) -- that turns <body> into their containing block and they scroll away with the page.
 */

/* The root is the sticky element (not the bar) -- sticky only works within its parent, which must be <body> */
.bmd-gm {
	position: sticky;
	top: 0;
	z-index: var(--bmd-gm-z);
}

/* Top bar */
.bmd-gm .bmd-gm-bar {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	height: var(--bmd-gm-bar-height);
	padding: 0 1rem;
	background-color: var(--bmd-gm-bar-bg);
	font-family: var(--bmd-gm-font);
	line-height: 1rem;
}

.bmd-gm .bmd-gm-logo {
	display: block;
	flex: none;
	margin-left: 1rem;
	line-height: 0;
}

.bmd-gm .bmd-gm-logo img {
	display: block;
	width: auto;
	max-width: none;
	height: var(--bmd-gm-logo-height);
	margin: 0;
	border: 0;
}

/* Hamburger icon */
.bmd-gm .bmd-gm-toggle {
	position: relative;
	display: block;
	width: 30px;
	height: 30px;
	margin-top: -.25rem;
}

.bmd-gm .bmd-gm-toggle-label {
	position: relative;
	bottom: -10px;
	display: block;
	font-family: Helvetica, Arial, sans-serif;
	font-weight: normal;
	font-size: .55rem;
	line-height: 1rem;
	letter-spacing: .07rem;
	color: var(--bmd-gm-icon-color);
	text-align: center;
	text-transform: uppercase;
}

.bmd-gm .bmd-gm-toggle-icon {
	display: block;
	padding: 10px 0 0;
	border-bottom: 3px solid var(--bmd-gm-icon-color);
	transition-delay: .125s;
}

.bmd-gm .bmd-gm-toggle-icon::before,
.bmd-gm .bmd-gm-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	border-top: 3px solid var(--bmd-gm-icon-color);
	transition-delay: 0s;
	transform-origin: center;
}

.bmd-gm .bmd-gm-toggle-icon::before {
	top: 2px;
}

.bmd-gm .bmd-gm-toggle-icon::after {
	bottom: 9px;
}

.bmd-gm .bmd-gm-toggle-icon,
.bmd-gm .bmd-gm-toggle-icon::before,
.bmd-gm .bmd-gm-toggle-icon::after {
	transition-property: transform, border-color;
	transition-duration: .25s;
	transition-timing-function: cubic-bezier(.5, -.5, .5, 1.5);
}

.bmd-gm.is-open .bmd-gm-toggle-icon {
	transition-delay: 0s;
	border-color: transparent;
}

.bmd-gm.is-open .bmd-gm-toggle-icon::before,
.bmd-gm.is-open .bmd-gm-toggle-icon::after {
	transition-delay: .125s;
}

.bmd-gm.is-open .bmd-gm-toggle-icon::before {
	transform: translateY(8px) rotate(135deg);
}

.bmd-gm.is-open .bmd-gm-toggle-icon::after {
	transform: translateY(-8px) rotate(-135deg);
}

/* Overlay -- top is set by JS to the bottom of the bar so the hamburger stays clickable */
.bmd-gm .bmd-gm-overlay {
	position: fixed;
	top: var(--bmd-gm-bar-height);
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	background: var(--bmd-gm-overlay);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease-in-out, visibility 0s linear .3s;
}

.bmd-gm.is-open .bmd-gm-overlay {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

/* Drawer */
.bmd-gm .bmd-gm-drawer {
	position: fixed;
	top: var(--bmd-gm-bar-height);
	bottom: 0;
	left: 0;
	z-index: 2;
	width: var(--bmd-gm-width);
	max-width: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--bmd-gm-bg);
	color: var(--bmd-gm-text);
	font-family: var(--bmd-gm-font);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: .025em;
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform .3s ease-in-out, visibility 0s linear .3s;
}

.bmd-gm.is-open .bmd-gm-drawer {
	transform: none;
	visibility: visible;
	transition-delay: 0s;
}

.bmd-gm .bmd-gm-title {
	margin: .5rem 0;
	padding: 0 0 0 2rem;
	text-transform: uppercase;
}

/* Items */
.bmd-gm .bmd-gm-item {
	border-bottom: 2px solid var(--bmd-gm-border);
}

.bmd-gm .bmd-gm-item:first-child {
	border-top: 2px solid var(--bmd-gm-border);
}

.bmd-gm .bmd-gm-item.is-highlight {
	background: var(--bmd-gm-highlight);
	border-bottom-color: var(--bmd-gm-highlight-border);
}

.bmd-gm .bmd-gm-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bmd-gm .bmd-gm-link {
	flex: 1;
	display: block;
	padding: .5rem 0 .5rem 2rem;
}

/* Submenu chevron */
.bmd-gm .bmd-gm-sub-toggle {
	flex: none;
	align-self: stretch;
	width: 3rem;
	padding-right: 1rem;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1.2em' viewBox='0 0 1024 1280'%3E%3Cpath d='M1011 480q0 13-10 23L535 969q-10 10-23 10t-23-10L23 503q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z' fill='%23FFF'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 1em 1.2em;
	transition: transform .2s ease-in-out;
}

.bmd-gm .bmd-gm-sub-toggle[aria-expanded="true"] {
	transform: rotate(-180deg);
}

.bmd-gm .bmd-gm-submenu {
	background: var(--bmd-gm-sub-bg);
}

.bmd-gm .is-highlight .bmd-gm-submenu {
	background: var(--bmd-gm-highlight-sub);
}

.bmd-gm .is-highlight .bmd-gm-sub-link:hover,
.bmd-gm .is-highlight .bmd-gm-sub-link:focus {
	background: var(--bmd-gm-highlight-sub-hover);
}

.bmd-gm .bmd-gm-submenu[hidden] {
	display: none;
}

.bmd-gm .bmd-gm-sub-link {
	display: block;
	padding: .5rem 0 .5rem 3rem;
	font-size: 85%;
}

.bmd-gm .bmd-gm-sub-link:hover,
.bmd-gm .bmd-gm-sub-link:focus {
	background: var(--bmd-gm-sub-hover);
}

@media (prefers-reduced-motion: reduce) {
	.bmd-gm *,
	.bmd-gm *::before,
	.bmd-gm *::after {
		transition-duration: 0s !important;
	}
}
