/*
 * rooster/card, variant category (10 Nov 2026, the designer's direction B, "Nails, lips, hair, skin."): the tiles,
 * complete on their own: the grid (two columns, the tiles' count up to four from 64rem, the third spacing step apart),
 * the tile (the theme's card shape, its picture at 4:5 cut to fill, the band under it), the band (the name in the
 * headings' face and stretch, the count small in tabular figures; stacked on a phone, side by side from 64rem), the
 * area colours with their inks (the theme's C2@2 tokens; a reader's fallbacks: the accent, accent-2, the ornament,
 * subtle, and an ink black or white picked from its ground), the pointer's slow zoom (none with reduced motion) and the
 * focus ring. No colour of the block's own. Compiled by build/blocks-css.mjs.
 */

@import "../../theme.css";

.rooster-category-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--3, 0.75rem);
	box-sizing: border-box;
	margin-block-end: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 64rem) {
	.rooster-category-tiles--cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.rooster-category-tiles--cols-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.rooster-category-tiles__item {
	--rooster-tile-ground: var(--wp--preset--color--subtle);
	--rooster-tile-ink: var(--wp--preset--color--fg);
	margin: 0;
}

.rooster-category-tiles__item.is-area-lacquer {
	--rooster-tile-ground: var(--wp--custom--rooster--area--lacquer, var(--wp--preset--color--accent));
	--rooster-tile-ink: var(--wp--custom--rooster--area--on-lacquer, oklch(from var(--rooster-tile-ground) clamp(0, (0.62 - l) * 999, 1) 0 0));
}

.rooster-category-tiles__item.is-area-plum {
	--rooster-tile-ground: var(--wp--custom--rooster--area--plum, var(--wp--preset--color--accent-2));
	--rooster-tile-ink: var(--wp--custom--rooster--area--on-plum, oklch(from var(--rooster-tile-ground) clamp(0, (0.62 - l) * 999, 1) 0 0));
}

.rooster-category-tiles__item.is-area-coral {
	--rooster-tile-ground: var(--wp--custom--rooster--area--coral, var(--wp--preset--color--ornament));
	--rooster-tile-ink: var(--wp--custom--rooster--area--on-coral, oklch(from var(--rooster-tile-ground) clamp(0, (0.62 - l) * 999, 1) 0 0));
}

.rooster-category-tiles__item.is-area-blush {
	--rooster-tile-ground: var(--wp--custom--rooster--area--blush, var(--wp--preset--color--subtle));
	--rooster-tile-ink: var(--wp--custom--rooster--area--on-blush, oklch(from var(--rooster-tile-ground) clamp(0, (0.62 - l) * 999, 1) 0 0));
}

.rooster-category-tiles__item.is-area-nude {
	--rooster-tile-ground: var(--wp--custom--rooster--area--nude, var(--wp--preset--color--subtle));
	--rooster-tile-ink: var(--wp--custom--rooster--area--on-nude, oklch(from var(--rooster-tile-ground) clamp(0, (0.62 - l) * 999, 1) 0 0));
}

.rooster-category-tiles .rooster-category-tiles__card {
	display: grid;
	grid-template-rows: auto 1fr;
	box-sizing: border-box;
	height: 100%;
	overflow: hidden;
	border-radius: var(--wp--custom--rooster--shape--card, 0);
	background: var(--rooster-tile-ground);
	color: var(--rooster-tile-ink);
	text-decoration: none;
}

.rooster-category-tiles .rooster-category-tiles__card:focus-visible {
	outline: 2px solid var(--wp--preset--color--fg);
	outline-offset: 2px;
}

.rooster-category-tiles__media {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.rooster-category-tiles__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
	.rooster-category-tiles__media img {
		transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	.rooster-category-tiles__card:hover .rooster-category-tiles__media img {
		transform: scale(1.03);
	}
}

.rooster-category-tiles__foot {
	display: flex;
	flex-direction: column;
	gap: 0.25rem 0.75rem;
	padding: var(--wp--preset--spacing--3, 0.75rem);
}

.rooster-category-tiles__name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lg);
	font-stretch: var(--wp--custom--rooster--stretch--heading, normal);
	font-weight: 650;
	line-height: 1.2;
}

.rooster-category-tiles__count {
	font-size: var(--wp--preset--font-size--sm);
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
}

@media (min-width: 64rem) {
	.rooster-category-tiles__foot {
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
		padding: var(--wp--preset--spacing--4, 1rem);
	}

	.rooster-category-tiles__name {
		font-size: var(--wp--preset--font-size--xl);
	}

	.rooster-category-tiles__count {
		flex-shrink: 0;
	}
}
