/* aieo/category-chips, variant "button" (11.3.10): the designer's square sub-category chips (archive B; the owner,
 * 11 Nov 2026: the look and the counts change, the terms are the strip's). One row that wraps; the current page's
 * chip in ink with the page's colour on it, the number of products beside each name. On a phone (below 48rem) one row
 * that slides sideways (the default; `--wrap` keeps the rows): no bar and no script, the next chip cut at the edge;
 * inside a group with the page's side padding the row runs to the screen's edges and starts where the text starts. A
 * browser that knows scroll-initial-target opens the row on the current chip. The shape is the theme's button shape;
 * no colour of the block's own: the theme's tokens, else the text's own colour. Loaded only where the look renders. */
.aieo-subcats {
	margin: 0;
}
.aieo-subcats__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--2);
	margin: 0;
	padding: 0;
	list-style: none;
}
.aieo-subcats__list > li {
	margin: 0;
}
.aieo-subcats .aieo-subcats__chip {
	/* The containing block of its count's words for screen readers (absolutely placed, 1 px): outside the row
	 * that scrolls, they widened the phone's page by every chip past the edge. */
	/* The name and its smaller count share one baseline (the owner, 12 Nov 2026: the numbers were "not totally
	 * vertically properly aligned with the category text"); the line is centred in the chip's 44 px by the padding:
	 * the height less the borders less the line (1.25 at the chip's size), halved. */
	position: relative;
	display: inline-flex;
	align-items: baseline;
	gap: var(--wp--preset--spacing--2);
	box-sizing: border-box;
	min-height: 2.75rem;
	padding: calc((2.75rem - 2px - 1.25em) / 2) var(--wp--preset--spacing--4);
	border: 1px solid var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent));
	border-radius: var(--wp--custom--rooster--shape--button, 0);
	background: transparent;
	color: var(--wp--preset--color--fg, currentColor);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 160ms, border-color 160ms, color 160ms;
}
/* A width the fonts do not decide (rooster-theme-67, 1 Dec 2026: e-sotiriou's /pleximo at 1440 re-wrapped its first
 * row when the web font replaced its fallback, 0.5 to 3 % wider, CLS 0.083): each chip is at least its characters
 * (--aieo-ch, its count's --aieo-cc, printed by the server) times the theme's advance per character, a little above
 * the face's, so the rows break alike in the fallback and the face and the swap moves nothing to another row; the
 * words centred in the chip. A theme without the advance (--wp--custom--rooster--type--advance) keeps the chips their
 * text's width. Not with a photo, whose words wrap, nor in the phone's sideways row (below). */
.aieo-subcats:not(.aieo-subcats--media) .aieo-subcats__chip {
	justify-content: center;
	min-inline-size: calc(
		var(--aieo-ch) * var(--wp--custom--rooster--type--advance) * 1em
		+ var(--aieo-cc) * var(--wp--custom--rooster--type--advance) * var(--wp--preset--font-size--xs)
		+ min(var(--aieo-cc), 1) * var(--wp--preset--spacing--2)
		+ 2 * var(--wp--preset--spacing--4) + 2px
	);
}
.aieo-subcats .aieo-subcats__chip:hover {
	border-color: var(--wp--preset--color--fg, currentColor);
	background: color-mix(in srgb, currentColor 6%, transparent);
	color: var(--wp--preset--color--fg, currentColor);
}
.aieo-subcats .aieo-subcats__chip[aria-current] {
	border-color: var(--wp--preset--color--fg, CanvasText);
	background: var(--wp--preset--color--fg, CanvasText);
	color: var(--wp--preset--color--bg, Canvas);
}
.aieo-subcats__count {
	color: var(--wp--preset--color--muted, currentColor);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}
.aieo-subcats__chip[aria-current] .aieo-subcats__count {
	color: inherit;
	opacity: 0.75;
}
@media (prefers-reduced-motion: reduce) {
	.aieo-subcats .aieo-subcats__chip {
		transition: none;
	}
}
/* The row fill on a computer (`rowFill`, on by default; the owner, 29 Nov 2026: «I would like the spaces to be
 * symmetrical to get all the width of each row, unless we have rows of 3 items or less»): every full row runs from edge
 * to edge, the spaces between its chips even, the chips their own width; a filler after the last chip takes what the
 * last row leaves, so that row keeps its own spacing (its gap cancelled, it never wraps alone). No script, no shift.
 * Where the block is wide (1100 px: the chips stand four and more to a row); a narrower one holds two or three a row
 * and keeps them as they are (the e-sotiriou camping archive at 1024: rows of two would have stood 300 px apart). */
.aieo-subcats--fill {
	container: aieo-subcats / inline-size;
}
@container aieo-subcats (min-width: 1100px) {
	.aieo-subcats--fill .aieo-subcats__list {
		justify-content: space-between;
	}
	.aieo-subcats--fill .aieo-subcats__list::after {
		content: "";
		flex: 1 1 0;
		margin-inline-start: calc(-1 * var(--wp--preset--spacing--2));
	}
}
@media (max-width: 47.999rem) {
	.aieo-subcats:not(.aieo-subcats--wrap) .aieo-subcats__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		padding-block: 4px;
	}
	.aieo-subcats:not(.aieo-subcats--wrap) .aieo-subcats__list::-webkit-scrollbar {
		display: none;
	}
	.aieo-subcats:not(.aieo-subcats--wrap) .aieo-subcats__list > li {
		flex: none;
	}
	.has-global-padding > .aieo-subcats:not(.aieo-subcats--wrap) .aieo-subcats__list {
		margin-inline: calc(-1 * var(--wp--style--root--padding-left, 0px)) calc(-1 * var(--wp--style--root--padding-right, 0px));
		padding-inline: var(--wp--style--root--padding-left, 0px) var(--wp--style--root--padding-right, 0px);
		scroll-padding-inline: var(--wp--style--root--padding-left, 0px) var(--wp--style--root--padding-right, 0px);
	}
	.aieo-subcats .aieo-subcats__chip[aria-current] {
		scroll-initial-target: nearest;
	}
	/* The sideways row never wraps again, so it keeps the chips their text's width (the owner, 1 Dec 2026: «roomier
	 * on computers only», phones as they were; the least width cut craft's second count at the edge). */
	.aieo-subcats:not(.aieo-subcats--wrap):not(.aieo-subcats--media) .aieo-subcats__chip {
		min-inline-size: auto;
	}
}
/* With a photo (`showImage`; rooster-admin-d2, 29 Nov 2026, the e-sotiriou three-world home's request 5): the photo a
 * square at the chip's start, the name over its count, the chip as tall as its photo with the words beside it. The
 * parts (media, text, name, count) are a look's to size: these are the defaults, in the theme's tokens, no colour of
 * their own; under Rooster Zero the sheet's layered twin lets a look's recipes win. */
.aieo-subcats--media .aieo-subcats__chip {
	align-items: center;
	gap: var(--wp--preset--spacing--3);
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4) var(--wp--preset--spacing--2) var(--wp--preset--spacing--2);
	white-space: normal;
}
.aieo-subcats__media {
	flex: none;
	inline-size: 3.5rem;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--wp--custom--rooster--shape--button, 0);
	background: color-mix(in srgb, currentColor 6%, transparent);
}
.aieo-subcats__media img {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}
.aieo-subcats__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-inline-size: 0;
}
