/*
 * Primary navigation (header bar)
 * Recreates the look of the old CTF Kodda Menu plugin with a standard WordPress menu.
 * Markup: nav.ldr-nav > .ldr-nav__inner > button.ldr-nav__toggle + ul.ldr-nav__menu
 *         li.menu-item(-has-children) > a + ul.sub-menu
 *
 * Breakpoints (same as the live site):
 *   1024px and wider : full bar, dropdowns on hover
 *   650px - 1023px   : hamburger on the left
 *   649px and below  : hamburger on the right
 */

/* ---------- Shared ---------- */
.ldr-nav {
	--ldr-teal: #1facb5;
	--ldr-text: #f1f1f1;
	--ldr-line: #d1d1d1;
	position: relative;
	z-index: 1000;
	height: 50px;
	font-family: 'Lato', sans-serif;
}
.ldr-nav__inner {
	position: relative;
	box-sizing: border-box;
	max-width: 1200px;
	height: 50px;
	margin: 0 auto;
	border: 1px solid transparent;
	background: #000;
}
.ldr-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.ldr-nav li {
	margin: 0;
	padding: 0;
	list-style: none;
}
.ldr-nav a,
.ldr-nav a:link,
.ldr-nav a:visited {
	display: block;
	position: relative;
	color: var(--ldr-text);
	text-decoration: none;
	text-transform: uppercase;
	transition: color .5s, background-color .5s;
}
.ldr-screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Hamburger button (hidden on desktop).
   The theme's app.css styles every <button> with !important rules,
   so a few properties below need !important to override them. */
.ldr-nav .ldr-nav__toggle {
	display: none !important;
	box-sizing: border-box;
	width: 51px;
	height: 40px;
	margin: 0 !important;
	padding: 10px 15px 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	line-height: 1;
}
.ldr-nav .ldr-nav__toggle:hover,
.ldr-nav .ldr-nav__toggle:focus {
	background: transparent;
}
.ldr-nav__toggle-bars,
.ldr-nav__toggle-bars::before,
.ldr-nav__toggle-bars::after {
	display: block;
	width: 21px;
	height: 3px;
	background: #f3f3f3;
	content: '';
}
.ldr-nav__toggle-bars {
	position: relative;
	margin-top: 6px;
}
.ldr-nav__toggle-bars::before {
	position: absolute;
	top: -6px;
}
.ldr-nav__toggle-bars::after {
	position: absolute;
	top: 6px;
}

/* Down caret on items that have a submenu */
.ldr-nav .menu-item-has-children > a::after {
	position: absolute;
	top: 50%;
	right: 9px;
	margin-top: -2px;
	border-top: 4px solid var(--ldr-text);
	border-right: 4px solid transparent;
	border-left: 4px solid transparent;
	content: '';
	transition: border-color .5s;
}

