<?php
/**
 * CMS Page View
 * Header & Footer are handled by layout.php
 */
?>

<!-- CMS PAGE STYLE -->
<link rel="stylesheet" href="/themes/matjari/assets/css/cms-page.css">

<section class="cms-page">

    <header class="cms-header">
        <div class="cms-breadcrumb">
            <a href="/"><?= __('breadcrumb.home','Home') ?></a>
            <span> / </span>
            <span><?= htmlspecialchars($page['title']) ?></span>
        </div>

        <h1 class="cms-title">
            <?= htmlspecialchars($page['title']) ?>
        </h1>

        <?php if (!empty($page['excerpt'])): ?>
            <p class="cms-subtitle">
                <?= htmlspecialchars($page['excerpt']) ?>
            </p>
        <?php endif; ?>
    </header>

    <div class="cms-content-wrapper">
        <article class="cms-content">
            <?php
            // Content is sanitized at save-time by Admin\PageController::sanitizePageContent()
            // Defense-in-depth: run the centralized sanitizer again at render time
            echo \Core\System\HtmlSanitizer::sanitize((string)($page['content'] ?? ''));
            ?>
        </article>
    </div>

</section>
