/* ── Badges and chips ────────────────────────────────────────────────── */
/* align-middle: a badge printed beside text sits on the text's middle, not on its baseline (the owner's Statistics
   row: the "scheduled" pill hung below the date). */
.rooster-admin-badge,
.rooster-admin-chip {
	@apply ra-badge;
}

.rooster-admin-badge.is-sm,
.rooster-admin-chip.is-sm {
	@apply ra-badge-sm;
}

.rooster-admin-badge.is-lg,
.rooster-admin-chip.is-lg {
	@apply ra-badge-lg;
}

.rooster-admin-badge.is-solid {
	@apply ra-badge-solid;
}

.rooster-admin-badge__dot {
	@apply size-1.5 rounded-full;
	background: var(--ra-tone, var(--ra-muted-foreground));
}

.rooster-admin-chip {
	@apply ra-chip; /* the same room each side of the text (the owner: symmetry is key) */
}

.rooster-admin-chip:has(.rooster-admin-chip__remove) {
	@apply pe-1.5; /* the remove button sits in the end padding */
}

/* A row of chips in a cell, the action (add another) at the row's end so the actions of every row align. With an
   action the chips are a list of their own (0.68.3, the owner: two placements put the LMS's Add to course on the
   second line): they wrap inside it, and the action stays beside them, centred on the row as the other cells. */
.rooster-admin-chips {
	@apply flex flex-wrap items-center gap-1.5;
}

.rooster-admin-chips__list {
	@apply flex min-w-0 flex-1 flex-wrap items-center gap-1.5;
}

.rooster-admin-chips__action {
	@apply ms-auto ps-2;
}

/* A chip whose text is a link (open or edit what it names). */
.rooster-admin-chip__link {
	@apply min-w-0 truncate text-inherit no-underline;

	@variant hover {
		@apply underline;
	}

	@variant focus {
		@apply text-inherit;
	}
}

/* A clipped chip: as much of the name as fits, the full name as its tip (the owner: hint for more, the text on hover). */
.rooster-admin-badge.is-clipped,
.rooster-admin-chip.is-clipped {
	@apply max-w-[min(16rem,100%)] cursor-help;
}

/* An icon link in a chip (open its page on the site), beside the remove button (0.44.2). */
.rooster-admin-chip__action {
	@apply ra-chip-remove flex-none no-underline;

	@variant hover {
		@apply bg-muted text-foreground;
	}

	@variant focus-visible {
		@apply ra-ring;
	}
}

/* Links inside a chip's text (a course › its section): one line, the separator muted. */
.rooster-admin-chip__sep {
	@apply px-0.5 text-muted-foreground;
}

/* A list of chips (a ul): no bullets, no margins. */
ul.rooster-admin-chips {
	@apply m-0 list-none p-0;
}

ul.rooster-admin-chips > li {
	@apply m-0 flex min-w-0 max-w-full;
}

/* A chip's states a page sets: one a script can drag, one whose target is inactive, one a drop may land on. */
.rooster-admin-chip.is-movable {
	@apply cursor-grab;
}

.rooster-admin-chip.is-muted {
	@apply opacity-60;
}

.rooster-admin-chip.is-drop-target {
	@apply ra-ring;
}

.rooster-admin-badge.is-clipped .rooster-admin-badge__text,
.rooster-admin-chip.is-clipped .rooster-admin-badge__text {
	@apply min-w-0 truncate;
}

.rooster-admin-chip.is-clipped:focus-visible {
	@apply ra-ring;
}

.rooster-admin-chip__remove {
	@apply ra-chip-remove;

	@variant hover {
		@apply bg-muted text-foreground;
	}
}

/* The tones (the utilities of utilities.css, so an alias can take one). */
.is-primary {
	@apply ra-tone-primary;
}

.is-success {
	@apply ra-tone-success;
}

.is-warning {
	@apply ra-tone-warning;
}

.is-destructive {
	@apply ra-tone-destructive;
}

.is-info {
	@apply ra-tone-info;
}

.is-mono {
	@apply ra-tone-mono;
}
