/*
 * AMA chrome — site header + footer.
 *
 * Modeled on members.academyofmagicalarts.com: red textured masthead with
 * the centered owl crest, slim dark navigation bar, red damask footer with
 * reservations/about/quick-links/hours columns and a lower legal bar.
 * Loaded site-wide after global.css so it wins ties against the ported
 * Magic Castle header styles.
 *
 * Portal palette reference:
 *   maroon #800000 · gold #d8aa57 (hover #c49a57) · teal button #4db6ac
 *   footer text #bebebe · dark strip #191a1a
 */

/* ------------------------------------------------------------------ *
 * Header masthead — red texture, centered crest
 * ------------------------------------------------------------------ */
header.main.ama-header {
	display: block;
	background: #6e0000;
}

header.main .ama-masthead {
	background:
		url("../images/club-images/header-container-bg.png") top center no-repeat,
		url("../images/club-images/header-repeating-bg.png") repeat;
	background-size: 1214px 200px, auto;
	text-align: center;
	padding: 10px 0;
	position: relative;
}

/* global.css positions .logo-wrap absolutely for the MC header — return it
 * to the centered flow; MC also transforms the logo for a slide effect
 * (translateX(-52%) = exactly the 230px offset seen in testing) */
header.main .ama-masthead .logo-wrap {
	position: static;
	display: inline-block;
	float: none;
	margin: 0;
	transform: none;
	transition: none;
}

header.main .ama-masthead .logo {
	display: inline-block;
	position: static;
	transform: none;
	width: min(443px, 92%) !important;
	height: auto !important;
	max-width: none;
	margin: 0;
}

/* ------------------------------------------------------------------ *
 * Navigation bar — dark strip under the masthead
 * ------------------------------------------------------------------ */
header.main .ama-navbar {
	background: #3c0d0d;
	position: relative;
	left: 0;
	right: 0;
	margin: 0 auto;
	max-width: none;
	/* the ported MC styles off-canvas the bare `nav` element; pin ours.
	 * Must outrank global.css `.content { z-index: 999 }` — the submenus
	 * drop past the navbar's bottom edge onto the page area, and at z-50
	 * the content painted over them (bar-over-submenu bug). */
	z-index: 1001;
}

header.main .ama-navbar .container {
	position: static;
	display: flex;
	align-items: center;
	text-align: left;
}

header.main .ama-nav {
	display: inline-block;
	margin-right: auto;
}

header.main .ama-nav ul.ama-menu,
header.main .ama-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

header.main .ama-nav ul.ama-menu > li,
header.main .ama-nav ul > li {
	display: inline-block;
	position: relative;
	margin: 0;
}

header.main .ama-nav ul.ama-menu > li > a,
header.main .ama-nav ul > li > a {
	display: inline-block;
	padding: 14px 18px;
	color: #fff;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 16px;
	font-size: 1rem;
	letter-spacing: 2px;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.2s ease-out;
}

header.main .ama-nav ul.ama-menu > li > a:hover,
header.main .ama-nav ul.ama-menu > li > a:focus,
header.main .ama-nav ul > li > a:hover,
header.main .ama-nav ul > li > a:focus {
	color: #d8aa57;
}

/* Dropdowns */
header.main .ama-nav ul li.menu-item-has-children ul.sub-menu,
header.main .ama-nav ul li ul.sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 999;
	min-width: 200px;
	background: #2a0909;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
	text-align: left;
}

/* Hover bridge: extends the parent item's hover area a little below its
 * box so any sub-pixel seam (rounding, zoom, font metrics) can't break
 * the hover chain while traveling into the submenu.
 * !important values pin it invisible — the legacy global.css `nav a:after`
 * rule paints a red expanding bar on this exact pseudo-element otherwise
 * (transparent bg, no legacy hover opacity/width, no transition). */
header.main .ama-nav ul li.menu-item-has-children > a {
	position: relative; }
header.main .ama-nav ul li.menu-item-has-children > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 14px;
	background: transparent !important;
	opacity: 1 !important;
	width: auto;
	transform: none;
	transition: none; }

header.main .ama-nav ul li ul.sub-menu li {
	display: block;
}

header.main .ama-nav ul li ul.sub-menu li a {
	display: block;
	padding: 10px 16px;
	color: #e9dcc7;
	font-size: 13px;
	font-size: 0.8125rem;
	letter-spacing: 1px;
}

