/* ==========================================================================
   Hallmark site header (includes/site-header.php)
   Replaces the Max Mega Menu header. Fixed over the page hero, frosted and
   solid once scrolled (.sticky-header is added by custom-script.js).
   Overrides the old .header-wrapper rules in skin.css by specificity + order.
   ========================================================================== */

.hh {
	--hh-ink: #050f1b;                                   /* brand dark (same as trans-bg.png) */
	--hh-top: linear-gradient(180deg, rgba(5, 15, 27, .86) 0%, rgba(5, 15, 27, .5) 55%, rgba(5, 15, 27, 0) 100%);
	--hh-solid: rgba(5, 15, 27, .97);
	--hh-drawer: #050f1b;
	--hh-gold: #f9e796;
	--hh-gold-top: #fdf6d6;
	--hh-gold-bottom: #ecca5f;
	--hh-text: #ffffff;
	--hh-h: 112px;          /* roomier at the top of the page */
	--hh-h-stuck: 76px;
	--hh-break: 1140px;
	--hh-ease: cubic-bezier(.2, .7, .2, 1);
	--hh-logo-w: 240px;
}

/* ---- Shell ------------------------------------------------------------ */
.hh-part { display: contents; }
.header-wrapper.hh {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 9999;
	min-height: 0 !important;
	margin: 0;
	padding: 0;
	background: none;
	color: var(--hh-text);
	font-family: "Lato", sans-serif;
}
.admin-bar .header-wrapper.hh { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .header-wrapper.hh { top: 46px; } }

/* Background layer lives on a pseudo-element: putting backdrop-filter on the
   header itself would trap the fixed mobile drawer inside the bar. */
.hh::before {
	content: "";
	position: absolute; left: 0; right: 0; top: 0;
	height: calc(100% + 70px);
	background: var(--hh-top);
	pointer-events: none;
	transition: height .45s var(--hh-ease), background .45s ease, box-shadow .45s ease;
}
.hh.sticky-header::before,
.hh.hh--solid::before {
	height: 100%;
	background: var(--hh-solid);
	-webkit-backdrop-filter: saturate(150%) blur(14px);
	backdrop-filter: saturate(150%) blur(14px);
	box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .7), inset 0 -1px 0 rgba(249, 231, 150, .16);
}
.hh.sticky-header::after { /* warm light along the bottom edge */
	content: "";
	position: absolute; left: 12%; right: 12%; bottom: -1px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(249, 231, 150, .5), transparent);
	pointer-events: none;
}

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

.hh__bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1340px;
	height: var(--hh-h);
	margin: 0 auto;
	padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left, 0px));
	padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right, 0px));
	transition: height .4s var(--hh-ease);
}
.hh.sticky-header .hh__bar { height: var(--hh-h-stuck); }

/* ---- Logo ------------------------------------------------------------- */
.hh__logo {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	width: var(--hh-logo-w);
	max-width: 46vw;
	color: #fff !important;
	text-decoration: none !important;
	transition: width .4s var(--hh-ease);
}
.hh.sticky-header .hh__logo { width: calc(var(--hh-logo-w) * .8); }
.hh.sticky-header .hh__logo img { max-height: calc(var(--hh-h-stuck) - 18px); }
.hh__logo img,
.hh__logo .hh__logo-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(var(--hh-h) - 28px);
	transition: max-height .4s var(--hh-ease);
	object-fit: contain;
	object-position: left center;
}
.hh__logo-text { font-family: "Raleway", sans-serif; font-size: 1.1rem; letter-spacing: .18em; text-transform: uppercase; }
.hh__logo:focus-visible { outline: 2px solid var(--hh-gold); outline-offset: 6px; border-radius: 4px; }

/* ---- Panel (desktop: inline; mobile: slide-in drawer) ------------------ */
.hh__panel {
	display: flex;
	align-items: center;
	gap: clamp(18px, 2.4vw, 36px);
	margin-left: auto;
}

