<?php if (!$animals): ?><div class="empty"><?= h(t('public_site.no_animals')) ?></div><?php else: ?><div class="grid">
    <?php foreach ($animals as $a): ?><a class="animal-card"
        href="<?= h($siteUrl('animal', ['id' => (int)$a['id']])) ?>"><?php if ($a['primary_photo']): ?><img
            loading="lazy" src="/media/animals/<?= (int)$a['id'] ?>/<?= h(rawurlencode($a['primary_photo'])) ?>"
            alt="<?= h($a['name']) ?>"><?php else: ?><div class="photo-placeholder"><?= h($a['species_icon'] ?: '🐾') ?>
        </div><?php endif; ?><div class="animal-card-body">
            <h3><?= h($a['name']) ?></h3>
            <div class="meta">
                <?= h(($a['species_name'] ?: SpeciesService::label($a['species'])) . ' · ' . public_age($a)) ?></div>
            <div class="chips"><?php if ($a['sex'] === 'F'): ?><span class="chip">♀
                    <?= h(t('sex.female')) ?></span><?php elseif ($a['sex'] === 'M'): ?><span class="chip">♂
                    <?= h(t('sex.male')) ?></span><?php endif; ?><?php if ($a['sterilization_status'] === 'yes'): ?><span
                    class="chip">✓ <?= h(t('public_site.sterilized')) ?></span><?php endif; ?></div>
        </div></a><?php endforeach; ?></div><?php endif; ?>
