<?php 
require_once __DIR__ . '/../adm/config/db.php';
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;

$sql = "SELECT * FROM paginas_institucionais WHERE id = $id";
$res = $conn->query($sql);
$pagina = $res->fetch_assoc();

if (!$pagina) {
    header("Location: index.php");
    exit;
}

$pageTitle = $pagina['titulo'] . " - CATÁLOGO 44";
include 'header.php';
?>

<!-- Hero Start -->
<div class="container-fluid bg-primary py-5 hero-header mb-5">
    <div class="row py-3">
        <div class="col-12 text-center">
            <h1 class="display-3 text-white animated zoomIn"><?= htmlspecialchars($pagina['titulo']) ?></h1>
            <a href="index.php" class="h4 text-white">Início</a>
            <i class="far fa-circle text-white px-2"></i>
            <span class="h4 text-white"><?= htmlspecialchars($pagina['titulo']) ?></span>
        </div>
    </div>
</div>
<!-- Hero End -->

<!-- Content Start -->
<div class="container-fluid py-5">
    <div class="container">
        <div class="row g-5">
            <div class="col-lg-12 wow slideInUp" data-wow-delay="0.1s">
                <div class="bg-light rounded p-5">
                    <div class="institutional-content">
                        <?= $pagina['conteudo'] ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Content End -->

<?php include 'footer.php'; ?>
