<footer class="site-footer" id="kontak" <?= !empty($identitas['footer_bg_color']) ? 'style="background:' . htmlspecialchars($identitas['footer_bg_color']) . ';"' : '' ?>>
  <span class="footer-ribbon"></span>
  <div class="container">
    <div class="footer-grid">
      <?php foreach ($footerKolom as $kolom): ?>
        <div class="footer-col" <?= !empty($kolom['warna']) ? 'style="color:' . htmlspecialchars($kolom['warna']) . ';"' : '' ?>>
          <h5 <?= !empty($kolom['warna']) ? 'style="color:' . htmlspecialchars($kolom['warna']) . ';"' : '' ?>><?= htmlspecialchars($kolom['judul']) ?></h5>

          <?php if ($kolom['tipe'] === 'tautan'): ?>
            <ul>
              <?php foreach ($kolom['links'] as $link): ?>
                <li>
                  <a href="<?= htmlspecialchars($link['url']) ?>" <?= !empty($kolom['warna']) ? 'style="color:' . htmlspecialchars($kolom['warna']) . ';"' : '' ?> class="footer-link">
                    <?php if (!empty($link['label'])): ?><span><?= htmlspecialchars($link['label']) ?></span><?php endif; ?>
                    <?php if (!empty($link['gambar'])): ?>
                      <img src="<?= APP_URL . '/uploads/footer/' . htmlspecialchars($link['gambar']) ?>" alt="<?= htmlspecialchars($link['label'] ?? '') ?>" class="footer-link-icon">
                    <?php endif; ?>
                  </a>
                </li>
              <?php endforeach; ?>
            </ul>
          <?php elseif ($kolom['tipe'] === 'gambar' && !empty($kolom['gambar'])): ?>
            <img src="<?= APP_URL . '/uploads/footer/' . htmlspecialchars($kolom['gambar']) ?>" alt="<?= htmlspecialchars($kolom['judul']) ?>" style="max-width:100%; border-radius:8px;">
            <?php if (!empty($kolom['konten'])): ?><p class="footer-col-text"><?= htmlspecialchars($kolom['konten']) ?></p><?php endif; ?>
          <?php elseif ($kolom['tipe'] === 'html'): ?>
            <div class="footer-col-html"><?= $kolom['konten'] ?? '' ?></div>
          <?php elseif ($kolom['tipe'] === 'iframe' && !empty($kolom['konten'])): ?>
            <div class="footer-col-iframe">
              <iframe src="<?= htmlspecialchars($kolom['konten']) ?>" loading="lazy" frameborder="0" allowfullscreen></iframe>
            </div>
          <?php else: ?>
            <p class="footer-col-text"><?= nl2br(htmlspecialchars($kolom['konten'] ?? '')) ?></p>
          <?php endif; ?>
        </div>
      <?php endforeach; ?>
    </div>

    <div class="footer-bottom">
      <div class="footer-brand">
        <span class="brand-logo">
          <?= htmlspecialchars(mb_substr($identitas['singkatan'] ?? 'F', 0, 2)) ?>
        </span>
        <?= htmlspecialchars($identitas['nama_fakultas'] ?? APP_NAME) ?>
      </div>
      <p class="footer-copy">&copy; <?= date('Y') ?> <?= htmlspecialchars($identitas['nama_fakultas'] ?? APP_NAME) ?>. Seluruh hak cipta dilindungi.</p>
    </div>
  </div>
</footer>

<script src="<?= APP_URL ?>/assets/js/main.js"></script>
</body>
</html>
