/* =========================================================================
   86'd Me shared mobile header and expanded menu (Phase 1)
   Source of truth for the look: 86dme-homepage-combined.zip (approved).
   Every selector is scoped to .hp86-header or .hp86-menu (or html.hp86-menu-*),
   so nothing here changes article pages, ads or desktop.

   Visible at 1023px and below (the theme's existing mobile breakpoint). At those
   widths the old #primary-nav header is hidden, but only when this header is on the
   page (sibling selector), so templates without it are untouched.

   Sections: 1 tokens  2 show/hide  3 guards against theme-wide rules  4 header
             5 menu panel  6 open state  7 small phones  8 motion
   ========================================================================= */

/* ---------- 1. Design tokens (copied from approved tokens.css and menu.css) ---------- */
.hp86-header, .hp86-menu {
	--hp86-paper: #ffffff;
	--hp86-ink: #141414;
	--hp86-muted: #4a4a4a;
	--hp86-red: #b0151c;
	--hp86-orange: #ff6319;
	--hp86-display: 'Roboto Serif', Georgia, serif;
	--hp86-deck: 'Roboto Serif', Georgia, serif;
	--hp86-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--hp86-gutter: max(16px, env(safe-area-inset-left, 0px));
	--hp86-gutter-right: max(16px, env(safe-area-inset-right, 0px));
	--hp86-menu-navy: #00008b;
	--hp86-menu-orange: #ff6319;
	--hp86-menu-yellow: #fccc0a;
	--hp86-menu-green: #6cbe45;
	--hp86-menu-line: #222222;
}

/* ---------- 2. Show at 1023px and below; desktop keeps the existing header ---------- */
@media (min-width: 1024px) {
	.hp86-header, .hp86-menu { display: none !important; }
}
@media (max-width: 1023px) {
	.hp86-header ~ .mobile-menu-bk,
	.hp86-header ~ #primary-nav { display: none !important; }
}

/* ---------- 3. Guards: the theme sets these on plain elements site-wide ----------
   (body font-weight 200 !important, line-height 2, letter-spacing .5px; uppercase and
   colored links; p/ul/h2 sizes and margins; grey 3px-radius buttons and inputs;
   Bootstrap's content-box search field). Reset them inside the component only. */
.hp86-header, .hp86-menu {
	font-family: var(--hp86-body); font-weight: 400; font-style: normal; font-size: 16px;
	line-height: 1.3; letter-spacing: normal; text-transform: none; text-align: left; color: var(--hp86-ink);
	-webkit-text-size-adjust: 100%;
}
.hp86-header *, .hp86-header *::before, .hp86-header *::after,
.hp86-menu *, .hp86-menu *::before, .hp86-menu *::after { box-sizing: border-box; }
.hp86-header a, .hp86-menu a,
.hp86-header a:visited, .hp86-menu a:visited,
.hp86-header a:hover, .hp86-menu a:hover,
.hp86-header a:focus, .hp86-menu a:focus { color: inherit; text-decoration: none; text-transform: none; transition: none; background: none; }
.hp86-menu p, .hp86-menu h2, .hp86-menu ul, .hp86-menu li, .hp86-menu form, .hp86-menu label { margin: 0; padding: 0; letter-spacing: normal; }
.hp86-menu ul, .hp86-menu li { list-style: none; font-family: inherit; font-weight: inherit; line-height: inherit; }
.hp86-menu h2 { clear: none; }
.hp86-header button, .hp86-menu button {
	border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; margin: 0; line-height: 1;
	font: inherit; color: inherit; text-transform: none; -webkit-appearance: none; appearance: none;
}
.hp86-menu input[type="search"], .hp86-menu input[type="email"], .hp86-menu input[type="text"] {
	box-sizing: border-box; -webkit-appearance: none; appearance: none; border: 0; border-radius: 0; box-shadow: none; margin: 0;
}
.hp86-header svg, .hp86-menu svg { display: block; overflow: visible; }
.hp86-header img { max-width: 100%; vertical-align: middle; }
.hp86-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Focus ring (approved): orange, never the theme's blue outline or underline */
.hp86-header a:focus-visible, .hp86-header button:focus-visible,
.hp86-menu a:focus-visible, .hp86-menu button:focus-visible, .hp86-menu input:focus-visible {
	outline: 3px solid var(--hp86-orange); outline-offset: 2px; border-radius: 4px; box-shadow: none; text-decoration: none;
}

