/**
 * Eminence Grey: custom header, news banner, navigation panel.
 * Colors reference the Kadence global palette (see style.css brand tokens).
 */

:root {
	--eg-gutter: clamp(24px, 5vw, 80px);
	--eg-header-height: 80px;
	--eg-panel-line: #8b7da5;
	--eg-panel-muted: #ded7e9;
	--eg-arrow-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
}

/* Sticky needs an ancestor that isn't a scroll container. */
.eg-custom-header #wrapper {
	overflow: visible;
	overflow-x: clip;
}

.eg-site-header,
.eg-site-header *,
.eg-site-header *::before,
.eg-site-header *::after {
	box-sizing: border-box;
}

html.eg-menu-is-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Arrow utility: add class "eg-arrow" to any link or button.
   Core Buttons block: put the class on the block (wrapper); it's applied to the link.
   -------------------------------------------------------------------------- */
.eg-arrow::after,
.wp-block-button.eg-arrow > .wp-block-button__link::after {
	content: "";
	display: inline-block;
	flex-shrink: 0;
	width: 0.8em;
	height: 0.8em;
	margin-inline-start: 0.5em;
	vertical-align: -0.05em;
	background-color: currentColor;
	-webkit-mask: var(--eg-arrow-icon) center / contain no-repeat;
	mask: var(--eg-arrow-icon) center / contain no-repeat;
	transition: transform 0.2s ease;
}

.wp-block-button.eg-arrow::after {
	content: none;
}

.wp-block-button.eg-arrow > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 36px;
}

.wp-block-button.eg-arrow > .wp-block-button__link::after {
	margin-inline-start: 0;
}

