/*
 * Ravenflair: a list of machines. The words on top, the filters, the one card, the pages.
 * Loaded only on a page that draws the list section. Reads only the tokens in base.css.
 */

.rf-list__head {
	padding-bottom: 20px;
}

.rf-list__title {
	margin: 0;
	font: 800 clamp(1.75rem, 5vw, 2.75rem)/1.08 var(--rf-font-head);
	letter-spacing: -0.02em;
}

.rf-list__lead {
	margin: 8px 0 0;
	color: var(--rf-ink-2);
	font-size: 1.0625rem;
}

/* The filters and the order. */
.rf-list__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px 32px;
	padding-block: 16px;
	border-block: 1px solid var(--rf-rule);
}

.rf-facet {
	min-width: 0;
	max-width: 100%;
}

.rf-facet__title,
.rf-pick__label {
	display: block;
	margin: 0 0 8px;
	color: var(--rf-steel);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rf-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--rf-rule);
	border-radius: 999px;
	background: var(--rf-paper);
	color: var(--rf-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.rf-chip:hover {
	border-color: var(--rf-ink);
}

.rf-chip.is-on {
	border-color: var(--rf-ink);
	background: var(--rf-ink);
	color: var(--rf-paper);
}

.rf-chip__n {
	color: var(--rf-steel);
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}

.rf-chip.is-on .rf-chip__n {
	color: rgb(255 255 255 / 0.76);
}

/* The used list's price, year and hours, and the order: one small form. */
.rf-picks {
	display: flex;
	flex: 1 1 100%;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
	min-width: 0;
}

.rf-pick {
	flex: 0 1 190px;
	min-width: 0;
}

.rf-pick--order {
	flex-basis: 230px;
	margin-inline-start: auto;
}

.rf-pick__select {
	width: 100%;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--rf-rule);
	border-radius: var(--rf-radius);
	background-color: var(--rf-paper);
	color: var(--rf-ink);
	font: 600 0.9375rem/1.2 var(--rf-font-body);
}

.rf-picks__go {
	min-height: 44px;
}

.rf-list__count {
	margin: 20px 0 16px;
	font-weight: 700;
}

.rf-list__clear {
	margin-inline-start: 12px;
	color: var(--rf-ink);
	font-weight: 600;
}

.rf-list__none {
	margin: 32px 0;
	padding: 32px 20px;
	border: 1px dashed var(--rf-rule);
	border-radius: var(--rf-radius);
	color: var(--rf-ink-2);
	text-align: center;
}

/* While a filter's answer is on its way. */
[data-rf-list][aria-busy="true"] .rf-grid {
	opacity: 0.45;
}

/* The cards. */
.rf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rf-grid__item {
	display: flex;
	min-width: 0;
}

.rf-card {
	display: flex;
	width: 100%;
	min-width: 0;
	overflow: clip;
	border: 1px solid var(--rf-rule);
	border-radius: var(--rf-radius);
	background: var(--rf-paper);
}

.rf-card:has(a.rf-card__link:hover) {
	border-color: var(--rf-ink);
}

.rf-card__link {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.rf-card__link:focus-visible {
	outline-offset: -3px;
}

.rf-card__ph {
	position: relative;
	aspect-ratio: 3 / 2;
	background: var(--rf-tint);
}

.rf-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rf-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
}

.rf-card__type {
	margin: 0;
	color: var(--rf-steel);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.rf-card__name {
	margin: 0;
	font: 800 1.25rem/1.15 var(--rf-font-head);
	letter-spacing: -0.01em;
}

a.rf-card__link:hover .rf-card__name {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.rf-card__price {
	margin: 2px 0 0;
	font: 800 1.125rem/1.2 var(--rf-font-head);
	font-variant-numeric: tabular-nums;
}

.rf-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 14px;
	margin: 0;
	padding: 0;
	color: var(--rf-ink-2);
	font-size: 0.875rem;
	list-style: none;
}

.rf-card__specs {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 10px 14px;
	margin: 8px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--rf-rule);
}

.rf-card__spec {
	min-width: 0;
}

.rf-card__spec-label {
	display: block;
	margin: 0;
	color: var(--rf-steel);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.25;
	text-transform: uppercase;
}

.rf-card__spec-value {
	display: block;
	margin: 2px 0 0;
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.rf-card__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: auto 0 0;
	padding-top: 12px;
}

/* The page numbers. */
.rf-pager {
	margin-top: 32px;
}

.rf-pager__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rf-pager__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--rf-rule);
	border-radius: var(--rf-radius);
	color: var(--rf-ink);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	text-decoration: none;
}

a.rf-pager__link:hover {
	border-color: var(--rf-ink);
}

.rf-pager__link.is-on {
	border-color: var(--rf-ink);
	background: var(--rf-ink);
	color: var(--rf-paper);
}

.rf-pager__gap {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--rf-steel);
}

@media (max-width: 599px) {
	.rf-pick {
		flex: 1 1 calc(50% - 8px);
	}

	/* The order's words are long: it takes a row of its own. */
	.rf-pick--order {
		flex-basis: 100%;
		margin-inline-start: 0;
	}

	/* Filters slide sideways on a phone instead of stacking into a wall of chips. */
	.rf-facet {
		width: 100%;
	}

	.rf-chips {
		flex-wrap: nowrap;
		margin-inline: calc(var(--rf-gut) * -1);
		padding-inline: var(--rf-gut);
		overflow-x: auto;
		scrollbar-width: none;
	}
}
