/* Label: Shingle */
/*
 * The overlapping step cards (prototype methodology.html "assessment-steps"): from 1024 the cards sit edge to edge,
 * each square on its left and rounded 20px on its right, ON the next card's colour, so a sliver of the next card shows
 * in the previous card's right corners. Below 1024 they are separate rounded cards (1 column, 2 from 640, gap 15).
 *
 * Recipe: one Group with this style, one Group per card inside it. Each card's colour is its own background colour;
 * the backing behind the card before it follows automatically (::before inherits the card's background), so
 * reordering or recolouring cards needs no other change.
 *
 *   core/group {"className":"is-style-shingle","layout":{"type":"default"}}
 *     core/group {"backgroundColor":"white","style":{"spacing":{"padding":{"top":"28px","bottom":"28px","left":"20px",
 *                 "right":"20px"}}},"layout":{"type":"flex","orientation":"vertical","verticalAlignment":"space-between",
 *                 "flexWrap":"nowrap"}}   … the card's blocks (one Group per card, any number of cards)
 *
 * Cards are 450px tall at least from 1024 (lg:min-h-[450px]).
 */
.wp-block-group.is-style-shingle {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 15px;
	isolation: isolate;
}

.wp-block-group.is-style-shingle > * {
	position: relative;
	margin: 0;
	border-radius: var(--wp--custom--radius--step);
}

@media (width >= 640px) {
	.wp-block-group.is-style-shingle {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (width >= 1024px) {
	.wp-block-group.is-style-shingle {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		gap: 0;
	}

	.wp-block-group.is-style-shingle > * {
		min-height: 450px;
	}

	.wp-block-group.is-style-shingle > * + * {
		border-top-left-radius: 0;
		border-bottom-left-radius: 0;
	}

	/* The backing: this card's colour, under the right edge of the card before it. */
	.wp-block-group.is-style-shingle > * + *::before {
		content: "";
		position: absolute;
		z-index: -1;
		top: 0;
		bottom: 0;
		right: 100%;
		width: var(--wp--custom--radius--step);
		background: inherit;
		pointer-events: none;
	}

	/* Each card paints over the next one (and so over that card's backing): first card on top. */
	.wp-block-group.is-style-shingle > :nth-last-child(1) { z-index: 1; }
	.wp-block-group.is-style-shingle > :nth-last-child(2) { z-index: 2; }
	.wp-block-group.is-style-shingle > :nth-last-child(3) { z-index: 3; }
	.wp-block-group.is-style-shingle > :nth-last-child(4) { z-index: 4; }
	.wp-block-group.is-style-shingle > :nth-last-child(5) { z-index: 5; }
	.wp-block-group.is-style-shingle > :nth-last-child(6) { z-index: 6; }
	.wp-block-group.is-style-shingle > :nth-last-child(7) { z-index: 7; }
	.wp-block-group.is-style-shingle > :nth-last-child(8) { z-index: 8; }
}
