/*
 * Main navigation - see library/nav.php.
 *
 * Plain CSS rather than Sass: the theme's Sass build is unverified, and this
 * file is small enough not to need it. Everything is scoped under .tmp-nav.
 *
 * Breakpoint: 1029px and below is the mobile panel, 1030px and up the header
 * row - the same split Responsive Menu Pro used, and the one in nav.js.
 *
 * html.tmp-nav-js is set in the <head> when the navigation script can run
 * (tmp_nav_js_flag() in nav.php); without it the menu is a plain list.
 * .is-ready is added by nav.js once the menu is set up, and is what switches
 * transitions on - otherwise the panel would visibly slide away on page load.
 */

.tmp-nav .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tmp-nav__menu,
.tmp-nav__submenu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tmp-nav__menu a {
	text-decoration: none;
}

/* Controls exist only when the script can drive them. */
.tmp-nav__toggle,
.tmp-nav__close,
.tmp-nav__subtoggle {
	display: none;
}

/* An in-page target given focus after a menu link scrolls to it. */
.tmp-nav-scroll-target:focus {
	outline: none;
}

/* ------------------------------------------------------------------------
 * 1030px and up: the row in the header
 * --------------------------------------------------------------------- */
@media (min-width: 1030px) {
	.tmp-nav__nav {
		text-align: center;
	}

	.tmp-nav__menu > li {
		position: relative;
		display: inline-block;
		vertical-align: top;
	}

	.tmp-nav__menu > li > a {
		display: inline-block;
		height: 40px;
		padding-left: 15px;
		font-size: 14px;
		font-weight: 700;
		line-height: 40px;
		text-transform: uppercase;
		color: #000;
	}

	.tmp-nav__menu > li:first-child > a {
		padding-left: 0;
	}

	/* The separator follows the whole item - the link and any sub-menu button -
	   so a button sits before the "/", and "/" is not read as part of the
	   link's name. Placed as it was when it lived inside the link. */
	.tmp-nav__menu > li::after {
		content: '/';
		display: inline-block;
		padding-left: 15px;
		font-size: 14px;
		font-weight: 700;
		line-height: 40px;
		color: #000;
		vertical-align: top;
	}

	.tmp-nav__menu > li:last-child::after {
		content: none;
	}

	/* The current page, as the theme styled it for the old menu. */
	.tmp-nav__menu > li.current-menu-item {
		padding-left: 10px;
	}

	.tmp-nav__menu > li.current-menu-item > a {
		height: 30px;
		line-height: 30px;
	}

	.tmp-nav__menu > li.current-menu-item::after {
		line-height: 30px;
	}

	.tmp-nav__menu a:hover {
		text-decoration: underline;
	}

	/* Replaces the old outline:none with a dotted underline. */
	.tmp-nav__menu a:focus-visible,
	.tmp-nav__subtoggle:focus-visible {
		outline: 2px solid #000;
		outline-offset: 3px;
	}

	/* Sub-menus: a dropdown under their item. */
	.tmp-nav__submenu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 1000;
		min-width: 220px;
		padding: 8px 0;
		background: #fff;
		box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
		text-align: left;
	}

	/* Each dropdown item is a row: the link, then its own sub-menu button, with
	   a further level opening beside it. */
	.tmp-nav__submenu li {
		position: relative;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.tmp-nav__submenu a {
		display: block;
		flex: 1 1 auto;
		padding: 8px 15px;
		font-size: 14px;
		font-weight: 700;
		line-height: 1.4;
		text-transform: uppercase;
		color: #000;
	}

	html.tmp-nav-js .tmp-nav__submenu .tmp-nav__subtoggle {
		height: 36px;
		margin: 0 6px 0 0;
	}

	.tmp-nav__submenu .tmp-nav__submenu {
		top: 0;
		left: 100%;
	}

	/* Without the script there is no dropdown: sub-menus sit in the flow. */
	html:not(.tmp-nav-js) .tmp-nav__submenu {
		position: static;
		box-shadow: none;
	}

	html.tmp-nav-js .tmp-nav__subtoggle {
		display: inline-block;
		width: 24px;
		height: 40px;
		margin-left: 2px;
		padding: 0;
		border: 0;
		background: transparent;
		color: #000;
		vertical-align: top;
		cursor: pointer;
	}

	html.tmp-nav-js .tmp-nav__submenu {
		display: none;
	}

	html.tmp-nav-js .tmp-nav__submenu.is-open {
		display: block;
	}
}

@media (min-width: 1030px) and (hover: hover) {
	html.tmp-nav-js .tmp-nav__menu li:hover > .tmp-nav__submenu {
		display: block;
	}
}

/* ------------------------------------------------------------------------
 * 1029px and below: the button and the full-screen panel
 * --------------------------------------------------------------------- */