header.main .ama-nav ul li ul.sub-menu li a:hover {
	color: #d8aa57;
	background: rgba(216, 170, 87, 0.08);
}

/* ------------------------------------------------------------------ *
 * Neutralize global.css's legacy `header.main nav` block. It was written
 * for the source theme's bare <nav> and leaks onto nav.ama-navbar:
 *   - sub-menu hidden at top:90%, jumping to calc(100% + 5px) on hover
 *     with a .5s slide (the reported gap + laggy panel)
 *   - red expanding underline bars on links (a:after)
 *   - equal-width flex:1 items across the bar
 * Our navbar is fully styled above; pin the leaked properties.
 * ------------------------------------------------------------------ */
header.main nav.ama-navbar {
	margin: 0 auto;
	max-width: none;
	top: auto;
	left: auto;
}

@media only screen and (min-width: 1100px) {
	header.main nav.ama-navbar > ul.ama-menu > li {
		flex: 0 0 auto;
	}
}

header.main nav.ama-navbar a::after {
	content: none;
}

header.main nav.ama-navbar li ul.sub-menu,
header.main nav.ama-navbar li:hover ul.sub-menu {
	top: 100%;
	padding-top: 0;
	border-radius: 0;
	transition: none;
	visibility: visible;
	opacity: 1;
}

/* Desktop: lay the top-level items out as a flex row. As inline-blocks they
 * sat on the text baseline, leaving an invisible band of dead navbar below
 * their hover boxes — the pointer crossed it and the submenu vanished
 * before it could be reached (and stray whitespace showed gaps between
 * items). Flex items fill the navbar flush, so the submenu (top: 100%)
 * starts exactly at the item's bottom edge. */
@media only screen and (min-width: 901px) {
	header.main .ama-nav ul.ama-menu {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}
	header.main .ama-nav ul.ama-menu > li {
		display: block;
	}
	/* block-level links fill the li exactly (inline-block links sit on the
	 * baseline, leaving a sliver of li between the link box and the
	 * submenu at top: 100%) */
	header.main .ama-nav ul.ama-menu > li > a,
	header.main .ama-nav ul > li > a {
		display: block;
	}
}

/* Mobile toggle — hidden on desktop, wired by ama-chrome.js */

/* The WP admin bar pushes the page down 32px for signed-in admins; that
 * gap exposes the html background (white by default). Paint it with the
 * bar color so logged-in views have no white strip above the masthead. */
html {
	background-color: #3c0d0d;
}

header.main .ama-navbar .menu-toggle {
	display: none;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 12px;
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
}

header.main .ama-navbar .menu-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	margin: 3px 0;
	background: #fff;
}

/* ------------------------------------------------------------------ *
 * Footer — damask panel + lower legal bar
 * ------------------------------------------------------------------ */
.ama-footer {
	margin-top: 3rem;
}

.ama-footer-main {
	background:
		url("../images/backgrounds/bg_footer.jpg") center / cover no-repeat,
		#4a0e0e;
	color: #f3e9d8;
	padding: 3rem 0 2.5rem;
}

.ama-footer-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem 4%;
}

.ama-footer-col {
	flex: 1 1 260px;
}

.ama-footer-col h3 {
	color: #fff;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 20px;
	font-size: 1.25rem;
	letter-spacing: 3px;
	text-transform: uppercase;
	margin: 0 0 0.75rem;
}
.ama-footer-menu li a,
.ama-hours li {
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
}

.ama-footer-col h3 + p,
.ama-footer-col p {
	margin: 0 0 1.5rem;
	line-height: 1.6;
	color: #f3e9d8;
}

.ama-footer-address {
	font-size: 18px;
	font-size: 1.125rem;
}

.ama-btn {
	display: inline-block;
	padding: 8px 22px;
	background: #4db6ac;
	color: #103c38;
	border-radius: 3px;
	font-family: "FuturaPT", "Futura-Book", Futura, sans-serif;
	font-size: 14px;
	font-size: 0.875rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-decoration: none;
	transition: background 0.2s ease-out;
}

.ama-btn:hover,
.ama-btn:focus {
	background: #63c6bc;
	color: #103c38;
	text-decoration: none;
}

.ama-footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ama-footer-menu li {
	margin: 0 0 0.5rem;
}

.ama-footer-menu li a {
	color: #f3e9d8;
	text-decoration: none;
}

