/*
 * Center the final Loop Grid item only when it is the sole item in the last
 * row of an effective three-column layout.
 *
 * nth-of-type is used because Elementor places inline <style> siblings among
 * Loop Grid items. Counting generic child nodes would produce false matches.
 */

@media (min-width: 1025px) {
	.pp-lgc-center-single-final-row.elementor-grid-3
		> .elementor-widget-container
		> .elementor-loop-container.elementor-grid
		> .e-loop-item:last-of-type:nth-of-type(3n + 1),
	.pp-lgc-center-single-final-row-preview-yes.elementor-grid-3
		> .elementor-widget-container
		> .elementor-loop-container.elementor-grid
		> .e-loop-item:last-of-type:nth-of-type(3n + 1) {
		grid-column: 2 / span 1;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.pp-lgc-center-single-final-row.elementor-grid-3.elementor-grid-tablet-3
		> .elementor-widget-container
		> .elementor-loop-container.elementor-grid
		> .e-loop-item:last-of-type:nth-of-type(3n + 1),
	.pp-lgc-center-single-final-row-preview-yes.elementor-grid-3.elementor-grid-tablet-3
		> .elementor-widget-container
		> .elementor-loop-container.elementor-grid
		> .e-loop-item:last-of-type:nth-of-type(3n + 1) {
		grid-column: 2 / span 1;
	}
}
