/* g3d-chrome.css - masthead, primary-nav dropdown, burger drawer and footer. SHELL track. ASCII only.
 *
 * The masthead is the site's: the logo plus the live primary menu, styled like the theme's
 * (33gears theme main.css: Masthead + PRIMARY NAV DROPDOWN, with the theme 1.0.5 fixes).
 * The stage height in css/g3d.css is calc(100svh - var(--g3d-mast-h)), so --g3d-mast-h below
 * is the EXACT total masthead height including the 3px rule.
 *
 *   desktop  22px + 38px logo + 22px + 3px rule = 85px
 *   phone    12px + 32px logo + 12px + 3px rule = 59px
 *
 * Contrast (on #0c0c0d): nav links #c9c9cf 12.0:1, footer links #c9c9cf 12.0:1 on #0a0a0b,
 * footer text #a8a8b0 8.0:1.
 */

:root {
	--g3d-mast-h: 85px;
}

.g3d-masthead {
	box-sizing: border-box;
	position: relative;
	z-index: 200;
	height: var(--g3d-mast-h);
	background: #0c0c0d;
	border-bottom: 3px solid #e11d2a;
	font-family: Oswald, "Arial Narrow", Arial, sans-serif;
}

.g3d-masthead *,
.g3d-masthead *::before,
.g3d-masthead *::after {
	box-sizing: border-box;
}

.g3d-mast-in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	height: 100%;
	padding: 22px 24px;
}

.g3d-logo {
	display: inline-flex;
	align-items: center;
	flex: none;
	line-height: 0;
	color: #fff;
	text-decoration: none;
}

.g3d-logo svg {
	display: block;
	height: 38px;
	width: auto;
}

.g3d-logo-word {
	font-weight: 700;
	font-size: 34px;
	line-height: 1;
	letter-spacing: -0.02em;
}

.g3d-logo-word b {
	color: #e11d2a;
}

.g3d-burger {
	display: none;
}

/* ---------- primary nav ---------- */

.g3d-nav {
	flex: 1;
	display: flex;
	justify-content: center;
	align-self: stretch;
}

.g3d-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: stretch;
	gap: 34px;
}

.g3d-nav li {
	margin: 0;
	padding: 0;
}

.g3d-nav a {
	font-family: Oswald, "Arial Narrow", Arial, sans-serif;
	font-weight: 500;
	font-size: 15px;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	text-decoration: none;
	color: #c9c9cf;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.g3d-nav a:hover,
.g3d-nav .current-menu-item > a,
.g3d-nav .current-menu-parent > a,
.g3d-nav .current-menu-ancestor > a {
	color: #fff;
	border-bottom-color: #e11d2a;
}

.g3d-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 821px) {
	/*
	 * The item fills the masthead row (22px padding above the 38px logo row). The panel
	 * hangs 25px below the item: 22 + 25 + 38 = the total masthead height, so it opens just
	 * under the red rule instead of across it.
	 */
	.g3d-nav > ul > li {
		display: flex;
		align-items: center;
		position: relative;
	}

	/* Hidden with visibility + opacity (not display:none) so the close can be delayed 0.25s. */
	.g3d-nav .sub-menu {
		position: absolute;
		top: calc(100% + 25px);
		left: 50%;
		transform: translateX(-50%);
		z-index: 230;
		min-width: 252px;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 6px 0;
		background: #0c0c0d;
		border: 1px solid rgba(255, 255, 255, 0.1);
		border-top: 2px solid #e11d2a;
		box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
		visibility: hidden;
		opacity: 0;
		transition: opacity 0.15s ease 0.25s, visibility 0s linear 0.4s;
	}

	/* Transparent bridge across the 25px gap (plus 6px into the item): the pointer never leaves hover. */
	.g3d-nav .sub-menu::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -31px;
		height: 31px;
	}

	.g3d-nav > ul > li:hover > .sub-menu,
	.g3d-nav > ul > li:focus-within > .sub-menu {
		visibility: visible;
		opacity: 1;
		transition-delay: 0s;
	}

	/* Moving to another item closes the previous panel at once instead of after the delay. */
	.g3d-nav ul:has(> li:hover) > li:not(:hover) > .sub-menu {
		visibility: hidden;
		opacity: 0;
		transition-delay: 0s;
	}

	.g3d-nav .sub-menu a {
		display: block;
		padding: 11px 18px;
		font-size: 13px;
		letter-spacing: 0.09em;
		border-bottom: 0;
		white-space: nowrap;
	}

	.g3d-nav .sub-menu a:hover {
		color: #fff;
		background: rgba(255, 255, 255, 0.06);
		border-bottom: 0;
	}

	.g3d-nav .sub-menu .current-menu-item > a {
		color: #fff;
	}

	.g3d-nav .menu-item-has-children > a {
		cursor: default;
	}

	.g3d-nav .menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		margin-left: 8px;
		vertical-align: middle;
		border-left: 4px solid transparent;
		border-right: 4px solid transparent;
		border-top: 4px solid currentColor;
	}
}

