<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
if (!defined('ABSPATH')) exit;

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
// === DEFINIR CONSTANTES (FALLBACK) ===
if (!defined('NEWSSYNC_PLUGIN_PATH')) {
    define('NEWSSYNC_PLUGIN_PATH', plugin_dir_path(__DIR__ . '/../../'));
}
if (!defined('NEWSSYNC_PLUGIN_DIR')) {
    define('NEWSSYNC_PLUGIN_DIR', NEWSSYNC_PLUGIN_PATH);
}

// === RENDERIZA DIRETO (SEM ob_start) ===
include NEWSSYNC_PLUGIN_DIR . 'includes/templates/grid/grid-container-open.php';

// this template uses the established contract variables `$items`/`$item` shared with included templates
foreach ($items as $item):
    include NEWSSYNC_PLUGIN_DIR . 'includes/templates/grid/grid-item.php';
endforeach;

include NEWSSYNC_PLUGIN_DIR . 'includes/templates/grid/grid-container-close.php';
// phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
