/* bi/site-menu: the hub's menu on phones and small tablets. Loaded by the block. */

.bi-menu-toggle,
.bi-menu {
	--bi-menu-gap: 1rem;
}

/* The wrapper takes no space of its own in the header row. */
.bi-site-menu {
	display: contents;
}

/* The button only appears where the menu replaces the header links, and only once the page has said it can open a dialog. */
.bi-menu-toggle {
	display: none;
	align-items: center;
	gap: 0.375rem;
	min-height: 44px;
	padding: 0.5rem 0.875rem 0.5rem 0.75rem;
	border: 1px solid var(--wp--preset--color--line, #d5dcd6);
	border-radius: 999px;
	background: var(--wp--preset--color--surface, #fff);
	color: var(--wp--preset--color--contrast, #1c2a2e);
	font: 600 0.9375rem/1 var(--wp--preset--font-family--body, sans-serif);
	cursor: pointer;
}

.bi-menu-toggle:hover,
.bi-menu-toggle:focus-visible {
	border-color: var(--wp--preset--color--primary, #1d5e86);
	color: var(--wp--preset--color--primary, #1d5e86);
}

.bi-menu-toggle:focus-visible,
.bi-menu button:focus-visible,
.bi-menu a:focus-visible,
.bi-menu input:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #9a4127);
	outline-offset: 2px;
}

@media (max-width: 781px) {
	.bi-has-menu .bi-menu-toggle {
		display: inline-flex;
	}

	.bi-has-menu .bi-header .bi-primary-nav {
		display: none;
	}
}

.bi-menu__svg {
	flex: none;
	width: 22px;
	height: 22px;
}

/* The same peninsula mark as the header's site title. */
.bi-menu__home::before {
	content: "";
	flex: none;
	width: 30px;
	height: 30px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 34'%3E%3Ccircle cx='17' cy='17' r='16' fill='%23cfe4ec'/%3E%3Cpath d='M6.1 26.0 8.0 25.3 11.3 26.4 13.5 26.1 15.6 26.5 17.8 22.5 15.8 21.7 14.8 21.9 14.6 21.5 16.1 21.3 18.2 21.8 19.0 19.9 20.8 18.6 23.6 18.9 22.4 17.4 22.9 15.4 29.0 8.1 26.6 7.5 26.3 8.1 23.9 9.5 19.7 10.3 19.4 8.3 16.7 8.5 14.8 9.4 10.5 13.0 8.2 16.0 5.0 18.9Z' fill='%23f7f3e3' stroke='%23245c76' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* The menu itself: a full-screen sheet. */
.bi-menu {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--base, #f5f7f4);
	color: var(--wp--preset--color--contrast, #1c2a2e);
	font-family: var(--wp--preset--font-family--body, sans-serif);
	overflow: hidden;
}

.bi-menu[open] {
	display: flex;
	flex-direction: column;
	animation: bi-menu-in 0.22s ease-out;
}

.bi-menu::backdrop {
	background: rgba(28, 42, 46, 0.4);
}

html:has(.bi-menu[open]) {
	overflow: hidden;
}

@keyframes bi-menu-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bi-menu[open] {
		animation: none;
	}
}

.bi-menu__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--bi-menu-gap);
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--surface, #fff);
	border-bottom: 1px solid var(--wp--preset--color--line, #d5dcd6);
}

.bi-menu__home {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	font: 700 1.25rem/1.1 var(--wp--preset--font-family--heading, sans-serif);
	text-decoration: none;
}

.bi-menu__close {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 44px;
	padding: 0.5rem 0.875rem 0.5rem 0.75rem;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--base, #f5f7f4);
	color: inherit;
	font: 600 0.9375rem/1 var(--wp--preset--font-family--body, sans-serif);
	cursor: pointer;
}

.bi-menu__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 1.25rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
	-webkit-overflow-scrolling: touch;
}

.bi-menu__body > * {
	max-width: 40rem;
	margin-inline: auto;
}

.bi-menu__title {
	margin: 0 auto 0.875rem;
	font: 700 clamp(1.75rem, 7vw, 2.25rem)/1.05 var(--wp--preset--font-family--heading, sans-serif);
}

/* Search */
.bi-menu__search {
	display: flex;
	margin-bottom: 1.25rem;
	border: 1px solid var(--wp--preset--color--line, #d5dcd6);
	border-radius: 999px;
	background: var(--wp--preset--color--surface, #fff);
	overflow: hidden;
}

.bi-menu__search:focus-within {
	border-color: var(--wp--preset--color--primary, #1d5e86);
}

.bi-menu__search input {
	flex: 1;
	min-width: 0;
	min-height: 48px;
	padding: 0 0 0 1.125rem;
	border: 0;
	background: transparent;
	color: inherit;
	font: 400 1rem/1.2 var(--wp--preset--font-family--body, sans-serif);
}

.bi-menu__search input:focus {
	outline: none;
}

.bi-menu__search button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	margin: 4px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #1d5e86);
	color: #fff;
	cursor: pointer;
}

/* Sections */
.bi-menu__section {
	margin-bottom: 1.5rem;
}

.bi-menu__heading {
	margin: 0 auto 0.625rem;
	color: var(--wp--preset--color--muted, #55656a);
	font: 700 0.8125rem/1.2 var(--wp--preset--font-family--body, sans-serif);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bi-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The six main sections */
.bi-menu__tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.625rem;
}

.bi-menu__tile {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 0.625rem;
	align-items: center;
	align-content: center;
	height: 100%;
	box-sizing: border-box;
	padding: 0.875rem 0.75rem;
	border: 1px solid var(--wp--preset--color--line, #d5dcd6);
	border-radius: 10px;
	background: var(--wp--preset--color--surface, #fff);
	color: inherit;
	text-decoration: none;
}

.bi-menu__tile:hover {
	border-color: var(--wp--preset--color--primary, #1d5e86);
}

.bi-menu__tile.is-current {
	border-color: var(--wp--preset--color--primary, #1d5e86);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--primary, #1d5e86);
}

.bi-menu__icon {
	grid-row: 1 / span 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wp--preset--color--water, #cfe4ec);
	color: var(--wp--preset--color--primary, #1d5e86);
}

.bi-menu__tile.is-current .bi-menu__icon {
	background: var(--wp--preset--color--primary, #1d5e86);
	color: #fff;
}

.bi-menu__tile-name {
	font: 700 1.0625rem/1.15 var(--wp--preset--font-family--heading, sans-serif);
}

.bi-menu__tile-note {
	display: -webkit-box;
	overflow: hidden;
	color: var(--wp--preset--color--muted, #55656a);
	font-size: 0.8125rem;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* Villages */
.bi-menu__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.bi-menu__chips a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 0.875rem;
	border: 1px solid var(--wp--preset--color--line, #d5dcd6);
	border-radius: 999px;
	background: var(--wp--preset--color--surface, #fff);
	color: inherit;
	font-size: 0.9375rem;
	text-decoration: none;
}

.bi-menu__chips a:hover {
	border-color: var(--wp--preset--color--primary, #1d5e86);
	color: var(--wp--preset--color--primary, #1d5e86);
}

/* Handy to know */
.bi-menu__list {
	border: 1px solid var(--wp--preset--color--line, #d5dcd6);
	border-radius: 10px;
	background: var(--wp--preset--color--surface, #fff);
	overflow: hidden;
}

.bi-menu__list li + li {
	border-top: 1px solid var(--wp--preset--color--line, #d5dcd6);
}

.bi-menu__list a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 48px;
	padding: 0 0.75rem 0 1rem;
	color: inherit;
	text-decoration: none;
}

.bi-menu__list a > span:first-child {
	flex: 1;
}

.bi-menu__list a:hover {
	color: var(--wp--preset--color--primary, #1d5e86);
}

.bi-menu__count {
	min-width: 1.75rem;
	padding: 0.125rem 0.5rem;
	border-radius: 999px;
	background: var(--wp--preset--color--base, #f5f7f4);
	color: var(--wp--preset--color--muted, #55656a);
	font-size: 0.8125rem;
	text-align: center;
}

.bi-menu__list .bi-menu__svg {
	width: 18px;
	height: 18px;
	color: var(--wp--preset--color--muted, #55656a);
}

/* For local businesses */
.bi-menu__promo {
	padding: 1.125rem 1rem;
	border-radius: 10px;
	background: var(--wp--preset--color--land, #f7f3e3);
	border: 1px solid #e6dcc0;
}

.bi-menu__promo p {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.bi-menu__promo .bi-menu__promo-title {
	margin-bottom: 0.25rem;
	font: 700 1.25rem/1.15 var(--wp--preset--font-family--heading, sans-serif);
}

.bi-menu__promo-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	min-height: 44px;
	padding: 0 0.75rem 0 1.125rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent, #9a4127);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.bi-menu__promo-link:hover {
	background: var(--wp--preset--color--contrast, #1c2a2e);
}

.bi-menu__promo-link .bi-menu__svg {
	width: 18px;
	height: 18px;
}

/* Very narrow phones: one tile per row reads better than squeezed pairs. */
@media (max-width: 340px) {
	.bi-menu__tiles {
		grid-template-columns: 1fr;
	}
}

/* Visually hidden label (also in directory.css, which not every page loads). */
.bi-menu .bi-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
