/* Ported from the Next.js app's page.module.css. */
.queue__page {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
}

.queue__empty {
	color: var(--text-tertiary);
}

/*
 * One sheet, four rows — assembled from the rows themselves.
 *
 * The list holds no background, no border and no radius of its own. It used to, and that
 * is what made a raised row look duplicated: a white rounded box sitting behind the rows
 * shows its own corner and its own border from under whichever row has lifted off it, two
 * pixels down and to the side. No amount of shadow tuning fixes a second object.
 *
 * So the outline belongs to the rows. Each carries the sheet's left and right edge, the
 * first and last carry its top and bottom, and a raised row takes its share of the frame
 * with it. What shows underneath is the page, which is what a lift is supposed to reveal.
 */
.queue__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.queue__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--space-1) var(--space-5);
	padding: var(--space-4) var(--space-5);
	color: inherit;
	text-decoration: none;
	background: var(--app-sheet);
	border-inline: var(--border-1) solid var(--app-rule);
	transition:
		transform 140ms cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.queue__item:first-child .queue__row {
	border-top: var(--border-1) solid var(--app-rule);
	border-radius: var(--app-sheet-radius) var(--app-sheet-radius) 0 0;
}

.queue__item:last-child .queue__row {
	border-bottom: var(--border-1) solid var(--app-rule);
	border-radius: 0 0 var(--app-sheet-radius) var(--app-sheet-radius);
}

/* The rule between two rows is the lower one's own top edge, so it travels with the lift
   instead of staying behind as a stray line. */
.queue__item + .queue__item .queue__row {
	border-top: var(--border-1) solid var(--app-hairline);
}

.queue__item:hover + .queue__item .queue__row {
	border-top-color: transparent;
}

/* Lifted off the page rather than tinted: the row is a destination, and the movement is
   the cheapest way to say so without adding a hover colour to a page that has four. */
.queue__item:hover .queue__row {
	position: relative;
	z-index: var(--z-focus);
	transform: translateY(-2px);
	box-shadow: var(--app-lift);
}

.queue__row:focus-visible {
	position: relative;
	z-index: var(--z-focus);
	outline: var(--border-2) solid var(--border-focus);
	outline-offset: calc(var(--border-2) * -1);
}

@media (prefers-reduced-motion: reduce) {
	.queue__row {
		transition: none;
	}

	.queue__item:hover .queue__row {
		transform: none;
	}
}

.queue__name {
	grid-column: 1;
	font-size: var(--font-size-lg);
	line-height: var(--font-line-height-lg);
	font-weight: var(--font-weight-semibold);
	letter-spacing: -0.012em;
	color: var(--text-primary);
}

.queue__item[data-done] .queue__name {
	color: var(--text-secondary);
	font-weight: var(--font-weight-medium);
}

.queue__status {
	grid-column: 1;
	font-size: var(--font-size-xs);
	color: var(--text-tertiary);
}

.queue__status[data-owed] {
	color: var(--note-owed-fg);
	font-weight: var(--font-weight-semibold);
}

.queue__meter {
	grid-column: 1;
	margin-top: var(--space-1);
}

.queue__side {
	grid-column: 2;
	grid-row: 1 / span 3;
	display: flex;
	align-items: center;
	gap: var(--space-5);
}

/* Reads as the action without being a control nested inside the row's own link. */
.queue__go {
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-semibold);
	color: var(--text-link);
	white-space: nowrap;
}

.queue__item:hover .queue__go {
	color: var(--turquoise-800);
}

/* The count is the instrument reading: same figures, same alignment, every row. */
.queue__count {
	font-size: var(--font-size-xs);
	font-variant-numeric: tabular-nums;
	color: var(--text-tertiary);
	white-space: nowrap;
}

.queue__count b {
	font-size: var(--font-size-lg);
	font-weight: var(--font-weight-semibold);
	color: var(--text-primary);
}

.queue__item[data-done] .queue__count b {
	color: var(--green-700);
}

@media (max-width: 34rem) {
	.queue__row {
		grid-template-columns: minmax(0, 1fr);
	}

	.queue__side {
		grid-column: 1;
		grid-row: auto;
		justify-content: space-between;
		margin-top: var(--space-3);
	}
}
