/* ==========================================================================
   Header — green bar, centered dropdown nav, double-rule bottom mark, paper
   search overlay + mobile drawer. Bespoke chrome via inc/header-tokens.php.
   Content width matches the page/footer: root gutter on the outer element,
   contentSize max-width on the inner (no padding on inner).
   ========================================================================== */

.wulr-header {
	position: relative;
	z-index: 900;
	padding-left: clamp(1.5rem, 4vw, 48px);
	padding-right: clamp(1.5rem, 4vw, 48px);
}
.wulr-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 32px 0;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 48px;
}

/* ---- Wordmark ---- */
.wulr-wordmark {
	justify-self: start;
	display: block;
	color: var(--wp--preset--color--white);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.03;
	font-size: 30px;
	font-weight: 500;
}
.wulr-footer-wordmark span,
.wulr-wordmark span { display: block; white-space: nowrap; }

/* ---- Primary nav (centered) ---- */
.wulr-nav {
	justify-self: center;
	display: flex;
	align-items: center;
	gap: 36px;
}
.wulr-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: 0;
	padding: 10px 0;
	cursor: pointer;
	color: var(--wp--preset--color--white);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	transition: border-color 0.15s;
}
.wulr-nav-link:hover,
.wulr-nav-link:focus-visible,
.wulr-nav-item:hover .wulr-nav-trigger {
	color: var(--wp--preset--color--white);
	border-bottom-color: var(--wp--preset--color--white);
}
.wulr-caret {
	width: 10px;
	height: 7px;
	margin-left: 4px;
	transition: transform 0.25s ease;
}
.wulr-nav-item:hover .wulr-caret,
.wulr-nav-item:focus-within .wulr-caret { transform: rotate(180deg); }

.wulr-nav-item { position: relative; }
.wulr-dropdown {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	min-width: 220px;
	padding-top: 14px; /* hover bridge — keeps the panel reachable from the trigger */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
	z-index: 40;
}
.wulr-nav-item:hover .wulr-dropdown,
.wulr-nav-item:focus-within .wulr-dropdown,
.wulr-dropdown.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}
.wulr-dropdown-panel {
	background: var(--wp--preset--color--white);
	box-shadow: 0 24px 48px rgba(27, 27, 27, 0.14);
	padding: 14px 0;
}
.wulr-dropdown-link {
	position: relative;
	isolation: isolate;
	display: block;
	padding: 12px 26px;
	color: var(--wp--preset--color--body);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	transition: color 0.12s;
}
/* Hover = a button-like fill inset from the menu edges (not full width): a
   rounded panel painted behind the label, leaving a small frame around it.
   Beige fill + dark ink type (bone-2 reads as a beige highlight on the white
   panel; muted #EFEDE9 would be nearly invisible against #FFFFFF). */
.wulr-dropdown-link::before {
	content: "";
	position: absolute;
	inset: 3px 10px;
	z-index: -1;
	border-radius: 4px;
	background: transparent;
	transition: background 0.12s;
}
.wulr-dropdown-link:hover,
.wulr-dropdown-link:focus-visible {
	color: var(--wp--preset--color--body);
}
.wulr-dropdown-link:hover::before,
.wulr-dropdown-link:focus-visible::before {
	background: var(--wp--preset--color--bone-2);
}

/* ---- Right-hand controls ---- */
.wulr-header-right {
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 14px;
}
.wulr-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--wp--preset--color--white);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.wulr-icon-btn:hover,
.wulr-icon-btn:focus-visible { background: rgba(255, 255, 255, 0.12); color: var(--wp--preset--color--white); }
.wulr-share-btn svg,
.wulr-icon-btn svg { width: 20px; height: 20px; }
.wulr-subscribe-cta {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 18px;
	border: 1.5px solid var(--wp--preset--color--white);
	border-radius: 999px;
	color: var(--wp--preset--color--white);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}
.wulr-subscribe-cta:hover,
.wulr-subscribe-cta:focus-visible,
.wulr-404 .wulr-search-block .wp-block-search__button {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
}
.wulr-menu-toggle { display: none; }
/* Hamburger bars morph into an X while the drawer is open. */
.wulr-burger {
	position: relative;
	display: block;
	width: 20px;
	height: 14px;
}
.wulr-burger span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transition: transform 0.25s ease, opacity 0.2s ease;
}
.wulr-burger span:nth-child(1) { top: 0; }
.wulr-burger span:nth-child(2) { top: 6px; }
.wulr-burger span:nth-child(3) { top: 12px; }
.wulr-menu-toggle.is-open .wulr-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.wulr-menu-toggle.is-open .wulr-burger span:nth-child(2) { opacity: 0; }
.wulr-menu-toggle.is-open .wulr-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Double-rule mark below the header (paper strip, green rules) ----
   Interior pages only — hidden on the front page (WP `home` body class) and on
   archive pages (WP `archive` body class), where the header sits directly above
   the green masthead hero. */
