<?php
 
 
 
?>

<div class="section-title-row">
    <h1 class="section-title" style="text-transform:uppercase;"><?php echo htmlspecialchars($category['name']); ?><?php if (!empty($videos)): ?> <span style="font-weight:400;font-size:14px;color:var(--text-muted);margin-left:6px;"><?php echo $pagination->total !== 1 ? __('video_count_plural', [':count' => Format::number($pagination->total)]) : __('video_count', [':count' => Format::number($pagination->total)]); ?></span><?php endif; ?></h1>
    <?php if (!empty($videos)): ?>
        <?php echo hentaiSortDropdown($sort ?? 'newest'); ?>
    <?php endif; ?>
</div>

<?php if (!empty($category['description'])): ?>
<p style="color:var(--text-muted);font-size:14px;line-height:1.7;max-width:700px;margin:0 0 24px;"><?php echo htmlspecialchars($category['description']); ?></p>
<?php endif; ?>

<?php if (!empty($videos)): ?>
<?php Ads::zone('category_top'); ?>
<div class="video-grid">
    <?php foreach ($videos as $video): ?>
        <?php echo hentaiVideoCard($video); ?>
        <?php Ads::betweenGrid('category_between', 10); ?>
    <?php endforeach; ?>
</div>
<?php Ads::zone('category_bottom'); ?>
<?php else: ?>
    <div class="empty-state">
        <div class="empty-state__icon"><i class="fa-light fa-video-slash"></i></div>
        <p class="empty-state__text"><?php echo __('no_videos_category'); ?></p>
    </div>
<?php endif; ?>

<?php echo hentaiPagination($pagination); ?>
