/* T-053: the container token controls when spans become asymmetric.
 * Without typed division/round(), the complete content stays in one column.
 * Counts, spans, fractions and percentages describe grid structure, not dimensions.
 */
.forge-bento-container {
	container-type: inline-size;
}
.forge-bento-grid {
	--forge-bento-wide: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
}
.forge-bento-grid > .forge-bento-card {
	box-sizing: border-box;
	min-width: 0;
	margin-block: 0;
	padding: var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--custom--bento--background);
	color: var(--wp--custom--bento--text);
	overflow-wrap: anywhere;
}
.forge-bento-card > :first-child {
	margin-block-start: 0;
}
.forge-bento-card > :last-child {
	margin-block-end: 0;
}
.forge-bento-card > .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--wp--custom--bento--media-ratio);
	object-fit: cover;
	border-radius: var(--wp--custom--radius--card);
}
@supports (opacity: calc(100vw / 100vw)) and (opacity: round(down, 1, 1)) {
	.forge-bento-grid {
		--forge-bento-wide: clamp(0, round(down, calc(100cqi / var(--wp--custom--bento--min-grid-width)), 1), 1);
		grid-template-columns: repeat(calc(1 + 2 * var(--forge-bento-wide)), minmax(0, 1fr));
		grid-auto-rows: minmax(var(--wp--custom--bento--row-min-height), auto);
	}
	.forge-bento-grid--3 {
		grid-template-columns: repeat(calc(1 + 3 * var(--forge-bento-wide)), minmax(0, 1fr));
	}
	.forge-bento-grid > .forge-bento-card:first-child {
		grid-column: span calc(1 + var(--forge-bento-wide));
		grid-row: span calc(1 + var(--forge-bento-wide));
	}
	.forge-bento-grid--3 > .forge-bento-card:not(:first-child),
	.forge-bento-grid--5 > .forge-bento-card:nth-child(4) {
		grid-column: span calc(1 + var(--forge-bento-wide));
	}
}