.wulr-header-mark {
	background: var(--wp--preset--color--white);
	padding-top: var(--wulr-rule-offset);
}
.home .wulr-header-mark,
.archive .wulr-header-mark,
.page .wulr-header-mark,
.search .wulr-header-mark,
.error404 .wulr-header-mark { display: none; }
/* …except the Print page + Online archive, which share the beige masthead and
   want the brand double-rule under the header (as on the article template).
   Higher specificity (body + class) beats the `.page`/`.archive` hide above.
   Offwhite (`muted`) strip to blend into the beige body, not the article white. */
body.page-print .wulr-header-mark,
body.category-online .wulr-header-mark {
	display: block;
	background: var(--wp--preset--color--muted);
}
.wulr-hdm-thick { height: var(--wulr-rule-thick); background: var(--wp--preset--color--primary); }
/* margin-top is the rule gap on a two-div flow build (pre-existing structure —
   the other instances draw the gap with abspos offsets or a gradient stop). */
.wulr-hdm-thin { height: var(--wulr-rule-thin); margin-top: var(--wulr-rule-gap); background: var(--wp--preset--color--primary); }

/* ---- Shared eyebrow (font-size scoped to chrome; blocks use fontSize attr) ---- */
.wulr-eyebrow {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 700;
	letter-spacing: 0.08rem; /* match the post-card eyebrow/all-caps tracking */
	text-transform: uppercase;
}
.wulr-search-inner .wulr-eyebrow { font-size: 12px; }

/* ---- Search overlay (paper) ---- */
.wulr-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 1200;
	background: var(--wp--preset--color--white);
	opacity: 0;
	visibility: hidden;
	overflow-y: auto;
	transition: opacity 0.2s, visibility 0.2s;
}
.wulr-search-overlay.is-open { opacity: 1; visibility: visible; }
.wulr-search-close {
	position: absolute;
	top: 28px;
	right: clamp(1.5rem, 4vw, 48px);
	width: 44px;
	height: 44px;
	/* stone (>=3:1) — close-button boundary on the white overlay; rule token was 1.8:1 (1.4.11). */
	border: 1px solid var(--wp--preset--color--stone);
	color: var(--wp--preset--color--body);
}
.wulr-search-close:hover,
.wulr-search-close:focus-visible { background: var(--wp--preset--color--body); color: var(--wp--preset--color--white); }
.wulr-search-close svg { width: 18px; height: 18px; }
.wulr-search-inner { max-width: 920px; margin: 0 auto; padding: 132px 32px 96px; }
.wulr-search-inner .wulr-eyebrow { color: var(--wp--preset--color--accent); letter-spacing: 0.22em; margin-bottom: 20px; }
.wulr-search-field {
	display: flex;
	align-items: center;
	gap: 18px;
	border-bottom: 2px solid var(--wp--preset--color--body);
	padding-bottom: 18px;
	color: var(--wp--preset--color--body);
	transition: border-color 0.15s;
}
/* Visible focus indicator for the (outline:none) search input — recolor AND
   thicken the field's underline when the input inside it takes focus, so the
   focus state is an unmistakable weight change, not a subtle hue shift alone. */
.wulr-search-field:focus-within {
	border-bottom-color: var(--wp--preset--color--accent);
	box-shadow: 0 3px 0 -1px var(--wp--preset--color--accent);
}
.wulr-search-field svg { width: 24px; height: 24px; flex-shrink: 0; }
.wulr-search-field input {
	flex: 1;
	background: none;
	border: 0;
	outline: none;
	padding: 8px 0;
	color: var(--wp--preset--color--body);
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 400;
	letter-spacing: -0.01em;
}
.wulr-search-field input::placeholder { color: var(--wp--preset--color--stone); }
.wulr-search-hint {
	margin-top: 16px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--stone);
}
.wulr-search-hint kbd {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 11px;
	font-weight: 700;
	background: var(--wp--preset--color--muted);
	border: 1px solid var(--wp--preset--color--rule);
	padding: 2px 6px;
	border-radius: 3px;
	color: var(--wp--preset--color--body);
	margin: 0 2px;
}
.wulr-search-grid {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 56px;
	margin-top: 64px;
}
.wulr-sog-label {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--body);
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--wp--preset--color--rule);
}
/* lint-allow: coincidental list reset shared with .wulr-drawer-menu / .wulr-browse-list */
.wulr-search-grid ul { list-style: none; margin: 0; padding: 0; } /* UA reset — defeats browser <ul> margins */
.wulr-search-grid li + li { margin-top: 4px; }
.wulr-search-grid a {
	display: block;
	padding: 8px 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: 19px;
	letter-spacing: -0.005em;
	color: var(--wp--preset--color--body);
	text-decoration: none;
	transition: color 0.12s;
}
.wulr-search-grid a:hover { color: var(--wp--preset--color--accent); }

/* Popular Topics — author-curated cloud of tag-style chips. Selectors are
   scoped under .wulr-search-grid so they outrank the generic link rules above. */
