/*
 * Grid: children in as many equal columns as the room allows.
 *
 * Card galleries, product listings, dashboards. The column count follows the available space
 * instead of a breakpoint, so one column on a phone and four on a desktop is the same markup.
 *
 * `min()` against `100%` is load-bearing: `minmax(20ch, 1fr)` alone keeps a 20ch floor even in a
 * narrower container, and the row then overflows it.
 *
 * Add `grid-span` to a child that should have a row to itself.
 *
 * Knobs:
 * - `--sh-min-column-size` (default `20ch`) — the width below which a column is dropped.
 * - `--sh-gap` (default `var(--sh-space-md)`) — space between cells, on both axes.
 * - `--sh-align` (default `stretch`) — block alignment of the cells within their row.
 */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(var(--sh-min-column-size, 20ch), 100%), 1fr));
	gap: var(--sh-gap, var(--sh-space-md));
	align-items: var(--sh-align, stretch);
}

.grid-span {
	grid-column: 1 / -1;
}