.hh__menu,
.hh__menu ul {
	list-style: none;
	margin: 0 !important;
	padding: 0;
}
.hh__menu { display: flex; align-items: center; gap: 2px; }
.hh__menu li { position: relative; margin: 0; }
.hh__menu a {
	position: relative;
	display: block;
	padding: 12px 14px;
	color: rgba(255, 255, 255, .92) !important;
	font-size: 15px;
	line-height: 1.2;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none !important;
	white-space: nowrap;
	transition: color .25s ease;
}
.hh__menu > li > a::after { /* glowing underline */
	content: "";
	position: absolute; left: 14px; right: 14px; bottom: 4px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, transparent, var(--hh-gold), transparent);
	box-shadow: 0 0 10px rgba(249, 231, 150, .75);
	transform: scaleX(0);
	transition: transform .35s var(--hh-ease);
}
.hh__menu a:hover,
.hh__menu a:focus-visible,
.hh__menu .current-menu-item > a,
.hh__menu .current-menu-ancestor > a,
.hh__menu .current_page_item > a,
.hh__menu .current-page-ancestor > a { color: var(--hh-gold) !important; }
.hh__menu > li > a:hover::after,
.hh__menu > li > a:focus-visible::after,
.hh__menu > .current-menu-item > a::after,
.hh__menu > .current-menu-ancestor > a::after,
.hh__menu > .current_page_item > a::after,
.hh__menu > .current-page-ancestor > a::after { transform: scaleX(1); }
.hh__menu a:focus-visible { outline: 2px solid var(--hh-gold); outline-offset: 2px; border-radius: 6px; }

/* Dropdowns (desktop) */
.hh__menu .menu-item-has-children > a { padding-right: 28px; }
.hh__menu .menu-item-has-children > a::before { /* caret */
	content: "";
	position: absolute; right: 12px; top: 50%;
	width: 6px; height: 6px;
	margin-top: -5px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: .7;
}
.hh__menu .sub-menu {
	position: absolute; left: 0; top: 100%;
	min-width: 230px;
	padding: 8px !important;
	border: 1px solid rgba(249, 231, 150, .16);
	border-radius: 12px;
	background: var(--hh-drawer);
	box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .7);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .25s var(--hh-ease), visibility 0s linear .25s;
}
.hh__menu li:hover > .sub-menu,
.hh__menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}
.hh__menu .sub-menu a { padding: 10px 12px; border-radius: 8px; font-size: 14px; letter-spacing: .08em; }
.hh__menu .sub-menu a:hover { background: rgba(249, 231, 150, .08); }

/* ---- Buttons ---------------------------------------------------------- */
.hh__actions { display: flex; align-items: center; gap: 10px; }
.hh__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .55em;
	min-height: 48px;
	padding: 12px 22px;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none !important;
	transition: transform .25s var(--hh-ease), box-shadow .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
}
.hh__btn .hh__icon { width: 18px; height: 18px; }
.hh__btn--phone {
	border: 1px solid rgba(255, 255, 255, .55);
	background: linear-gradient(180deg, var(--hh-gold-top) 0%, var(--hh-gold) 46%, var(--hh-gold-bottom) 100%);
	color: #0a1630 !important;
	box-shadow: 0 10px 24px -14px rgba(236, 202, 95, .9), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.hh__btn--phone:hover,
.hh__btn--phone:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 12px 26px -12px rgba(236, 202, 95, 1), 0 0 26px rgba(249, 231, 150, .45), inset 0 1px 0 rgba(255, 255, 255, .8);
	color: #0a1630 !important;
}
.hh__btn--ghost {
	border: 1.5px solid rgba(255, 255, 255, .4);
	background: rgba(255, 255, 255, .04);
	color: #fff !important;
}
.hh__btn--ghost:hover,
.hh__btn--ghost:focus-visible { border-color: var(--hh-gold); color: var(--hh-gold) !important; }
.hh__btn:focus-visible { outline: 2px solid var(--hh-gold); outline-offset: 3px; }

/* ---- Mobile controls (hidden on desktop) ------------------------------ */
.hh__call,
.hh .hh__toggle { display: none; }

.hh__scrim[hidden] { display: none !important; }

/* ==========================================================================
   Below 1140px: slide-in drawer
   ========================================================================== */
