<?php require_once __DIR__ . '/includes/bootstrap.php';
$pageTitle = 'Events | Underground FX Radio';
$currentPage = basename(__FILE__);
include __DIR__ . '/includes/header.php';
?>
<section class="ugfx-page-hero">
  <div class="container-xxl">
    <div class="ugfx-kicker"><i class="bi bi-lightning-charge-fill"></i> Underground FX Radio</div>
    <h1 class="page-title">Events and promotions</h1>
    <p class="page-copy">Premium event rail prepared for station promotions, network events, and final Underground campaign blocks.</p>
  </div>
</section>

<section class="section-pad pt-3">
  <div class="container-xxl">
    <div class="ugfx-event-grid">
      <?php foreach (ugfx_get_events(10) as $event): ?>
      <article class="ugfx-card p-4">
        <div class="ugfx-micro-label mb-2"><?= htmlspecialchars(($event['start'] ?? '') . ' → ' . ($event['end'] ?? '')) ?></div>
        <h3><?= htmlspecialchars($event['title'] ?? 'Event') ?></h3>
        <p class="text-secondary mb-3"><?= nl2br(htmlspecialchars($event['description'] ?? '')) ?></p>
        <?php if (!empty($event['external_url'])): ?><a class="btn ugfx-btn-outline btn-sm" href="<?= htmlspecialchars($event['external_url']) ?>" target="_blank" rel="noopener"><?= htmlspecialchars($event['external_label'] ?? 'Open event') ?></a><?php endif; ?>
      </article>
      <?php endforeach; ?>
    </div>
  </div>
</section>

<?php include __DIR__ . '/includes/footer.php'; ?>
