/*
 * Receitas listing, node 813:45703: segment chips, recipe grid and "Ver mais receitas".
 *
 * Mobile first. The Figma only draws 1440, where the section is 24 on top and 120 at the
 * bottom (934:71245) with 56 between its three blocks, the grid is 3 x 392 with 20
 * between columns and 40 between rows. Below that the layout is ours: one column, then two from 640.
 */

.recipes-listing {
	padding-block: var(--space-4) var(--space-7);
	background-color: var(--color-surface);
	/* CARD | RECEITAS on the white section of 934:71245: a Light Gray card, 400 tall. */
	--recipe-card-bg: var(--color-surface-muted);
	--recipe-card-height: 400px;
}

.recipes-listing__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
}

/*
 * Chips. On a phone the seven of the frame do not fit in one row and wrapping them into
 * three ragged lines pushes the first card off screen, so they scroll sideways instead,
 * bleeding to the edges of the screen. The block padding keeps the focus ring inside the
 * scroll box, which would clip it otherwise.
 */
.recipes-listing__chips {
	display: flex;
	gap: var(--space-1);
	margin-inline: calc(var(--container-gutter) * -1);
	padding: 4px var(--container-gutter);
	overflow-x: auto;
	scrollbar-width: none;
	scroll-padding-inline: var(--container-gutter);
}

.recipes-listing__chips::-webkit-scrollbar {
	display: none;
}

.recipes-listing__chips > li {
	flex: none;
}

/* BUTTON | FILTRO of the listing: 36 tall and 16 of side padding, against the 44 of the tabs. */
.chip--compact {
	height: 36px;
	padding-inline: var(--space-3);
}

/* The chips are links here, so the selected state is aria-current, not aria-selected. */
.recipes-listing .chip[aria-current='page'],
.recipes-listing .chip[aria-current='page']:hover {
	background-color: var(--color-selected);
	color: var(--color-text-on-brand);
}

.recipes-listing__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-4);
}

.recipes-listing__item[hidden] {
	display: none;
}

.recipes-listing__empty {
	color: var(--color-text);
	font-size: var(--font-p2);
	text-align: center;
}

.recipes-listing__more {
	display: flex;
	justify-content: center;
}

.recipes-listing__more[hidden] {
	display: none;
}

/* The products carousel that closes the page: 120 above its title in node 813:69684. */
.recipes-listing + .products {
	padding-block: var(--section-padding-end);
}

@media (min-width: 640px) {
	.recipes-listing__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-5) 20px;
	}
}

@media (min-width: 768px) {
	/* From here the chips fit, centred, and wrap if a new segment ever needs it. */
	.recipes-listing__chips {
		flex-wrap: wrap;
		justify-content: center;
		margin-inline: 0;
		padding-inline: 0;
		overflow-x: visible;
	}
}

@media (min-width: 1024px) {
	/* 120 under the grid in 934:71245. */
	.recipes-listing {
		padding-block: var(--space-4) var(--section-padding-end);
	}

	.recipes-listing__inner {
		gap: var(--space-gap-section);
	}

	.recipes-listing__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--space-6) 20px;
	}
}
