/* ── A row's menu (0.79.0, Ui::row_menu(), CONTRACT §8.5): the list a small icon-only "⋮" button opens, in a table's
   actions column or on its own (a card's head, beside a record's facts). The list is a popover (the browser's top
   layer: no card or scrolled table frame clips it). Where assets/row-menu.js places it (is-placed) it sits under its
   button, its end edge on the button's, kept inside the window (--ra-top, --ra-left, --ra-max-h); without the script
   it stays where the browser centres a popover. Each item a row: its icon, its label, a line under it (a description,
   or a disabled item's reason); the destructive ones last, in the destructive ink, after a line. Compiled on its own
   (assets/row-menu.css, src/row-menu.css) and loaded with the script by the first menu a screen prints: the common path pays
   nothing (the owner's rule). The wrapper's one rule is kit/table-more.css's (the first paint). ── */
.rooster-admin-rowmenu__list {
	@apply m-auto box-border max-h-(--ra-max-h,min(70vh,480px)) w-max min-w-48 max-w-[min(22rem,calc(100vw-16px))] overflow-y-auto rounded-md border border-border bg-card p-1 text-start text-sm whitespace-normal text-card-foreground shadow-pop;
	transition:
		opacity var(--ra-dur-fast) var(--ra-ease),
		overlay var(--ra-dur-fast) allow-discrete,
		display var(--ra-dur-fast) allow-discrete;

	@variant open {
		@apply opacity-100;

		@starting-style {
			@apply opacity-0;
		}
	}
}

.rooster-admin-rowmenu__list.is-placed {
	@apply m-0;
	inset: auto;
	top: var(--ra-top, 0);
	left: var(--ra-left, 0);
}

.rooster-admin-rowmenu__item {
	@apply box-border flex w-full cursor-pointer items-start gap-2 rounded-sm border-0 bg-transparent px-2.5 py-1.5 text-start font-[inherit] text-sm leading-snug text-foreground no-underline shadow-none hover:bg-muted;

	@variant focus-visible {
		@apply bg-muted outline-2 -outline-offset-2 outline-accent;
	}
}

/* The dark scheme's link colour leaves a link item alone (its ink is the item's, not a link's). */
a.rooster-admin-rowmenu__item:is(:link, :visited, :hover, :focus, :active) {
	@apply text-foreground no-underline;
}

.rooster-admin-rowmenu__item.is-destructive,
a.rooster-admin-rowmenu__item.is-destructive:is(:link, :visited, :hover, :focus, :active) {
	@apply text-destructive-foreground;
}

.rooster-admin-rowmenu__item.is-disabled {
	@apply cursor-default text-secondary-foreground hover:bg-transparent;
}

.rooster-admin-rowmenu__icon {
	@apply mt-0.5 shrink-0 text-secondary-foreground;
}

.rooster-admin-rowmenu__item.is-destructive .rooster-admin-rowmenu__icon {
	@apply text-inherit;
}

.rooster-admin-rowmenu__text {
	@apply flex min-w-0 flex-col gap-0.5;
}

.rooster-admin-rowmenu__note {
	@apply text-xs text-secondary-foreground;
}

.rooster-admin-rowmenu__head {
	@apply mx-2.5 mt-1.5 mb-1 block text-2xs font-semibold tracking-[0.04em] text-secondary-foreground uppercase;
}

.rooster-admin-rowmenu__sep {
	@apply mx-1 my-1 h-px bg-border;
}

@media (forced-colors: active) {
	.rooster-admin-rowmenu__item:focus-visible {
		outline-color: Highlight;
	}

	.rooster-admin-rowmenu__item.is-disabled {
		color: GrayText;
	}
}