/* ---------- 4. Header (approved header.css + integration.css) ---------- */
.hp86-header {
	position: sticky; top: 0; z-index: 1001;
	background: var(--hp86-paper);
	padding: 6px var(--hp86-gutter-right) 6px var(--hp86-gutter);
	border-bottom: 5px double var(--hp86-ink);
	margin: 0;
	display: grid; grid-template-columns: 48px 1fr 48px; column-gap: 8px; align-items: center;
}
.hp86-header__burger, .hp86-header__close {
	width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--hp86-ink);
}
.hp86-header__close { justify-self: end; }
.hp86-header__close[hidden] { display: none; }
.hp86-header__logo { position: relative; display: block; justify-self: center; width: min(215px, 100%); }
.hp86-header__logo img { display: block; width: 100%; height: auto; }
/* Halloween 2026 decoration (sizes and animation come from #me86-halloween-style in
   navigation.php). Sits at the header's right edge like the old header; hidden while the
   menu is open so it never covers the close button or menu text. */
.hp86-header .hp86-header__seasonal { pointer-events: none; }
html.hp86-menu-open .hp86-header .hp86-header__seasonal { display: none; }

/* Logged-in visitors: keep the sticky header below the WordPress admin bar */
@media (min-width: 601px) and (max-width: 782px) { body.admin-bar .hp86-header { top: 46px; } }
@media (min-width: 783px) { body.admin-bar .hp86-header { top: 32px; } }

/* ---------- 5. Menu panel (approved menu.css, under the shared header) ---------- */
.hp86-menu {
	position: fixed; left: 0; right: 0; bottom: var(--hp86-menu-bottom, 0px); top: var(--hp86-menu-top, 0px); z-index: 1000;
	background: var(--hp86-paper);
	overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
	opacity: 0; transform: translateY(-8px);
	transition: opacity .2s ease, transform .2s ease;
}
.hp86-menu.is-open { opacity: 1; transform: none; }
.hp86-menu[hidden] { display: none !important; }

.hp86-menu__inner {
	max-width: 520px; margin: 0 auto;
	padding: 0 var(--hp86-gutter-right) calc(env(safe-area-inset-bottom, 0px) + 28px) var(--hp86-gutter);
	display: flex; flex-direction: column; gap: 14px;
}

.hp86-menu__accent { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin: 0; }
.hp86-menu__accent span { flex: 1; }
.hp86-menu__accent span:nth-child(1) { background: var(--hp86-menu-navy); }
.hp86-menu__accent span:nth-child(2) { background: var(--hp86-menu-orange); }
.hp86-menu__accent span:nth-child(3) { background: var(--hp86-menu-yellow); }
.hp86-menu__accent span:nth-child(4) { background: var(--hp86-menu-green); }
.hp86-menu__accent span:nth-child(5) { background: var(--hp86-menu-orange); }

.hp86-menu .hp86-menu__mission { margin: -2px 0 0; text-align: center; font-family: var(--hp86-deck); font-style: italic; font-weight: 400; font-size: 13.5px; line-height: 1.35; text-wrap: balance; color: var(--hp86-ink); }