.wulr-topic-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.wulr-search-grid .wulr-topic-chip {
	display: inline-block;
	padding: 8px 16px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: -0.005em;
	line-height: 1.2;
	color: var(--wp--preset--color--body);
	text-decoration: none;
	/* stone (>=3:1) — topic-chip boundary on the white overlay; rule token was 1.8:1 (1.4.11). */
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 999px;
	transition: color 0.12s, border-color 0.12s;
}

/* ---- Mobile drawer (full-width paper panel under the header bar) ----
   Opens beneath the green bar (JS measures the bar's bottom edge into
   --wulr-drawer-top before opening; body scroll is locked while open, so the
   measurement holds). The header stays visible above it and the hamburger
   morphs into the close control — no backdrop or in-panel close button. */
.wulr-nav-drawer {
	position: fixed;
	top: var(--wulr-drawer-top, 0px);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1150;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--body);
	opacity: 0;
	transform: translateY(-10px);
	/* visibility:hidden pulls the closed drawer out of the tab order so its
	   links aren't focusable while aria-hidden — transitioned so the fade-out
	   stays visible for the full 0.22s before it disappears. */
	visibility: hidden;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
	overflow-y: auto;
}
.wulr-nav-drawer.is-open { opacity: 1; transform: translateY(0); visibility: visible; }
.wulr-drawer-nav {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	padding: 8px clamp(1.5rem, 4vw, 48px) 28px; /* gutter matches the site root padding */
}
/* lint-allow: coincidental list reset shared with .wulr-search-grid ul / .wulr-browse-list */
.wulr-drawer-menu { list-style: none; margin: 0; padding: 0; } /* UA reset — defeats browser <ul> margins */
.wulr-drawer-item { border-bottom: 1px solid var(--wp--preset--color--rule-soft); }
.wulr-drawer-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 22px 0;
	background: none;
	border: 0;
	cursor: pointer;
	text-align: left;
	color: var(--wp--preset--color--body);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: 24px;
	line-height: 1.2;
	transition: color 0.12s;
}
.wulr-drawer-link:hover,
.wulr-drawer-link:focus-visible { color: var(--wp--preset--color--accent); }
.wulr-drawer-link .wulr-chevron {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	transition: transform 0.25s ease;
}
.wulr-drawer-trigger[aria-expanded="true"] .wulr-chevron { transform: rotate(90deg); }
/* Accordion panel — grid-rows 0fr→1fr animates open/closed at auto height;
   the inner wrapper carries overflow:hidden + a delayed visibility flip so
   collapsed links leave the tab order only after the close animation ends. */
.wulr-drawer-sub {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.25s ease;
}
.wulr-drawer-sub-inner {
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0.25s;
}
.wulr-drawer-sub.is-open { grid-template-rows: 1fr; }
.wulr-drawer-sub.is-open .wulr-drawer-sub-inner { visibility: visible; }
.wulr-drawer-sublink {
	display: block;
	padding: 9px 0;
	color: var(--wp--preset--color--stone);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: 19px;
	transition: color 0.12s;
}
.wulr-drawer-sub-inner .wulr-drawer-sublink:last-child { padding-bottom: 24px; }
.wulr-drawer-sublink:hover,
.wulr-drawer-sublink:focus-visible { color: var(--wp--preset--color--accent); }
.wulr-drawer-cta { margin-top: auto; padding-top: 28px; } /* abspos-like pin: flex column bottom via margin-top:auto (lint-allow) */
.wulr-drawer-subscribe {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border-radius: 999px;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 14px;
	font-weight: 800;
	transition: background 0.15s;
}
/* The drawer only exists at hamburger widths. */
@media (min-width: 901px) {
	.wulr-nav-drawer { display: none; }
}

/* ---- Responsive ---- */
@media (max-width: 1080px) {
	.wulr-nav { gap: 24px; }
	.wulr-nav-link { font-size: 12px; }
	.wulr-wordmark { font-size: 24px; }
}
@media (max-width: 900px) {
	.wulr-header-inner {
		/* Wordmark column must be shrinkable (minmax 0) so the two nowrap
		   wordmark lines can't force the grid — and the right controls —
		   past the viewport edge on narrow screens (was `auto auto`, which
		   locked the column to the wordmark's max-content width and pushed
		   .wulr-header-right ~15-85px off-screen below ~480px). */
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 16px;
		padding: 18px 0;
	}
	.wulr-nav,
	.wulr-subscribe-cta { display: none; }
	.wulr-menu-toggle { display: inline-flex; }
	/* Fluid down to the smallest phones; the mark wraps rather than overflow. */
	.wulr-wordmark { font-size: clamp(16px, 5vw, 20px); }
	.wulr-wordmark span { white-space: normal; }
	.wulr-search-grid { grid-template-columns: 1fr; gap: 32px; }
	.wulr-search-inner { padding: 96px 24px 64px; }
}