.ama-footer-menu li a:hover,
.ama-footer-menu li a:focus {
	color: #d8aa57;
	text-decoration: underline;
}

.ama-hours {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ama-hours li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 6px 0;
	background: url("../images/backgrounds/bg_line-dotted.png") bottom center repeat-x;
}

.ama-hours li span:last-child {
	white-space: nowrap;
}

.ama-footer-note {
	margin-top: 1rem;
	font-size: 13px;
	font-size: 0.8125rem;
	color: #e0cba8;
}

.ama-footer-lower {
	background: #191a1a;
	color: #bebebe;
}

.ama-footer-lower-in {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem 2rem;
	padding: 1rem 0;
}

.ama-legal {
	margin: 0;
	font-size: 13px;
	font-size: 0.8125rem;
}

.ama-legal a {
	color: #bebebe;
	text-decoration: none;
}

.ama-legal a:hover,
.ama-legal a:focus {
	color: #d8aa57;
}

.ama-social {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ama-social a {
	display: inline-flex;
	opacity: 0.85;
}

.ama-social a:hover,
.ama-social a:focus {
	opacity: 1;
}

.ama-footer-fringe {
	height: 24px;
	background: url("../images/backgrounds/bg_footer-lower.png") bottom center repeat-x;
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media only screen and (max-width: 900px) {
	header.main .ama-navbar {
		min-height: 48px;
	}
	/* the ported .container collapses at mobile widths — anchor the toggle
	 * to the navbar itself instead */
	header.main .ama-navbar .container {
		position: static;
	}
	header.main .ama-navbar .menu-toggle {
		display: block;
		top: 9px;
		transform: none;
	}
	header.main .ama-nav {
		display: none;
		width: 100%;
	}
	header.main .ama-nav.ama-open {
		display: block;
		padding-top: 48px; /* keep the floating toggle clear of the first item */
		padding-bottom: 0.5rem;
	}
	header.main .ama-nav ul.ama-menu > li,
	header.main .ama-nav ul > li {
		display: block;
	}
	header.main .ama-nav ul.ama-menu > li > a,
	header.main .ama-nav ul > li > a {
		display: block;
		padding: 10px 16px;
	}
	header.main .ama-nav ul li.menu-item-has-children ul.sub-menu,
	header.main .ama-nav ul li ul.sub-menu {
		display: none;
		position: static;
		box-shadow: none;
		background: rgba(0, 0, 0, 0.25);
	}
	header.main .ama-nav ul li.ama-submenu-open > ul.sub-menu {
		display: block;
	}
}

@media only screen and (max-width: 700px) {
	header.main .ama-masthead {
		padding: 6px 0;
	}
	.ama-footer-grid {
		flex-direction: column;
	}
}

/* ------------------------------------------------------------------ *
 * Member chip (navbar, right on desktop / left on mobile):
 * "Welcome, {first name}" + Log Out when signed in, Member Login chip
 * (Auth0 popup) when signed out. Contrast on #3C0D0D: parchment
 * #F2E3C4 ≈ 11:1, gold #D8AA57 ≈ 6.5:1. ✓
 * ------------------------------------------------------------------ */
header.main .ama-member-menu {
	position: static;
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin: 0 0 0 1.5rem;
	white-space: nowrap;
	z-index: 2;
}

/* Welcome contrast on #3C0D0D: parchment ≈ 11:1 ✓ (bumped specificity so
 * nothing downstream can dim it) */
header.main .ama-navbar .ama-member-menu .ama-member-welcome {
	color: #f2e3c4;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 15px;
	font-size: 0.9375rem;
	letter-spacing: 1px;
}

header.main .ama-member-login,
header.main .ama-member-logout,
header.main .ama-member-changepw {
	display: inline-block;
	color: #d8aa57;
	background: none;
	border: 1px solid #d8aa57;
	border-radius: 2px;
	padding: 6px 12px;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 14px;
	font-size: 0.875rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.3;
	transition: background 0.2s ease-out, color 0.2s ease-out;
}

header.main .ama-member-login:hover,
header.main .ama-member-login:focus-visible,
header.main .ama-member-logout:hover,
header.main .ama-member-logout:focus-visible,
header.main .ama-member-changepw:hover,
header.main .ama-member-changepw:focus-visible {
	background: #d8aa57;
	color: #3c0d0d;
}

/* Member pages load member-home.css whose a.ama-login-button rule paints
 * the red card button — keep the header chip in the navbar language. */
header.main .ama-member-login.ama-login-button {
	background: none;
	color: #d8aa57;
	border-color: #d8aa57;
	padding: 6px 12px;
}

@media (max-width: 900px) {
	header.main .ama-member-welcome {
		display: none; /* keep the bar slim; the logout chip remains */
	}
}

/* ------------------------------------------------------------------ *
 * Hamburger panel menu — all viewports. Toggle on the left, member chip
 * on the right; the panel drops under the navbar with parent items as
 * category headings (gold, small-caps, ruled) and their children always
 * visible beneath them. No hover dependency; works with keyboard focus.
 * ------------------------------------------------------------------ */
header.main .ama-navbar {
	display: flex;
	align-items: center;
	min-height: 52px;
}

/* Labeled menu chip: bars fold into an X when open (JS adds .is-open) */
header.main .ama-navbar .menu-toggle {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	position: static;
	top: auto;
	right: auto;
	left: auto;
	transform: none;
	background: none;
	border: 0;
	padding: 7px 12px;
	cursor: pointer;
}

/* The legacy span rule (3 classes + 1 element) paints ANY span descendant
 * white 22x2 — beat it explicitly for the wrapper and label. */
header.main .ama-navbar .menu-toggle span.menu-toggle-icon {
	display: block;
	background: none;
	width: 24px;
	height: auto;
	margin: 0 2px 0 0;
	flex: 0 0 auto;
}

header.main .ama-navbar .menu-toggle span.menu-toggle-label {
	background: none;
	width: auto;
	height: auto;
	margin: 0;
}

header.main .ama-navbar .menu-toggle .menu-toggle-icon span {
	display: block;
	width: 100%;
	height: 2px;
	margin: 4px 0;
	background: #d8aa57;
	transition: transform 0.25s ease-out, opacity 0.2s ease-out;
}

header.main .ama-navbar .menu-toggle-icon span {
	display: block;
	width: 100%;
	height: 2px;
	margin: 4px 0;
	background: #d8aa57;
	transition: transform 0.25s ease-out, opacity 0.2s ease-out;
}

header.main .ama-navbar .menu-toggle.is-open span.menu-toggle-icon span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

header.main .ama-navbar .menu-toggle.is-open span.menu-toggle-icon span:nth-child(2) {
	opacity: 0;
}

header.main .ama-navbar .menu-toggle.is-open span.menu-toggle-icon span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

header.main .ama-navbar .menu-toggle-label {
	color: #f2e3c4;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 15px;
	font-size: 0.9375rem;
	letter-spacing: 1px;
	font-variant: small-caps;
}

header.main .ama-navbar .menu-toggle:hover .menu-toggle-label,
header.main .ama-navbar .menu-toggle:focus-visible .menu-toggle-label {
	color: #d8aa57;
}

header.main .ama-member-menu {
	position: static;
	margin: 0 0 0 auto;
}

header.main .ama-nav {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	margin: 0;
	background: #3c0d0d;
	border-top: 1px solid rgba(216, 170, 87, 0.4);
	box-shadow: none;
	z-index: 1000;
	max-height: calc(100vh - 140px);
	overflow: hidden auto;
	padding: 1.4rem clamp(14px, 4vw, 44px) 1.8rem;
}

header.main .ama-nav.ama-open {
	display: block;
	animation: amaPanelDown 0.28s ease-out;
}

@keyframes amaPanelDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	header.main .ama-nav.ama-open {
		animation: none;
	}

	header.main .ama-navbar .menu-toggle-icon span {
		transition: none;
	}
}

header.main .ama-nav ul.ama-menu {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
	gap: 1.5rem 2.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

header.main .ama-nav ul.ama-menu > li {
	display: block;
	position: static;
	margin: 0;
}

/* Parent = category heading */
header.main .ama-nav ul.ama-menu > li > a {
	display: block;
	padding: 0 0 0.5rem;
	margin: 0 0 0.65rem;
	border-bottom: 1px solid rgba(216, 170, 87, 0.4);
	color: #d8aa57;
	background: none;
	font-variant: small-caps;
	letter-spacing: 2px;
	font-size: 1rem;
	text-transform: uppercase;
}

header.main .ama-nav ul.ama-menu > li > a:hover,
header.main .ama-nav ul.ama-menu > li > a:focus-visible {
	color: #f2e3c4;
}

/* Parents without children: heading look without a stray rule */
header.main .ama-nav ul.ama-menu > li:not(.menu-item-has-children) > a {
	border-bottom: 0;
	margin-bottom: 0;
}

/* Children: always visible beneath their parent. The first two selectors
 * match (and exceed) the legacy hover-dropdown rules — the old
 * `display: none` has 4 classes and would otherwise win the tie. */
header.main .ama-nav ul li ul.sub-menu,
header.main .ama-nav ul li.menu-item-has-children ul.sub-menu,
header.main .ama-nav ul li.ama-submenu-open ul.sub-menu {
	display: block;
	position: static;
	background: none;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

header.main .ama-nav ul li.menu-item-has-children ul.sub-menu li a {
	padding: 0.3rem 0;
	color: #f2e3c4;
}

header.main .ama-nav ul li ul.sub-menu li {
	display: block;
	margin: 0;
}

header.main .ama-nav ul li ul.sub-menu li a {
	display: block;
	padding: 0.3rem 0 0.3rem 1.1rem;
	text-indent: 0;
	color: #f2e3c4;
	background: none;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 15px;
	font-size: 0.9375rem;
	letter-spacing: 0.5px;
	text-transform: none;
}

header.main .ama-nav ul li ul.sub-menu li a:hover,
header.main .ama-nav ul li ul.sub-menu li a:focus-visible {
	color: #d8aa57;
	background: none;
}

/* The legacy global nav-link :after — an expanding red underline bar
 * (5px tall, 100% width) — renders under the shortest panel column and
 * reads as a stray shadow bar. The hover-bridge ::after is also obsolete
 * now that submenus are permanently visible. Kill all pseudo-elements on
 * panel links. */
header.main .ama-nav a::after,
header.main .ama-nav a::before {
	content: none !important;
	display: none !important;
}

/* ------------------------------------------------------------------ *
 * Menu section titles + dividers (Appearance → Menus).
 * Custom-link items (URL "#") tagged with a CSS class via Screen
 * Options become inert chrome inside the nav panel:
 *   - `menu-section-title` — uppercase group label. At child level it
 *     heads a run of links; at top level it keeps the category-heading
 *     look (rule above) minus the click/hover.
 *   - `menu-divider`       — hairline rule between links; the label
 *     text (use "—") renders invisible under it.
 * pointer-events:none makes them inert to the mouse, but the "#"
 * anchor stays keyboard-focusable and Enter would jump to page top.
 * TODO: QA-inert-links — if that bothers anyone, strip the href via a
 * walker filter instead of CSS.
 * ------------------------------------------------------------------ */
header.main .ama-nav ul li.menu-section-title > a,
header.main .ama-nav ul li.menu-section-title > a:hover,
header.main .ama-nav ul li.menu-section-title > a:focus-visible {
	pointer-events: none;
	cursor: default;
}

/* Child-level group label: small, muted, aligned with the links it heads */
header.main .ama-nav ul li ul.sub-menu li.menu-section-title > a,
header.main .ama-nav ul li ul.sub-menu li.menu-section-title > a:hover,
header.main .ama-nav ul li ul.sub-menu li.menu-section-title > a:focus-visible {
	padding: 0.9rem 0 0.2rem 1.1rem;
	color: rgba(242, 227, 196, 0.55);
	background: none;
	font-family: "IM Fell English", "Brothers Regular Alt", serif;
	font-size: 13px;
	font-size: 0.8125rem;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

/* Divider: label hidden, the anchor collapses to just its top border */
header.main .ama-nav ul li.menu-divider > a,
header.main .ama-nav ul li ul.sub-menu li.menu-divider > a,
header.main .ama-nav ul li.menu-divider > a:hover,
header.main .ama-nav ul li ul.sub-menu li.menu-divider > a:hover,
header.main .ama-nav ul li.menu-divider > a:focus-visible,
header.main .ama-nav ul li ul.sub-menu li.menu-divider > a:focus-visible {
	pointer-events: none;
	cursor: default;
	overflow: hidden;
	height: 0;
	padding: 0;
	margin: 0.9rem 0 0;
	border: 0;
	border-top: 1px solid rgba(216, 170, 87, 0.4);
	color: transparent;
	font-size: 0;
	line-height: 0;
	background: none;
}