.eg-arrow:hover::after,
.eg-arrow:focus-visible::after,
.wp-block-button.eg-arrow > .wp-block-button__link:hover::after {
	transform: translate(2px, -2px);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.eg-button {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 36px;
	min-height: 46px;
	padding: 10px 20px;
	border: 1px solid var(--global-palette1);
	border-radius: 0;
	background: var(--global-palette1);
	color: #fff;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	width: max-content;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.eg-button:hover,
.eg-button:focus-visible {
	background: var(--global-palette2);
	border-color: var(--global-palette2);
	color: #fff;
}

.eg-button--outline {
	background: transparent;
	border-color: var(--global-palette2);
	color: var(--global-palette2);
}

.eg-button.eg-arrow::after {
	margin-inline-start: 0;
}

/* --------------------------------------------------------------------------
   Header shell
   -------------------------------------------------------------------------- */
.eg-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000;
}

@media (max-width: 600px) {
	.admin-bar .eg-site-header {
		top: 0;
	}
}

.eg-site-header :is(a, button):focus-visible {
	outline: 3px solid var(--global-palette6);
	outline-offset: 4px;
}

/* News banner */
.eg-banner {
	background: #3b475b;
	color: #fff;
	text-align: center;
	font-size: 0.75rem;
	line-height: 1.3;
	padding: 0.45rem var(--eg-gutter);
}

.eg-banner__link {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	color: inherit;
	text-decoration: none;
}

a.eg-banner__link:hover,
a.eg-banner__link:focus-visible {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.eg-banner__full,
.eg-banner__compact {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.eg-banner__compact {
	display: none;
}

.eg-site-header .eg-banner :focus-visible {
	outline-color: #fff;
	outline-offset: 2px;
}

/* Logo / Engage / toggle row */
.eg-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	position: relative;
	isolation: isolate;
	height: var(--eg-header-height);
	padding: 0 var(--eg-gutter);
	background: transparent; /* the hero runs up behind the header */
}

/* Translucent bar behind logo / Engage / menu (10% grey, blurred, square corners) */
.eg-header::before {
	content: "";
	position: absolute;
	/* More room left and right: the bar sits further in from the browser edges while the
	   logo and buttons stay lined up with the page content. */
	inset: 8px clamp(10px, calc(var(--eg-gutter) - 36px), 44px);
	z-index: -1;
	background: rgb(171 171 171 / 0.1);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-radius: 0;
}

.eg-brand {
	display: flex;
	align-items: center;
	min-width: 0;
	text-decoration: none;
}

.eg-brand__logo {
	display: block;
	width: clamp(154px, 15.4vw, 238px); /* 30% smaller than the first build */
	height: auto;
	max-height: 38px;
	object-fit: contain;
	object-position: left center;
}

.eg-brand__text {
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #000;
}

.eg-header__actions {
	display: flex;
	align-items: center;
	gap: 28px;
	flex-shrink: 0;
}

.eg-header .eg-button {
	min-height: 42px;
	padding: 7px 18px;
	font-size: 1rem;
}

/* On the dark, see-through header the outline button and menu lines are white */
.eg-header .eg-button--outline {
	border-color: rgb(255 255 255 / 0.55);
	color: #fff;
}

.eg-header .eg-button--outline:hover,
.eg-header .eg-button--outline:focus-visible {
	border-color: #fff;
	background: #fff;
	color: var(--global-palette2);
}

.eg-header .eg-menu-toggle,
.eg-header .eg-menu-toggle:hover,
.eg-header .eg-menu-toggle:focus {
	color: #fff;
}

/* Hamburger (reset Kadence's global button styles) */
.eg-menu-toggle,
.eg-menu-toggle:hover,
.eg-menu-toggle:focus {
	appearance: none;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 7px;
	width: 44px;
	height: 44px;
	padding: 7px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--global-palette2);
	cursor: pointer;
}

/* Pull the toggle so its lines (not its 44px tap area) sit on the right gutter. */
.eg-header__actions .eg-menu-toggle {
	margin-right: -7px;
}

.eg-menu-toggle span {
	display: block;
	width: 30px;
	height: 2px;
	background: currentColor;
	transition: transform 0.25s;
}

.eg-menu-toggle[aria-expanded="true"] span:first-child {
	transform: translateY(4.5px) rotate(45deg);
}

.eg-menu-toggle[aria-expanded="true"] span:last-child {
	transform: translateY(-4.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Navigation panel: right-anchored, expands leftward, 2/3 to 3/4 width
   -------------------------------------------------------------------------- */
.eg-menu-backdrop {
	position: fixed;
	inset: var(--eg-chrome-bottom, 108px) 0 0 0;
	z-index: 1;
	background: rgb(0 0 0 / 0.44);
}

.eg-menu-panel {
	position: fixed;
	top: var(--eg-chrome-bottom, 108px);
	right: 0;
	z-index: 2;
	width: 66.6667vw;
	height: calc(var(--eg-vh, 100dvh) - var(--eg-chrome-bottom, 108px));
	background: var(--global-palette2);
	color: #fff;
	overflow: clip;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.eg-menu-panel.is-open {
	transform: translateX(0);
}

.eg-menu-inner {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
	gap: 16px;
	height: 100%;
	padding: 24px 40px max(20px, env(safe-area-inset-bottom));
}

.eg-menu-nav {
	min-height: 0;
}

.eg-menu-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(5, minmax(0, 1fr));
	grid-auto-flow: column; /* first five links down the left, next five down the right */
	column-gap: 28px;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.eg-menu-links li {
	display: flex;
	min-width: 0;
	min-height: 0;
	margin: 0;
}

.eg-menu-links a {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 12px;
	min-width: 0;
	min-height: 36px;
	padding: 4px 8px;
	border-top: 1px solid var(--eg-panel-line);
	color: #fff;
	font-size: clamp(1rem, 1.6vw, 1.7rem);
	line-height: 1.12;
	text-decoration: none;
}

.eg-menu-links a:hover,
.eg-menu-links a:focus-visible,
.eg-menu-links a[aria-current="page"] {
	background: var(--global-palette1);
	color: #fff;
}

.eg-menu-num {
	flex-shrink: 0;
	font-size: 0.75rem;
	color: var(--eg-panel-muted);
}

.eg-menu-label {
	min-width: 0;
}

.eg-menu-arrow {
	margin-left: auto;
	color: var(--eg-panel-muted);
	font-size: 1rem;
}

.eg-menu-arrow::after {
	margin-inline-start: 0;
}

.eg-menu-empty {
	margin: 0;
	color: var(--eg-panel-muted);
}

/* Coalition callout */
.eg-coalition-callout {
	padding-top: 12px;
	border-top: 1px solid var(--eg-panel-line);
}

.eg-coalition-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.eg-coalition-heading strong {
	font-size: 1.125rem;
	font-weight: 400;
	white-space: nowrap;
}

.eg-coalition-heading a {
	color: #fff;
	white-space: nowrap;
	font-size: 0.875rem;
	line-height: 1.5;
	text-underline-offset: 4px;
}

.eg-coalition-heading a:hover {
	color: var(--eg-panel-muted);
}

/* One row, equal space between the marks. Each logo's height is set per image
   (--eg-logo-h, from header.php) so wide wordmarks and stacked marks carry
   similar visual weight; --eg-logo-scale shrinks the whole row on small screens. */
.eg-coalition-logos {
	--eg-logo-scale: 1;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px 24px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.eg-coalition-logos li {
	display: flex;
	align-items: center;
	margin: 0;
	min-height: calc(46px * var(--eg-logo-scale));
}

.eg-coalition-logos img {
	display: block;
	width: auto;
	height: calc(var(--eg-logo-h, 28px) * var(--eg-logo-scale));
	max-width: none;
	max-height: none;
}

/* --------------------------------------------------------------------------
   Responsive (mirrors the wireframe deck breakpoints)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.eg-menu-panel {
		width: 75vw;
	}

	.eg-menu-inner {
		padding: 20px 24px max(16px, env(safe-area-inset-bottom));
		gap: 12px;
	}

	.eg-menu-links {
		column-gap: 18px;
	}

	.eg-menu-links a {
		font-size: 1.2rem;
	}

	.eg-menu-num {
		display: none;
	}
}

@media (max-width: 600px) {
	:root {
		--eg-gutter: 20px;
		--eg-header-height: 64px;
	}

	.eg-banner__full {
		display: none;
	}

	.eg-banner__compact {
		display: inline;
	}

	.eg-brand__logo {
		width: clamp(104px, 30vw, 136px);
		max-height: 26px;
	}

	.eg-header__actions {
		gap: 10px;
	}

	.eg-header .eg-button {
		gap: 12px;
		padding: 6px 11px;
	}

	.eg-menu-inner {
		padding: 16px 18px max(12px, env(safe-area-inset-bottom));
	}

	.eg-menu-links {
		grid-template-columns: 1fr;
		grid-template-rows: repeat(10, minmax(0, 1fr));
	}

	.eg-menu-links a {
		font-size: 1.125rem;
		min-height: 32px;
		padding-block: 3px;
	}

	.eg-coalition-logos {
		--eg-logo-scale: 0.62;
		justify-content: center;
		gap: 8px 20px;
	}
}

@media (max-width: 360px) {
	.eg-header {
		padding-inline: 14px;
	}

	.eg-brand__logo {
		width: 124px;
	}

	.eg-header__actions {
		gap: 6px;
	}

	.eg-header .eg-button {
		gap: 8px;
		padding-inline: 9px;
		min-height: 44px;
	}
}

/* Short viewports: tighten spacing before typography, then add columns. */
@media (max-height: 680px) {
	.eg-menu-inner {
		padding-top: 12px;
		padding-bottom: max(10px, env(safe-area-inset-bottom));
		gap: 8px;
	}

	.eg-menu-links a {
		font-size: 1.05rem;
	}

	.eg-coalition-callout {
		padding-top: 8px;
	}
}

@media (max-width: 600px) and (max-height: 640px) {
	.eg-menu-inner {
		padding-inline: 12px;
	}

	.eg-menu-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(5, minmax(0, 1fr));
		column-gap: 12px;
	}

	.eg-menu-links a {
		font-size: 0.96rem;
		min-height: 36px;
	}

	.eg-menu-arrow {
		display: none;
	}

	.eg-coalition-logos {
		--eg-logo-scale: 0.5;
		gap: 6px 14px;
	}
}

@media (max-height: 470px) and (min-width: 601px) {
	:root {
		--eg-header-height: 64px;
	}

	.eg-menu-inner {
		padding: 8px 24px;
		gap: 6px;
	}

	.eg-menu-links {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-rows: repeat(4, minmax(0, 1fr));
		column-gap: 18px;
	}

	.eg-menu-links a {
		font-size: 1rem;
		min-height: 32px;
	}

	.eg-menu-num,
	.eg-menu-arrow {
		display: none;
	}

	.eg-coalition-callout {
		display: grid;
		grid-template-columns: 180px 1fr;
		align-items: center;
		gap: 8px;
		padding-top: 6px;
	}

	.eg-coalition-heading {
		display: block;
	}

	.eg-coalition-heading strong {
		display: block;
		font-size: 0.875rem;
	}

	.eg-coalition-logos {
		--eg-logo-scale: 0.62;
		margin-top: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.eg-menu-panel,
	.eg-menu-toggle span,
	.eg-arrow::after,
	.eg-button {
		transition: none;
	}
}

/* Any #anchor jump (a row, a form, a section) lands below the sticky banner + header
   instead of underneath it. --eg-chrome-height is kept current by the header script. */
html {
	scroll-padding-top: calc(var(--eg-chrome-height, 80px) + var(--wp-admin--admin-bar--height, 0px) + 16px);
}

/* Smooth in-page jumps (native, so the header offset above applies) */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}