@media screen and (max-width: 1139px) {
	.hh { --hh-h: 84px; --hh-h-stuck: 66px; }
	.hh__logo { width: min(var(--hh-logo-w), 180px); margin-right: auto; }
	.hh.sticky-header .hh__logo { width: min(calc(var(--hh-logo-w) * .82), 150px); }
	.hh__bar { gap: 10px; }

	.hh__call,
	.hh .hh__toggle {
		position: relative;
		z-index: 3;
		display: inline-grid;
		place-items: center;
		width: 46px; height: 46px;
		min-width: 0 !important;
		min-height: 0 !important;
		padding: 0 !important;
		border-radius: 10px !important;
		cursor: pointer;
	}
	.hh__call {
		border: 1px solid rgba(255, 255, 255, .55);
		background: linear-gradient(180deg, var(--hh-gold-top), var(--hh-gold) 46%, var(--hh-gold-bottom));
		color: #0a1630 !important;
	}
	.hh__call .hh__icon { width: 20px; height: 20px; }
	.hh .hh__toggle,
	.hh .hh__toggle:hover,
	.hh .hh__toggle:focus {
		border: 1px solid rgba(249, 231, 150, .45) !important;
		background: rgba(5, 15, 27, .55) !important;
		color: var(--hh-gold) !important;
	}
	.hh .hh__toggle:focus-visible { outline: 2px solid var(--hh-gold); outline-offset: 2px; }
	.hh__burger,
	.hh__burger span,
	.hh__burger::before,
	.hh__burger::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
	.hh__burger { position: relative; background: none; height: 14px; }
	.hh__burger span { position: absolute; left: 0; top: 6px; transition: opacity .2s ease; }
	.hh__burger::before,
	.hh__burger::after { content: ""; position: absolute; left: 0; transition: transform .35s var(--hh-ease), top .35s var(--hh-ease); }
	.hh__burger::before { top: 0; }
	.hh__burger::after { top: 12px; }
	.hh--open .hh__burger span { opacity: 0; }
	.hh--open .hh__burger::before { top: 6px; transform: rotate(45deg); }
	.hh--open .hh__burger::after { top: 6px; transform: rotate(-45deg); }

	.hh__panel {
		position: fixed;
		top: var(--hh-panel-top, var(--hh-h)); /* set by site-header.js to the bar's bottom edge */
		right: 0;
		bottom: auto;
		z-index: 2;
		width: min(380px, 100vw);
		height: auto;
		max-height: calc(100vh - var(--hh-panel-top, var(--hh-h)));
		max-height: calc(100dvh - var(--hh-panel-top, var(--hh-h)));
		margin: 0;
		padding: 8px 24px calc(24px + env(safe-area-inset-bottom, 0px));
		flex-direction: column;
		align-items: stretch;
		gap: 18px;
		border-bottom-left-radius: 16px;
		border-bottom: 1px solid rgba(249, 231, 150, .14);
		overflow-y: auto;
		overscroll-behavior: contain;
		background:
			radial-gradient(420px 260px at 100% 0%, rgba(249, 231, 150, .1), transparent 70%),
			var(--hh-drawer);
		border-left: 1px solid rgba(249, 231, 150, .14);
		box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .7);
		transform: translateX(105%);
		visibility: hidden;
		transition: transform .45s var(--hh-ease), visibility 0s linear .45s;
	}
	.hh--open .hh__panel { transform: none; visibility: visible; transition-delay: 0s; }

	.hh__menu { flex-direction: column; align-items: stretch; gap: 0; }
	.hh__menu > li + li { border-top: 1px solid rgba(255, 255, 255, .08); }
	.hh__menu a { padding: 16px 4px; font-size: 18px; letter-spacing: .1em; white-space: normal; }
	.hh__menu > li > a::after { left: 4px; right: auto; width: 34px; bottom: 8px; transform-origin: left; }
	.hh__menu .menu-item-has-children > a::before { display: none; }
	.hh__menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 10px 14px !important;
		border: 0;
		border-left: 1px solid rgba(249, 231, 150, .2);
		border-radius: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
	.hh__menu .sub-menu a { padding: 10px 4px; font-size: 15px; }

	.hh__actions { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 0; }
	.hh__btn { width: 100%; min-height: 54px; }

	/* staggered reveal of drawer items */
	.hh__menu > li,
	.hh__actions > * { opacity: 0; transform: translateX(16px); transition: opacity .35s ease, transform .45s var(--hh-ease); }
	.hh--open .hh__menu > li,
	.hh--open .hh__actions > * { opacity: 1; transform: none; }
	.hh--open .hh__menu > li:nth-child(1) { transition-delay: .08s; }
	.hh--open .hh__menu > li:nth-child(2) { transition-delay: .12s; }
	.hh--open .hh__menu > li:nth-child(3) { transition-delay: .16s; }
	.hh--open .hh__menu > li:nth-child(4) { transition-delay: .2s; }
	.hh--open .hh__menu > li:nth-child(5) { transition-delay: .24s; }
	.hh--open .hh__menu > li:nth-child(n+6) { transition-delay: .28s; }
	.hh--open .hh__actions > * { transition-delay: .3s; }

	.hh__scrim {
		position: fixed;
		inset: var(--hh-panel-top, 0px) 0 0 0; /* dims the page, not the header bar */
		z-index: 1;
		background: rgba(2, 6, 14, .6);
		-webkit-backdrop-filter: blur(3px);
		backdrop-filter: blur(3px);
		animation: hh-fade .3s ease;
	}
}
@keyframes hh-fade { from { opacity: 0; } }

@media screen and (max-width: 380px) {
	.hh__call { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hh *,
	.hh::before,
	.hh *::before,
	.hh *::after { transition: none !important; animation: none !important; }
}
