<?php require BASE_PATH . '/app/Views/layouts/header.php'; ?>

<section class="page-hero">
  <div class="container">
    <span class="eyebrow">Galeri</span>
    <h1>Galeri Video</h1>
  </div>
</section>

<section class="galeri-page">
  <div class="container">
    <?php if (empty($daftarVideo)): ?>
      <p style="color:var(--text-muted); text-align:center; padding:40px 0;">Belum ada video.</p>
    <?php else: ?>
      <div class="video-grid">
        <?php foreach ($daftarVideo as $video): ?>
          <div class="video-card">
            <div class="video-embed">
              <iframe src="<?= \App\Core\YouTube::embedUrl($video['url_video']) ?>" title="<?= htmlspecialchars($video['judul']) ?>"
                      frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen loading="lazy"></iframe>
            </div>
            <h3><?= htmlspecialchars($video['judul']) ?></h3>
            <?php if (!empty($video['deskripsi'])): ?>
              <p><?= htmlspecialchars($video['deskripsi']) ?></p>
            <?php endif; ?>
          </div>
        <?php endforeach; ?>
      </div>
    <?php endif; ?>
  </div>
</section>

<?php require BASE_PATH . '/app/Views/layouts/footer.php'; ?>