/* Search */
.hp86-menu__search { display: flex; height: 46px; border: 1.5px solid var(--hp86-menu-line); border-radius: 10px; overflow: hidden; background: var(--hp86-paper); }
.hp86-menu .hp86-menu__search input[type="search"] { flex: 1; min-width: 0; height: 100%; padding: 0 14px; font-family: var(--hp86-deck); font-style: italic; font-weight: 400; font-size: 17px; line-height: normal; letter-spacing: normal; color: var(--hp86-ink); background: transparent; outline: none; }
.hp86-menu .hp86-menu__search input[type="search"]:focus { color: var(--hp86-ink); }
.hp86-menu .hp86-menu__search input::placeholder { color: #6a6a6a; opacity: 1; }
.hp86-menu .hp86-menu__search input::-webkit-search-decoration,
.hp86-menu .hp86-menu__search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hp86-menu .hp86-menu__search button { width: 54px; height: 100%; border-left: 1.5px solid var(--hp86-menu-line); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Headings with the curved colored underline */
.hp86-menu .hp86-menu__heading {
	position: relative; margin: 0; padding: 0 0 7px 22px;
	font-family: var(--hp86-display); font-style: italic; font-weight: 800; font-stretch: 80%;
	font-size: 18px; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; color: var(--hp86-ink);
}
.hp86-menu .hp86-menu__heading::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 15px;
	border-left: 3px solid; border-bottom: 3px solid; border-color: var(--hp86-menu-hook, var(--hp86-ink));
	border-bottom-left-radius: 14px; pointer-events: none;
}
.hp86-menu__heading--navy { --hp86-menu-hook: var(--hp86-menu-navy); }
.hp86-menu__heading--orange { --hp86-menu-hook: var(--hp86-menu-orange); }
.hp86-menu__heading--yellow { --hp86-menu-hook: var(--hp86-menu-yellow); }

/* Two-column editorial lists */
.hp86-menu__columns { display: grid; grid-template-columns: minmax(0, 1fr) 1.5px minmax(0, 1fr); column-gap: 14px; margin-top: 4px; }
.hp86-menu__columns--single { grid-template-columns: minmax(0, 1fr); }
.hp86-menu__rule-v { background: var(--hp86-menu-line); }
.hp86-menu__col { display: flex; flex-direction: column; min-width: 0; }
.hp86-menu .hp86-menu__list { margin: 4px 0 0; padding: 0; }
.hp86-menu .hp86-menu__list li { border-bottom: 1.5px solid var(--hp86-menu-line); margin: 0; padding: 0; }
.hp86-menu .hp86-menu__list a {
	display: flex; align-items: center; min-height: 44px; padding: 7px 0 7px 4px;
	font-family: var(--hp86-display); font-style: normal; font-weight: 800; font-stretch: 80%;
	font-size: 15.5px; line-height: 1.12; text-transform: uppercase; letter-spacing: .01em; overflow-wrap: break-word;
}
/* Sub-items (Appearance › Menus, dragged under a parent): always shown, indented under it.
   Menus without sub-items look exactly as before. */
.hp86-menu .hp86-menu__list .sub-menu { margin: -4px 0 6px; padding: 0 0 0 12px; }
.hp86-menu .hp86-menu__list .sub-menu li { border-bottom: 0; }
.hp86-menu .hp86-menu__list .sub-menu a {
	min-height: 44px; padding: 5px 0 5px 10px; border-left: 2px solid var(--hp86-menu-line);
	font-weight: 700; font-size: 13px; line-height: 1.15;
}

/* Get Involved: links in a row */
.hp86-menu__involved { margin-top: 6px; }
.hp86-menu .hp86-menu__involved-links { margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp86-menu .hp86-menu__involved-links li { display: flex; padding: 0 10px; border-left: 1.5px solid var(--hp86-menu-line); }
.hp86-menu .hp86-menu__involved-links li:first-child { border-left: 0; padding-left: 4px; }
/* Any number of links: 1 or 2 side by side, 4 as two rows of 2, otherwise rows of 3.
   Exactly 3 links (the approved design) is unchanged. */
.hp86-menu .hp86-menu__involved-links--cols-1 { grid-template-columns: minmax(0, 1fr); }
.hp86-menu .hp86-menu__involved-links--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp86-menu .hp86-menu__involved-links--cols-1 li,
.hp86-menu .hp86-menu__involved-links--cols-2 li:nth-child(2n+1),
.hp86-menu .hp86-menu__involved-links--cols-3 li:nth-child(3n+1) { border-left: 0; padding-left: 4px; }
.hp86-menu .hp86-menu__involved-links--cols-1 li:nth-child(n+2),
.hp86-menu .hp86-menu__involved-links--cols-2 li:nth-child(n+3),
.hp86-menu .hp86-menu__involved-links--cols-3 li:nth-child(n+4) { border-top: 1.5px solid var(--hp86-menu-line); }
.hp86-menu .hp86-menu__involved-links a {
	display: flex; align-items: center; min-height: 44px;
	font-family: var(--hp86-display); font-style: normal; font-weight: 800; font-stretch: 80%;
	font-size: 12.5px; line-height: 1.15; text-transform: uppercase; letter-spacing: normal;
}

/* Follow row */
.hp86-menu__follow {
	display: grid; grid-template-columns: auto 1.5px auto 1.5px minmax(0, 1fr); align-items: center; column-gap: 12px;
	border-top: 1.5px solid var(--hp86-menu-line); border-bottom: 1.5px solid var(--hp86-menu-line);
	padding: 8px 2px;
}
.hp86-menu__follow-label { font-family: var(--hp86-display); font-weight: 800; font-stretch: 80%; font-size: 14px; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.hp86-menu__follow-sep { align-self: stretch; margin-block: 6px; background: var(--hp86-menu-line); }
.hp86-menu__social { display: flex; gap: 2px; }
.hp86-menu .hp86-menu__social a { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.hp86-menu .hp86-menu__merch { margin: 0; font-family: var(--hp86-deck); font-style: italic; font-weight: 400; font-size: 12.5px; line-height: 1.2; color: var(--hp86-muted); text-align: center; }

/* Newsletter */
.hp86-menu__news { display: flex; flex-direction: column; gap: 8px; }
.hp86-menu .hp86-menu__news-title { margin: 0; padding: 0; font-family: var(--hp86-display); font-style: normal; font-weight: 800; font-stretch: 80%; font-size: 18px; line-height: 1.1; text-transform: uppercase; letter-spacing: normal; color: var(--hp86-ink); }
.hp86-menu .hp86-menu__news-dek { margin: -4px 0 0; font-family: var(--hp86-deck); font-style: italic; font-weight: 400; font-size: 14px; line-height: 1.35; color: var(--hp86-ink); }
.hp86-menu__news-form { display: flex; height: 48px; border: 1.5px solid var(--hp86-menu-line); border-radius: 8px; overflow: hidden; background: var(--hp86-paper); }
.hp86-menu .hp86-menu__news-form input[type="email"] { flex: 1; min-width: 0; height: 100%; padding: 0 14px; font-family: var(--hp86-deck); font-style: italic; font-weight: 400; font-size: 16px; line-height: normal; color: var(--hp86-ink); background: transparent; outline: none; }
.hp86-menu .hp86-menu__news-form input[type="email"]:focus { color: var(--hp86-ink); }
.hp86-menu .hp86-menu__news-form input::placeholder { color: #6a6a6a; opacity: 1; }
.hp86-menu .hp86-menu__news-form button { height: 100%; padding: 0 18px; background: var(--hp86-red); color: #fff; font-family: var(--hp86-body); font-weight: 600; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }

/* ---------- 6. Open state (set on <html> by hp86-menu.js) ---------- */
html.hp86-menu-open .hp86-header { border-bottom-color: transparent; z-index: 99991; }
html.hp86-menu-open .hp86-menu { z-index: 99990; }
/* Mobile Advanced Ads sticky wrappers are marked by hp86-menu.js only after
   their tracking attributes and fixed viewport-edge geometry are verified. */
@media (max-width: 1023px) {
	html.hp86-menu-open .hp86-menu-hidden-sticky-ad {
		visibility: hidden !important;
		opacity: 0 !important;
		pointer-events: none !important;
	}
}
/* Lock the page behind. Only the root is locked: locking <body> as well makes it a
   scroll box and unpins the sticky header (bug found in the approved prototype). */
html.hp86-menu-lock { overflow: hidden; }

/* ---------- 7. Small phones (approved menu.css and integration.css) ---------- */
@media (max-width: 400px) {
	.hp86-menu .hp86-menu__list a { font-size: 14.5px; font-stretch: 75%; }
	.hp86-menu .hp86-menu__heading { font-size: 16.5px; font-stretch: 75%; padding-left: 18px; }
	.hp86-menu__columns { column-gap: 12px; }
}
@media (max-width: 340px) {
	.hp86-menu__columns { column-gap: 10px; }
	.hp86-menu .hp86-menu__list a { font-size: 12.5px; font-stretch: 62%; padding-left: 2px; }
	.hp86-menu .hp86-menu__list .sub-menu a { font-size: 11.5px; font-stretch: 62%; padding-left: 8px; }
	.hp86-menu .hp86-menu__heading { font-size: 14px; font-stretch: 62%; padding-left: 16px; }
	.hp86-menu .hp86-menu__involved-links li { padding: 0 7px; }
	.hp86-menu .hp86-menu__involved-links a { font-size: 11.5px; }
	.hp86-menu__follow { column-gap: 8px; }
	.hp86-menu__follow-label { font-size: 12.5px; }
	.hp86-menu .hp86-menu__merch { font-size: 10.5px; }
	.hp86-menu .hp86-menu__news-form button { padding: 0 12px; font-size: 14px; letter-spacing: .03em; }
	.hp86-menu .hp86-menu__news-form input[type="email"] { padding: 0 10px; font-size: 15px; }
}

/* ---------- 8. Motion ---------- */
@media (prefers-reduced-motion: reduce) { .hp86-menu { transition: none; transform: none; } }