/* ---------- Desktop: 1024px and wider ---------- */
@media only screen and (min-width: 1024px) {
	.ldr-nav__menu > li {
		position: relative;
		float: left;
		padding: 0 23px;
	}
	.ldr-nav__menu > li:first-child {
		padding-left: 15px;
	}
	.ldr-nav__menu > li > a {
		padding: 0 15px;
		font-size: 16px;
		line-height: 50px;
	}
	.ldr-nav__menu > .menu-item-has-children > a {
		padding-right: 25px;
	}

	/* Hover, keyboard focus and current page */
	.ldr-nav__menu > li:hover > a,
	.ldr-nav__menu > li:focus-within > a,
	.ldr-nav__menu > li.is-open > a,
	.ldr-nav__menu > .current-menu-item > a,
	.ldr-nav__menu > .current-menu-ancestor > a {
		color: var(--ldr-teal);
	}
	.ldr-nav__menu > li:hover > a::after,
	.ldr-nav__menu > li:focus-within > a::after,
	.ldr-nav__menu > .current-menu-item > a::after,
	.ldr-nav__menu > .current-menu-ancestor > a::after {
		border-top-color: #fff;
	}

	/* Dropdowns */
	.ldr-nav .sub-menu {
		display: none;
		position: absolute;
		top: 44px;
		left: 30px;
		z-index: 1001;
		width: 200px;
		background: #000;
	}
	.ldr-nav__menu > li:hover > .sub-menu,
	.ldr-nav__menu > li:focus-within > .sub-menu,
	.ldr-nav__menu > li.is-open > .sub-menu {
		display: block;
	}
	.ldr-nav .sub-menu a {
		padding: 10px 0 10px 10px;
		font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
		font-size: 14px;
		line-height: 1.5;
	}
	.ldr-nav .sub-menu a:hover,
	.ldr-nav .sub-menu a:focus {
		color: var(--ldr-teal);
		background-color: #000;
	}

	/* Donate button: add the CSS class "ldr-nav__button" to a menu item */
	.ldr-nav__menu > li.ldr-nav__button {
		padding-left: 30px;
	}
	.ldr-nav__menu > li.ldr-nav__button > a {
		margin-top: 12px;
		padding: 4px 15px;
		border: 2px solid var(--ldr-teal);
		color: var(--ldr-teal);
		line-height: 1;
	}
	.ldr-nav__menu > li.ldr-nav__button > a:hover,
	.ldr-nav__menu > li.ldr-nav__button > a:focus {
		color: #fff;
		background-color: var(--ldr-teal);
	}
}

/* Narrower screens: the bar fills the width without side borders (matches Kodda) */
@media only screen and (max-width: 1214px) {
	.ldr-nav__inner {
		border-right-width: 0;
		border-left-width: 0;
	}
}

/* Tighter, even spacing on narrower desktops (matches Kodda, where this
   also replaced the extra space before HOME and DONATE) */
@media only screen and (min-width: 1024px) and (max-width: 1160px) {
	.ldr-nav__menu > li,
	.ldr-nav__menu > li:first-child,
	.ldr-nav__menu > li.ldr-nav__button {
		padding: 0 12px;
	}
}
@media only screen and (width: 1024px) {
	.ldr-nav__menu > li,
	.ldr-nav__menu > li:first-child,
	.ldr-nav__menu > li.ldr-nav__button {
		padding: 0 10px;
	}
}

/* ---------- Hamburger: 1023px and narrower ---------- */
@media only screen and (max-width: 1023px) {
	.ldr-nav .ldr-nav__toggle {
		display: inline-block !important;
	}
	.ldr-nav__menu {
		display: none;
		position: absolute;
		top: 44px;
		left: 0;
		width: 100%;
		background: #000;
		border-top: 1px solid var(--ldr-line);
		border-bottom: 1px solid var(--ldr-line);
	}
	.ldr-nav.is-open .ldr-nav__menu {
		display: block;
	}
	.ldr-nav__menu a {
		padding: 0 25px 0 15px;
		border-bottom: 1px solid var(--ldr-line);
		font-size: 16px;
		line-height: 34px;
	}
	.ldr-nav__menu > .current-menu-item > a,
	.ldr-nav__menu > .current-menu-ancestor > a,
	.ldr-nav__menu a:hover {
		color: var(--ldr-teal);
	}
	.ldr-nav .menu-item-has-children > a::after {
		right: 14px;
	}
	.ldr-nav .menu-item-has-children.is-open > a::after {
		border-top: 0;
		border-bottom: 4px solid var(--ldr-text);
	}

	/* Submenus open in place when their parent is tapped */
	.ldr-nav .sub-menu {
		display: none;
	}
	.ldr-nav .is-open > .sub-menu {
		display: block;
	}
	.ldr-nav .sub-menu a {
		padding-left: 30px;
	}
}

@media only screen and (max-width: 649px) {
	.ldr-nav .ldr-nav__toggle {
		float: right;
	}
}
