<?php include __DIR__ . '/layout/header.php'; ?>

<div class="breadcrumb">
    <a href="<?php echo $baseUrl; ?>/">Ana Sayfa</a>
    <i class="fa fa-angle-right"></i>
    <span><?php echo htmlspecialchars($brand->name); ?></span>
</div>

<div class="archive-header">
    <h1><?php echo htmlspecialchars($brand->name); ?> Reset ve Hata Çözümleri</h1>
    <p><?php echo htmlspecialchars($brand->name); ?> yazıcılar için orijinal reset yazılımları, çip devre dışı bırakma dosyaları ve arıza kodu açıklamaları.</p>
</div>

<?php if (!empty($articles)): ?>
<div class="articles-grid">
    <?php foreach ($articles as $art): ?>
    <div class="article-card">
        <div class="article-badge"><?php echo htmlspecialchars($art->getCategory()->name ?? 'Genel'); ?></div>
        <h3><?php echo htmlspecialchars($art->title); ?></h3>
            <?php 
            $excerpt = trim(strip_tags($art->content));
            if ($excerpt !== '') {
                echo '<p>' . htmlspecialchars(mb_substr($excerpt, 0, 160)) . (mb_strlen($excerpt) > 160 ? '...' : '') . '</p>';
            }
            ?>
        <div class="article-meta">
            <?php if ($art->file_size): ?>
            <span><i class="fa fa-hdd-o"></i> Boyut: <?php echo htmlspecialchars($art->file_size); ?></span>
            <?php endif; ?>
            <span><i class="fa fa-eye"></i> <?php echo $art->view_count; ?> Gösterim</span>
        </div>
        <div class="article-actions">
            <a href="<?php echo $baseUrl; ?>/<?php echo $art->slug; ?>" class="btn-read">Kılavuzu Oku</a>
            <?php if ($art->download_url): ?>
            <a href="<?php echo htmlspecialchars($art->download_url); ?>" class="btn-download" target="_blank"><i class="fa fa-download"></i> İndir</a>
            <?php endif; ?>
        </div>
    </div>
    <?php endforeach; ?>
</div>
<?php else: ?>
<div class="no-results-box">
    <i class="fa fa-folder-open-o icon"></i>
    <p>Bu marka için henüz bir içerik eklenmemiş.</p>
</div>
<?php endif; ?>

<?php include __DIR__ . '/layout/footer.php'; ?>
