<form class="card mb-4" method="get" action="/search">
    <div class="card-body">
        <div class="input-group input-group-lg"><span class="input-group-text">⌕</span><input class="form-control"
                name="q" value="<?= h($searchQuery) ?>" minlength="2" maxlength="120" autofocus
                placeholder="<?= h(t('search.placeholder')) ?>"><button
                class="btn btn-primary"><?= h(t('search.action')) ?></button></div>
    </div>
</form>
<?php if (mb_strlen($searchQuery) < 2): ?><div class="empty">
    <div class="empty-description"><?= h(t('search.hint')) ?></div>
</div><?php elseif (!$searchResults): ?><div class="empty">
    <div class="empty-description"><?= h(t('search.none')) ?></div>
</div><?php else: ?>
<div class="row row-cards"><?php foreach ($searchResults as $type => $items): ?><div class="col-12 col-lg-6">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title"><?= h(t('search.group.' . $type)) ?></h3><span
                    class="badge bg-blue-lt ms-auto"><?= count($items) ?></span>
            </div>
            <div class="list-group list-group-flush"><?php foreach ($items as $item): ?><a
                    class="list-group-item list-group-item-action"
                    href="<?= h($item['url']) ?>"><strong><?= h($item['title']) ?></strong><?php if ($item['detail']): ?>
                    <div class="text-muted small"><?= h($item['detail']) ?></div><?php endif; ?></a><?php endforeach; ?>
            </div>
        </div>
    </div><?php endforeach; ?></div>
<?php endif; ?>
