<?php
/**
 * Vehicle archive — design-system card grid.
 *
 * Loaded via template_include for the `vehicles` post-type archive. Override by
 * copying this file to {your-theme}/automotive-feed-import/archive-vehicles.php.
 * The classic/block page shell (theme header + footer) is provided by
 * AutomotiveFeedImport::render_aii_page_shell().
 *
 * @package AutomotiveFeedImport
 */

if (! defined('ABSPATH')) {
	exit;
}

global $afi;
if (! isset($afi) || ! is_object($afi)) {
	get_header();
	get_footer();
	return;
}

$afi->render_aii_page_shell(function () use ($afi) {
	?>
	<div class="aii" data-theme="<?php echo esc_attr($afi->get_aii_color_scheme()); ?>">
		<div class="aii-archive-page">
			<?php
			$afi->render_aii_icon_sprite();
			// Filter UI + results. Free = search bar + grid; Pro replaces this
			// with the AJAX sidebar layout via the afi_archive_body filter.
			// All markup is escaped within the renderers.
			echo $afi->render_archive_body(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			?>
		</div>
	</div>
	<?php
});