/* The four top-level items and the logo no longer fit at ease: tighter, and the last panel
   opens right-aligned so it cannot run off the right edge. */
@media (min-width: 821px) and (max-width: 1100px) {
	.g3d-nav ul {
		gap: 22px;
	}

	.g3d-nav a {
		font-size: 14px;
		letter-spacing: 0.09em;
	}

	.g3d-nav .menu-item-has-children > a {
		white-space: nowrap;
	}

	.g3d-mast-in {
		gap: 18px;
	}

	.g3d-nav > ul > li:last-child > .sub-menu {
		left: auto;
		right: 0;
		transform: none;
	}
}

/* ---------- phone: compact masthead + drawer ---------- */

@media (max-width: 820px) {
	:root {
		--g3d-mast-h: 59px;
	}

	.g3d-mast-in {
		padding: 12px 16px;
		gap: 12px;
	}

	.g3d-logo svg {
		height: 32px;
	}

	.g3d-logo-word {
		font-size: 28px;
	}

	.g3d-burger {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 5px;
		width: 44px;
		height: 44px;
		margin: 0 -8px 0 auto;
		padding: 0;
		background: transparent;
		border: 1px solid rgba(255, 255, 255, 0.18);
		border-radius: 2px;
		cursor: pointer;
	}

	.g3d-burger-bar {
		display: block;
		width: 20px;
		height: 2px;
		background: #fff;
	}

	/* The drawer: below the masthead, over the stage. The sub-menu is always open and indented. */
	.g3d-nav {
		display: none;
		position: absolute;
		top: var(--g3d-mast-h);
		left: 0;
		right: 0;
		z-index: 220;
		max-height: calc(100vh - var(--g3d-mast-h));
		max-height: calc(100svh - var(--g3d-mast-h));
		overflow-y: auto;
		padding: 4px 20px 20px;
		background: #0c0c0d;
		border-bottom: 3px solid #e11d2a;
		box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
		justify-content: flex-start;
	}

	.g3d-masthead.is-open .g3d-nav {
		display: block;
	}

	.g3d-nav ul {
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		width: 100%;
	}

	.g3d-nav li {
		width: 100%;
		border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	}

	.g3d-nav a {
		display: block;
		width: 100%;
		padding: 15px 0;
		font-size: 17px;
		border-bottom: 0;
	}

	.g3d-nav a:hover {
		border-bottom: 0;
	}

	.g3d-nav .sub-menu {
		display: flex;
		flex-direction: column;
		margin: 0 0 10px;
		padding: 0 0 0 16px;
		border-left: 2px solid #e11d2a;
	}

	.g3d-nav .sub-menu li {
		border-bottom: 0;
	}

	.g3d-nav .sub-menu a {
		padding: 12px 0;
		font-size: 15px;
	}
}

/* ---------- footer ---------- */

.g3d-footer {
	background: #0a0a0b;
	border-top: 3px solid #e11d2a;
	color: #a8a8b0;
	font-family: Spectral, Georgia, serif;
	font-size: 15px;
	line-height: 1.6;
}

.g3d-footer-in {
	box-sizing: border-box;
	max-width: 720px;
	margin: 0 auto;
	padding: 36px 20px 44px;
}

.g3d-footer-h {
	margin: 0 0 10px;
	font-family: Oswald, "Arial Narrow", Arial, sans-serif;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #fff;
}

.g3d-footer-tools ul {
	list-style: none;
	margin: 0 0 26px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
}

.g3d-footer a {
	color: #c9c9cf;
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.g3d-footer a:hover {
	color: #fff;
	border-bottom-color: #e11d2a;
}

.g3d-footer-tools a {
	font-family: Oswald, "Arial Narrow", Arial, sans-serif;
	font-weight: 500;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-bottom: 0;
}

.g3d-credits {
	margin: 0 0 18px;
	color: #a8a8b0;
}

.g3d-legal {
	margin: 0;
	font-family: Oswald, "Arial Narrow", Arial, sans-serif;
	font-size: 13px;
	letter-spacing: 0.06em;
	color: #a8a8b0;
}

.g3d-legal a {
	border-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.g3d-nav a,
	.g3d-nav .sub-menu {
		transition-duration: 0.001ms;
		transition-delay: 0s;
	}
}
