/*
 * ACC-5: accordion grouped under headings.
 * Each group is a heading with its own questions. On a wide screen the
 * heading stands beside its questions; on a narrow one above them. Staff add,
 * remove and move whole groups, and questions inside a group.
 *
 * The accordion of a group stands in a group block of its own
 * (wprk-acc-5__questions). An item of a row fixes its parts, and everything in
 * it takes that over; the group block is where it ends, so a question can be
 * added (see "An accordion inside an item" in the kit's technical notes).
 */

.wprk-acc-5 .wprk-acc-5__groups {
	--wprk-row-gap: var(--wp--preset--spacing--60);
	grid-template-columns: minmax(0, 1fr);
	margin-block: 0;
}

.wprk-acc-5 .wprk-acc-5__group {
	display: grid;
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
	grid-template-columns: minmax(0, 1fr);
}

.wprk-acc-5 .wprk-acc-5__group > * {
	margin-block: 0;
	min-width: 0;
}

.wprk-acc-5 .wprk-acc-5__group > :where(h2, h3, h4) {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
}

@media (min-width: 782px) {
	.wprk-acc-5 .wprk-acc-5__group {
		grid-template-columns: minmax(12rem, 1fr) minmax(0, 2.4fr);
	}

	/* The heading stands level with the first question. */
	.wprk-acc-5 .wprk-acc-5__group > :where(h2, h3, h4) {
		padding-block-start: var(--wp--preset--spacing--20);
	}

	/* A group left without its heading keeps its questions in their column. */
	.wprk-acc-5 .wprk-acc-5__group > .wprk-acc-5__questions:only-child {
		grid-column: 2;
	}
}
