/*
 * Hamburger Header Menu - front-end styles.
 * Sizes and colors come from the custom properties that the plugin prints
 * from Settings > Hamburger Menu. There are no breakpoints that hide the
 * button: desktop, tablet and phone all use the same hamburger menu.
 */

.hhm-sr,
.hhm-search .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Wrapper ---------- */

.hhm {
	line-height: 1;
}

.hhm--inline {
	display: inline-flex;
	vertical-align: middle;
}

.hhm--floating {
	position: fixed;
	top: var(--hhm-top, 20px);
	right: var(--hhm-offset, 20px);
	z-index: calc(var(--hhm-z, 100000) - 1);
}

.hhm--floating.hhm--btn-left {
	right: auto;
	left: var(--hhm-offset, 20px);
}

/* Option "stays at the top of the page": the button scrolls away with the page. */
.hhm--floating.hhm--pos-absolute {
	position: absolute;
}

.admin-bar .hhm--floating {
	top: calc(var(--hhm-top, 20px) + 32px);
}

@media screen and (max-width: 782px) {
	.admin-bar .hhm--floating {
		top: calc(var(--hhm-top, 20px) + 46px);
	}
}

/* ---------- Button reset (beats most theme button styles) ---------- */

.hhm .hhm-toggle,
.hhm-panel .hhm-close,
.hhm-panel .hhm-sub-toggle {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	line-height: 1;
	text-shadow: none;
	text-transform: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* ---------- Hamburger button ---------- */

.hhm .hhm-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: var(--hhm-size, 48px);
	height: var(--hhm-size, 48px);
	padding: 0 calc(var(--hhm-size, 48px) * 0.25);
	border-radius: 8px;
	background: var(--hhm-btn-bg, #fff);
	color: var(--hhm-icon, #1e1e1e);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hhm--floating.hhm--has-bg .hhm-toggle {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.hhm--floating.hhm--has-bg .hhm-toggle:hover {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.24);
}

.hhm .hhm-toggle:active {
	transform: scale(0.96);
}

.hhm .hhm-toggle:focus-visible,
.hhm-panel button:focus-visible,
.hhm-panel a:focus-visible {
	outline: 2px solid var(--hhm-accent, #2271b1);
	outline-offset: 2px;
}

.hhm-toggle__box {
	position: relative;
	display: block;
	flex: none;
	width: calc(var(--hhm-size, 48px) * 0.5);
	height: calc(var(--hhm-size, 48px) * 0.375);
}

.hhm-toggle__bar {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: top 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}

.hhm-toggle__bar:nth-child(1) { top: 0; }
.hhm-toggle__bar:nth-child(2) { top: calc(50% - 1px); }
.hhm-toggle__bar:nth-child(3) { top: calc(100% - 2px); }

.hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(1) {
	top: calc(50% - 1px);
	transform: rotate(45deg);
}

.hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(2) {
	opacity: 0;
}

.hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(3) {
	top: calc(50% - 1px);
	transform: rotate(-45deg);
}

.hhm-toggle__label {
	font-size: 15px;
	font-weight: 600;
}

/* ---------- Backdrop ---------- */

.hhm-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--hhm-z, 100000);
	background: rgba(0, 0, 0, var(--hhm-overlay, 0.5));
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.hhm-overlay.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, visibility 0s;
}

/* ---------- Panel ---------- */

.hhm-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: calc(var(--hhm-z, 100000) + 1);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: var(--hhm-panel-width, 360px);
	max-width: 100%;
	overflow: hidden;
	background: var(--hhm-panel-bg, #fff);
	color: var(--hhm-text, #1e1e1e);
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
	text-align: start;
	visibility: hidden;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
}

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

.hhm-panel--left {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

.hhm-panel.is-open {
	visibility: visible;
	transform: none;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* No clicks on a closed panel, also during the closing animation. */
.hhm-panel:not(.is-open),
.hhm-panel:not(.is-open) * {
	pointer-events: none !important;
}

.hhm-panel--fullscreen {
	left: 0;
	width: 100%;
	max-width: none;
	box-shadow: none;
	opacity: 0;
	transform: none;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.hhm-panel--fullscreen.is-open {
	opacity: 1;
	transition: opacity 0.25s ease, visibility 0s;
}

/* Small phones: the drawer takes the full width. */
@media (max-width: 480px) {
	.hhm-panel--slide {
		width: 100%;
	}
}

.hhm-panel__header {
	display: flex;
	flex: none;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 8px 12px 8px 20px;
	border-bottom: 1px solid rgba(127, 127, 127, 0.2);
}

.hhm-panel__title {
	color: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.hhm-panel__title:hover {
	color: var(--hhm-accent, #2271b1);
}

.hhm-panel__logo img {
	display: block;
	width: auto;
	max-height: 48px;
}

.hhm-panel .hhm-close {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-left: auto;
	border-radius: 8px;
}

.hhm-panel .hhm-close:hover {
	background: rgba(127, 127, 127, 0.12);
}

.hhm-close svg {
	display: block;
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.hhm-panel__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 8px 0 32px;
}

.hhm-panel--fullscreen .hhm-panel__body {
	display: flex;
	flex-direction: column;
}

.hhm-panel--fullscreen .hhm-panel__inner {
	width: 100%;
	max-width: 640px;
	margin: auto;
}

/* ---------- Menu list (also resets theme dropdown styles) ---------- */

.hhm-panel .hhm-menu,
.hhm-panel .hhm-menu ul {
	position: static;
	display: block;
	float: none;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	list-style: none;
	opacity: 1;
	/* "inherit", not "visible": a closed panel is visibility: hidden, and a
	   descendant set to visible would stay clickable while the panel is closed.
	   This still overrides themes that hide .sub-menu with visibility: hidden. */
	visibility: inherit;
	transform: none;
}

.hhm-panel .hhm-menu li {
	position: relative;
	display: block;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-bottom: 1px solid rgba(127, 127, 127, 0.15);
	background: none;
}

.hhm-panel .hhm-menu ul li:last-child {
	border-bottom: 0;
}

.hhm-panel .hhm-menu a {
	display: block;
	padding: 14px 20px;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font-size: var(--hhm-font-size, 18px);
	font-weight: 500;
	line-height: 1.35;
	overflow-wrap: anywhere;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.hhm-panel .hhm-menu a:hover {
	background: rgba(127, 127, 127, 0.08);
	color: var(--hhm-accent, #2271b1);
}

.hhm-panel .hhm-menu .current-menu-item > a,
.hhm-panel .hhm-menu .current-menu-item > .hhm-row > a,
.hhm-panel .hhm-menu .current_page_item > a,
.hhm-panel .hhm-menu .current_page_item > .hhm-row > a {
	color: var(--hhm-accent, #2271b1);
	font-weight: 700;
}

.hhm-panel--fullscreen .hhm-menu > li > a,
.hhm-panel--fullscreen .hhm-menu > li > .hhm-row > a {
	font-size: calc(var(--hhm-font-size, 18px) * 1.35);
}

/* Submenus: closed until their toggle is pressed. */
.hhm-panel .hhm-menu li > ul {
	display: none;
	border-top: 1px solid rgba(127, 127, 127, 0.15);
	background: rgba(127, 127, 127, 0.05);
}

.hhm-panel .hhm-menu li.hhm-sub-open > ul {
	display: block;
}

.hhm-panel .hhm-menu ul a {
	padding-left: 36px;
	font-size: calc(var(--hhm-font-size, 18px) * 0.88);
}

.hhm-panel .hhm-menu ul ul a { padding-left: 52px; }
.hhm-panel .hhm-menu ul ul ul a { padding-left: 68px; }

.hhm-row {
	display: flex;
	align-items: stretch;
}

.hhm-row > a {
	flex: 1 1 auto;
	min-width: 0;
}

.hhm-panel .hhm-sub-toggle {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 56px;
	border-left: 1px solid rgba(127, 127, 127, 0.15);
}

.hhm-panel .hhm-sub-toggle:hover {
	background: rgba(127, 127, 127, 0.08);
	color: var(--hhm-accent, #2271b1);
}

.hhm-sub-toggle__icon {
	display: block;
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-25%) rotate(45deg);
	transition: transform 0.2s ease;
}

.hhm-sub-toggle[aria-expanded="true"] .hhm-sub-toggle__icon {
	transform: translateY(25%) rotate(-135deg);
}

/* ---------- Horizontal bar style ---------- */
/* The hamburger turns into an arrow and the menu opens in one row beside it. */

.hhm--style-bar.hhm--inline {
	position: relative;
	z-index: 5;
}

.hhm--style-bar .hhm-toggle__bar {
	transform-origin: 100% 50%;
	transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}

.hhm--style-bar.hhm--btn-left .hhm-toggle__bar {
	transform-origin: 0 50%;
}

/* Arrow ">" when open (bar opens to the left of the button). */
.hhm--style-bar .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(1),
.hhm--style-bar .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(3) {
	top: calc(50% - 1px);
	left: 12%;
	width: 70%;
}

.hhm--style-bar .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(1) { transform: rotate(40deg); }
.hhm--style-bar .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(3) { transform: rotate(-40deg); }

/* Arrow "<" when the button is on the left and the bar opens to the right. */
.hhm--style-bar.hhm--btn-left .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(1),
.hhm--style-bar.hhm--btn-left .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(3) {
	left: 18%;
}

.hhm--style-bar.hhm--btn-left .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(1) { transform: rotate(-40deg); }
.hhm--style-bar.hhm--btn-left .hhm-toggle[aria-expanded="true"] .hhm-toggle__bar:nth-child(3) { transform: rotate(40deg); }

.hhm-panel.hhm-panel--bar {
	position: absolute;
	top: 50%;
	right: calc(100% + 8px);
	bottom: auto;
	left: auto;
	z-index: 1;
	display: block;
	width: max-content;
	max-width: calc(100vw - 120px); /* JS sets the exact room on open. */
	height: var(--hhm-size, 48px);
	overflow: visible;
	border-radius: 8px;
	background: var(--hhm-btn-bg, transparent);
	color: var(--hhm-icon, #1e1e1e);
	box-shadow: none;
	opacity: 0;
	transform: translate(12px, -50%);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.hhm--btn-left .hhm-panel.hhm-panel--bar {
	right: auto;
	left: calc(100% + 8px);
	transform: translate(-12px, -50%);
}

.hhm-panel.hhm-panel--bar.is-open {
	opacity: 1;
	transform: translate(0, -50%);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.hhm--has-bg .hhm-panel--bar {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.hhm-panel--bar .hhm-panel__body,
.hhm-panel--bar .hhm-panel__inner,
.hhm-panel--bar .hhm-nav {
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: visible;
}

.hhm-panel--bar .hhm-notice {
	display: none;
}

.hhm-panel.hhm-panel--bar .hhm-menu {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	height: 100%;
	padding: 0 6px;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.hhm-panel--bar .hhm-menu::-webkit-scrollbar {
	display: none;
}

/* Fade the edge where more items are hidden (row wider than the screen). */
.hhm-panel--bar.hhm-more-right:not(.hhm-drop-open) .hhm-menu {
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}

.hhm-panel--bar.hhm-more-left:not(.hhm-drop-open) .hhm-menu {
	-webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
	mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
}

.hhm-panel--bar.hhm-more-left.hhm-more-right:not(.hhm-drop-open) .hhm-menu {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
	mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

.hhm-panel.hhm-panel--bar .hhm-menu > li {
	position: static;
	display: flex;
	flex: none;
	align-items: stretch;
	border: 0;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row {
	align-items: stretch;
	height: 100%;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > a,
.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > a {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 10px;
	background: none;
	color: inherit;
	font-size: var(--hhm-bar-font-size, 13px);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: var(--hhm-bar-transform, uppercase);
	white-space: nowrap;
	opacity: 0.8;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > a {
	padding-right: 2px;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > a:hover,
.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > a:hover,
.hhm-panel.hhm-panel--bar .hhm-menu > li > a:focus-visible,
.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > a:focus-visible,
.hhm-panel.hhm-panel--bar .hhm-menu > li.hhm-sub-open > .hhm-row > a,
.hhm-panel.hhm-panel--bar .hhm-menu > .current-menu-item > a,
.hhm-panel.hhm-panel--bar .hhm-menu > .current-menu-ancestor > .hhm-row > a,
.hhm-panel.hhm-panel--bar .hhm-menu > .current_page_item > a,
.hhm-panel.hhm-panel--bar .hhm-menu > .current_page_ancestor > .hhm-row > a {
	background: none;
	color: inherit;
	opacity: 1;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > .hhm-sub-toggle {
	width: 22px;
	border-left: 0;
	background: none;
	color: inherit;
	opacity: 0.8;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > .hhm-sub-toggle:hover {
	opacity: 1;
}

.hhm-panel.hhm-panel--bar .hhm-menu > li > .hhm-row > .hhm-sub-toggle .hhm-sub-toggle__icon {
	width: 6px;
	height: 6px;
}

/* Submenu dropdowns under the bar. Their left edge is set by JS. */
.hhm-panel.hhm-panel--bar .hhm-menu > li > ul {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 2;
	display: none;
	width: max-content;
	min-width: 200px;
	max-width: min(320px, calc(100vw - 32px));
	padding: 6px 0;
	border: 0;
	border-radius: 8px;
	background: var(--hhm-panel-bg, #fff);
	color: var(--hhm-text, #1e1e1e);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.hhm-panel.hhm-panel--bar .hhm-menu > li.hhm-sub-open > ul {
	display: block;
}

.hhm-panel.hhm-panel--bar .hhm-menu ul li {
	border-bottom: 0;
}

.hhm-panel.hhm-panel--bar .hhm-menu ul a {
	padding: 10px 16px;
	font-size: var(--hhm-bar-font-size, 13px);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: var(--hhm-bar-transform, uppercase);
}

.hhm-panel.hhm-panel--bar .hhm-menu ul ul a { padding-left: 28px; }
.hhm-panel.hhm-panel--bar .hhm-menu ul ul ul a { padding-left: 40px; }

.hhm-panel.hhm-panel--bar .hhm-menu ul .hhm-sub-toggle {
	width: 40px;
	border-left: 0;
}

/* ---------- Search ---------- */

.hhm-search {
	padding: 12px 20px 16px;
}

.hhm-search form {
	display: flex;
	gap: 8px;
	margin: 0;
}

.hhm-search label {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.hhm-search input[type="search"] {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid rgba(127, 127, 127, 0.4);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.hhm-search input[type="submit"],
.hhm-search button {
	flex: none;
	margin: 0;
	padding: 10px 16px;
	border: 0;
	border-radius: 6px;
	background: var(--hhm-accent, #2271b1);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

/* ---------- Admin-only note ---------- */

.hhm-notice {
	margin: 12px 20px;
	padding: 10px 12px;
	border-left: 3px solid var(--hhm-accent, #2271b1);
	background: rgba(127, 127, 127, 0.1);
	font-size: 13px;
	line-height: 1.5;
}

.hhm-notice a {
	color: var(--hhm-accent, #2271b1);
}

/* ---------- Page scroll lock while open ---------- */

html.hhm-locked,
html.hhm-locked body {
	overflow: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
	.hhm-toggle,
	.hhm-toggle__bar,
	.hhm-overlay,
	.hhm-panel,
	.hhm-sub-toggle__icon {
		transition: none !important;
	}
}

@media print {
	.hhm,
	.hhm-overlay,
	.hhm-panel {
		display: none !important;
	}
}
