/* Hamburger Menu block: layout only. Sizes, colours and timings come from the Inspector
 * (--ne-hb-bw / -bh / -gap on the buttons, --ne-hb-dur on the panel). */

.ne-hb {
	display: flex;
	align-items: center;
}

.ne-hb-btn {
	display: inline-flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--ne-hb-gap);
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s;
}

/* Text logo beside the button (Maggy's "M" square). */
.ne-hb-logo {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.3s, color 0.3s;
}

.ne-hb-bar {
	display: block;
	flex: 0 0 auto;
	width: var(--ne-hb-bw);
	height: var(--ne-hb-bh);
	pointer-events: none;
}

/* Open: the three bars fold into an X (Maggy's menu button). */
.ne-hb-btn.is-active .ne-hb-bar:nth-child(1) {
	transform: translateY(calc(var(--ne-hb-gap) + var(--ne-hb-bh))) rotate(-45deg);
}

.ne-hb-btn.is-active .ne-hb-bar:nth-child(2) {
	opacity: 0;
	transform: translateX(-100%);
}

.ne-hb-btn.is-active .ne-hb-bar:nth-child(3) {
	transform: translateY(calc(-1 * (var(--ne-hb-gap) + var(--ne-hb-bh)))) rotate(-135deg);
}

/* Panel: fixed over the page; hidden until .is-open (visibility waits for the slide-out). */
.ne-hb-layer {
	position: fixed;
	inset: 0;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear var(--ne-hb-dur);
}

/* Logged in: start below the WordPress toolbar (core sets the variable while it shows). */
.admin-bar .ne-hb-layer {
	top: var(--wp-admin--admin-bar--height, 0px);
}

.ne-hb-layer.is-open {
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}

.ne-hb-backdrop {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	transition: opacity var(--ne-hb-dur);
}

.ne-hb-layer.is-open .ne-hb-backdrop {
	opacity: 1;
}

.ne-hb-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	max-width: 100%;
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	outline: 0;
	transform: translateX(100%);
	transition: transform var(--ne-hb-dur) cubic-bezier(0.3, 0.885, 0.32, 1);
}

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

.ne-hb-layer.is-open .ne-hb-panel {
	transform: none;
}

.ne-hb-close {
	position: absolute;
	right: var(--ne-hb-cx);
	z-index: 2;
}

.ne-hb-body {
	box-sizing: border-box;
	min-height: 100%;
}

/* Page scroll locked while a panel is open; the gutter keeps the page from shifting sideways. */
html.ne-hb-lock {
	overflow: hidden;
	scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
	.ne-hb-panel,
	.ne-hb-backdrop,
	.ne-hb-bar {
		transition-duration: 0s !important;
	}
}
