<?php ?>
<h1><?= sprintf(\App\Helpers\Lang::t('search_results'), htmlspecialchars($query)) ?></h1>

<?php if (empty($results)): ?>
    <div class="card">
        <p><?= \App\Helpers\Lang::t('no_results') ?></p>
    </div>
<?php else: ?>
    <?php foreach ($results as $post): ?>
        <div class="card">
            <h3><a href="/post/<?= $post['slug'] ?>" style="text-decoration: none; color: inherit;"><?= $post['title'] ?></a></h3>
            <p style="color: #666;"><?= mb_substr(strip_tags($post['content']), 0, 200) ?>...</p>
        </div>
    <?php endforeach; ?>
<?php endif; ?>
