/* Section: technical advice — template-parts/sections/technical.php */

.technical__title {
	margin-bottom: 20px;
	text-transform: uppercase;
}

.technical__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px 20px;
	margin: 0;
	padding: 0 20px;
	list-style: none;
}

@media (min-width: 782px) {
	.technical__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		padding-inline: 30px;
	}
}

.technical__item figure {
	margin: 0;
}

.technical__image {
	display: block;
	width: 100%;
	aspect-ratio: 255 / 230;
	object-fit: cover;
}

.technical__label {
	margin-top: 10px;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	text-align: center;
	color: var(--wp--preset--color--primary-dark);
}

/* Vertical position matched to the original design (desktop). */
@media (min-width: 782px) {
	.technical {
		padding-top: 50px;
	}
}

/* Phones — measured against timsteel.pt at 375px. */
@media (max-width: 781.98px) {
	.technical__grid {
		gap: 34px 20px;
		padding-inline: 20px;
	}

	.technical {
		padding-bottom: 87px;
	}

	.technical__image {
		aspect-ratio: 134 / 150;
	}

	/* The original lists the first four finishes right-to-left on phones. */
	.technical__grid:has(> li:nth-child(5)) > li:nth-child(1) { order: 4; }
	.technical__grid:has(> li:nth-child(5)) > li:nth-child(2) { order: 3; }
	.technical__grid:has(> li:nth-child(5)) > li:nth-child(3) { order: 2; }
	.technical__grid:has(> li:nth-child(5)) > li:nth-child(4) { order: 1; }
	.technical__grid:has(> li:nth-child(5)) > li:nth-child(n + 5) { order: 5; }
}