@media (max-width: 1029px) {

	/* Without the script: a simple stacked list in the header. */
	html:not(.tmp-nav-js) .tmp-nav__nav {
		text-align: center;
	}

	html:not(.tmp-nav-js) .tmp-nav__menu a {
		display: block;
		padding: 10px 0;
		font-size: 14px;
		font-weight: 700;
		text-transform: uppercase;
		color: #000;
	}

	html:not(.tmp-nav-js) .tmp-nav__submenu a {
		font-weight: 400;
	}

	/* The toggle, and the close button that sits in the same place. */
	html.tmp-nav-js .tmp-nav__toggle,
	html.tmp-nav-js .tmp-nav__close {
		position: fixed;
		top: 15px;
		right: 5%;
		z-index: 99999;
		display: block;
		width: 55px;
		height: 55px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: #000;
		color: #fff;
		line-height: 0;
		cursor: pointer;
	}

	/* Clear the logged-in admin bar: 32px tall from 783px, 46px below. */
	html.tmp-nav-js .admin-bar .tmp-nav__toggle {
		top: 47px;
	}

	html.tmp-nav-js .tmp-nav__toggle:focus-visible,
	html.tmp-nav-js .tmp-nav__close:focus-visible {
		outline: 3px solid #fff;
		outline-offset: -6px;
	}

	html.tmp-nav-js .tmp-nav__panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 100000;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #000;
		text-align: left;
		visibility: hidden;
		transform: translateX(-100%);
	}

	html.tmp-nav-js .tmp-nav.is-open .tmp-nav__panel {
		visibility: visible;
		transform: none;
	}

	/* Slide in and out, once set up - never on page load. */
	html.tmp-nav-js .tmp-nav.is-ready .tmp-nav__panel {
		transition: transform 0.5s, visibility 0s linear 0.5s;
	}

	html.tmp-nav-js .tmp-nav.is-ready.is-open .tmp-nav__panel {
		transition: transform 0.5s, visibility 0s;
	}

	/* The page behind is locked while the panel is open. */
	html.tmp-nav-open,
	html.tmp-nav-open body {
		overflow: hidden;
	}

	html.tmp-nav-js .tmp-nav__menu li {
		position: relative;
	}

	html.tmp-nav-js .tmp-nav__menu a {
		display: block;
		padding: 0 40px 0 5%;
		border-top: 1px solid #212121;
		border-bottom: 1px solid #212121;
		background: #212121;
		color: #fff;
		font-size: 18px;
		font-weight: 400;
		line-height: 60px;
		text-transform: none;
	}

	html.tmp-nav-js .tmp-nav__menu a:hover,
	html.tmp-nav-js .tmp-nav__menu a:focus-visible {
		background: #3f3f3f;
	}

	html.tmp-nav-js .tmp-nav__menu a:focus-visible,
	html.tmp-nav-js .tmp-nav__subtoggle:focus-visible {
		outline: 2px solid #fff;
		outline-offset: -4px;
	}

	html.tmp-nav-js .tmp-nav__subtoggle {
		position: absolute;
		top: 0;
		right: 0;
		display: block;
		width: 62px;
		height: 62px;
		padding: 0;
		border: 0;
		border-left: 1px solid #000;
		background: #212121;
		color: #fff;
		cursor: pointer;
	}

	html.tmp-nav-js .tmp-nav__submenu {
		display: none;
	}

	html.tmp-nav-js .tmp-nav__submenu.is-open {
		display: block;
	}

	html.tmp-nav-js .tmp-nav__submenu a {
		padding-left: 10%;
		font-size: 13px;
	}

	html.tmp-nav-js .tmp-nav__submenu .tmp-nav__submenu a {
		padding-left: 15%;
	}
}

/* ------------------------------------------------------------------------
 * Icons: three bars, and a cross for close
 * --------------------------------------------------------------------- */
.tmp-nav__icon {
	position: relative;
	display: inline-block;
	width: 25px;
	height: 19px;
	vertical-align: middle;
}

.tmp-nav__icon > span,
.tmp-nav__icon > span::before,
.tmp-nav__icon > span::after {
	position: absolute;
	left: 0;
	width: 25px;
	height: 3px;
	border-radius: 4px;
	background: #fff;
}

.tmp-nav__icon > span {
	top: 8px;
}

.tmp-nav__icon > span::before,
.tmp-nav__icon > span::after {
	content: '';
}

.tmp-nav__icon > span::before {
	top: -8px;
}

.tmp-nav__icon > span::after {
	top: 8px;
}

.tmp-nav__icon--close > span {
	background: transparent;
}

.tmp-nav__icon--close > span::before {
	top: 0;
	transform: rotate(45deg);
}

.tmp-nav__icon--close > span::after {
	top: 0;
	transform: rotate(-45deg);
}

/* A chevron for sub-menu buttons, pointing down, and up when open. */
.tmp-nav__chevron {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

.tmp-nav__subtoggle[aria-expanded="true"] .tmp-nav__chevron {
	transform: translateY(2px) rotate(-135deg);
}

@media (max-width: 782px) {
	html.tmp-nav-js .admin-bar .tmp-nav__toggle {
		top: 61px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.tmp-nav-js .tmp-nav.is-ready .tmp-nav__panel,
	html.tmp-nav-js .tmp-nav.is-ready.is-open .tmp-nav__panel {
		transition: none;
	}
}
