/* Only take over the parent menu after the controls have initialized. */
nav:has(.maboi-enhanced) > :is(button, #mainnav-toggle, .menu-toggle) {
	display: none !important;
}

.maboi-enhanced {
	background: #243746;
	color: #fff;
	font-family: system-ui, sans-serif;
}

.maboi-enhanced [hidden] {
	display: none !important;
}

.maboi-enhanced ul.maboi-refresh-menu,
.maboi-enhanced .maboi-refresh-menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.maboi-enhanced ul.maboi-refresh-menu {
	display: flex !important;
	flex-wrap: wrap;
	align-items: stretch;
	width: auto;
}

.maboi-enhanced ul.maboi-refresh-menu[hidden] {
	display: none !important;
}

.maboi-enhanced .maboi-refresh-menu li {
	position: relative;
	float: none;
	width: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	background: transparent;
}

.maboi-enhanced .maboi-refresh-menu a,
.maboi-enhanced button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: .4rem .7rem;
	color: inherit;
	background: transparent;
	border: 0;
	font: inherit;
	text-align: start;
	text-transform: none;
	text-decoration: none;
}

.maboi-enhanced button {
	cursor: pointer;
	min-width: 44px;
}

.maboi-enhanced .maboi-refresh-menu a:hover,
.maboi-enhanced button:hover,
.maboi-enhanced button[aria-expanded="true"],
.maboi-enhanced [aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: .25em;
}

.maboi-enhanced :is(a, button):focus-visible {
	outline: 3px solid currentColor;
	outline-offset: -4px;
}

.maboi-enhanced .maboi-refresh-menu li > ul:not([hidden]) {
	display: block !important;
	visibility: visible;
	opacity: 1;
	position: absolute;
	inset: 100% auto auto 0;
	float: none;
	width: max-content;
	min-width: min(14rem, 90vw);
	max-width: min(19rem, 90vw);
	background: #fff;
	color: #243746;
	border: 1px solid #bccbd4;
	box-shadow: 0 4px 12px #24374633;
	z-index: 100;
}

.maboi-enhanced .maboi-refresh-menu ul li > ul:not([hidden]) {
	position: static;
	box-shadow: none;
	width: 100%;
}

.maboi-enhanced .maboi-refresh-menu ul a {
	flex: 1;
	white-space: normal;
}

.maboi-enhanced .maboi-refresh-menu > li:nth-last-child(-n+3) > ul:not([hidden]) {
	inset-inline: auto 0;
}

@media (max-width: 56rem) {
	.maboi-enhanced ul.maboi-refresh-menu {
		flex-direction: column;
	}
	.maboi-enhanced .maboi-refresh-menu a,
	.maboi-enhanced .maboi-dropdown-label {
		flex: 1;
	}
	.maboi-enhanced .maboi-refresh-menu li > ul:not([hidden]) {
		position: static;
		width: 100%;
		min-width: 0;
		max-width: none;
		box-shadow: none;
	}
}

.site-title a::before,
#site-title a::before {
	content: "";
	display: inline-block;
	vertical-align: middle;
	inline-size: clamp(2rem, 5vw, 3.25rem);
	block-size: clamp(2rem, 5vw, 3.25rem);
	margin-inline-end: .45em;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}

.maboi-enhanced .maboi-dropdown-label {
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: .25em;
}

.maboi-enhanced .maboi-dropdown-text {
	font-size: .78em;
	text-decoration: underline;
	text-underline-offset: .2em;
}

.maboi-book-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: clamp(.75rem, 3vw, 2rem);
	padding: clamp(.85rem, 2.5vw, 1.5rem);
	background: #e9f0f5;
	color: #243746;
}

.maboi-book-title {
	font: 700 clamp(1.3rem, 3vw, 2.2rem)/1.2 system-ui, sans-serif;
	text-align: center;
}

.maboi-book-banner img.maboi-book-covers {
	display: block;
	width: min(100%, 29rem);
	height: auto;
	max-height: 12rem;
	object-fit: contain;
	margin: 0;
}
