

<?php $__env->startSection('title', 'Artikel Edukasi - PilahPintar'); ?>

<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="text-center mb-5">
        <span class="badge bg-success bg-opacity-10 text-success font-heading px-3 py-2 rounded-pill mb-2">Bacaan Edukasi</span>
        <h2 class="fw-bold font-heading text-success">Artikel & Berita Edukasi Lingkungan 📰</h2>
        <p class="text-muted col-lg-8 mx-auto">Kumpulan panduan, tips, dan wawasan seputar pengelolaan sampah ramah lingkungan.</p>
    </div>

    <div class="row gy-4 mb-5">
        <?php $__empty_1 = true; $__currentLoopData = $articles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $article): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <div class="col-md-6 col-lg-4">
            <div class="card card-eco h-100">
                <img src="<?php echo e($article->image); ?>" class="card-img-top rounded-top-4" alt="<?php echo e($article->title); ?>" style="height: 200px; object-fit: cover;">
                <div class="card-body d-flex flex-column">
                    <div class="d-flex justify-content-between align-items-center mb-2">
                        <span class="badge bg-success"><?php echo e($article->category); ?></span>
                        <small class="text-muted"><i class="fa-regular fa-calendar me-1"></i> <?php echo e($article->created_at->format('d M Y')); ?></small>
                    </div>
                    <h5 class="fw-bold text-dark mb-2"><?php echo e($article->title); ?></h5>
                    <p class="text-muted small mb-3"><?php echo e(Str::limit($article->snippet, 110)); ?></p>
                    <div class="mt-auto">
                        <a href="<?php echo e(route('articles.show', $article->slug)); ?>" class="btn btn-outline-success btn-sm w-100 rounded-pill fw-bold">
                            Baca Selengkapnya &rarr;
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <div class="col-12 text-center py-5">
            <div class="p-4 bg-white rounded-4 shadow-sm">
                <span class="fs-1">📰</span>
                <h5 class="fw-bold mt-2">Belum Ada Artikel</h5>
                <p class="text-muted">Artikel edukasi akan ditambahkan oleh Admin.</p>
            </div>
        </div>
        <?php endif; ?>
    </div>

    <div class="d-flex justify-content-center">
        <?php echo e($articles->links()); ?>

    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\ProkerKKN\resources\views/articles/index.blade.php ENDPATH**/ ?>