.container {
	display: none;
	align-items: center;

	@media screen and (min-width: 600px) {
		display: flex;
	}
}

.menuWrapper {
	position: relative;
}

.menuButton {
	display: flex;
	align-items: center;
	padding: 0 var(--s-2);
	height: var(--field-size-sm);
	border: none;
	border-radius: var(--radius-field);
	background: transparent;
	color: var(--color-text);
	font-size: var(--font-xs);
	font-weight: var(--weight-semi);
	cursor: pointer;
	white-space: nowrap;

	&:focus-visible {
		outline: var(--focus-ring);
		outline-offset: 1px;
	}
}

.menuPopover {
	background-color: var(--color-bg-high);
}

.menuContent {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s-0-5);
}

.menuItem {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-1-5) var(--s-2);
	border-radius: var(--radius-field);
	color: var(--color-text);
	font-size: var(--font-xs);
	font-weight: var(--weight-semi);
	text-decoration: none;
	transition:
		background-color 0.15s,
		color 0.15s;

	&:hover,
	&:focus-visible {
		background-color: var(--color-bg-higher);
	}
}

.menuItemForm {
	display: contents;
}

.menuItemButton {
	width: 100%;
	border: none;
	background: transparent;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

.menuItemIcon {
	flex-shrink: 0;
}

.preview {
	position: absolute;
	top: calc(100% + var(--s-1));
	left: 0;
	z-index: 1;
	display: none;
	width: max-content;
	grid-auto-flow: column;
	grid-template-rows: repeat(2, auto);
	gap: var(--s-1);
	padding: var(--s-1) var(--s-1-5);
	border: var(--border-style);
	border-radius: var(--radius-field);
	background-color: var(--color-bg-high);

	.menuWrapper:hover & {
		display: grid;
	}

	&::before {
		content: "";
		position: absolute;
		top: calc(-1 * (var(--s-1) + var(--border-width)));
		left: 0;
		right: 0;
		height: calc(var(--s-1) + var(--border-width));
	}
}

.previewIcon {
	display: flex;
	flex-shrink: 0;
	padding: var(--s-1);
	border-radius: var(--radius-full);
	transition: background-color 0.15s;

	&:hover {
		background-color: var(--color-bg-higher);
	}
}

.previewIconButton {
	border: none;
	background: transparent;
	cursor: pointer;
}
