<?php $__env->startSection('title', 'Home'); ?>
<?php $__env->startSection('content'); ?>

<section class="hero">
    <div class="container text-center">
        <h1>Where ideas <span class="accent">become legacy</span></h1>
        <p class="lead">A premium blog network curated by passionate authors, read by thoughtful minds.</p>
        <form action="<?php echo e(route('blogs.index')); ?>" method="GET" class="hero-search mx-auto">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search blogs, topics, authors…">
                <button class="btn">Search</button>
            </div>
        </form>
    </div>
</section>

<section class="container py-5">
    <div class="section-title">
        <div class="ornament">⊹ ⊹ ⊹</div>
        <h2>Featured Stories</h2>
        <span class="divider-gold"></span>
    </div>

    <div class="row g-4">
        <?php $__empty_1 = true; $__currentLoopData = $featured; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $blog): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <div class="col-md-4">
            <article class="blog-card">
                <a href="<?php echo e(route('blogs.show', $blog->slug)); ?>"><img src="<?php echo e($blog->featuredImageUrl()); ?>" class="blog-card-img" alt=""></a>
                <div class="blog-card-body">
                    <?php if($blog->category): ?><span class="blog-card-category"><?php echo e($blog->category->name); ?></span><?php endif; ?>
                    <h3><a href="<?php echo e(route('blogs.show', $blog->slug)); ?>"><?php echo e($blog->title); ?></a></h3>
                    <p class="text-muted"><?php echo e(\Illuminate\Support\Str::limit($blog->excerpt ?? strip_tags($blog->content), 110)); ?></p>
                    <div class="blog-card-meta">
                        <span>By <a href="<?php echo e(route('blogs.author', $blog->author->username)); ?>"><?php echo e($blog->author->name); ?></a></span>
                        <span><?php echo e($blog->readingTime()); ?> min read</span>
                    </div>
                </div>
            </article>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <div class="col-12 text-center text-muted py-5">No blogs published yet. Check back soon.</div>
        <?php endif; ?>
    </div>
</section>

<?php if($latest->isNotEmpty()): ?>
<section class="py-5" style="background: white;">
    <div class="container">
        <div class="section-title">
            <h2>Latest from the Press</h2>
            <span class="divider-gold"></span>
        </div>
        <div class="row g-4">
            <?php $__currentLoopData = $latest; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $blog): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="col-md-6 col-lg-4">
                <article class="blog-card">
                    <a href="<?php echo e(route('blogs.show', $blog->slug)); ?>"><img src="<?php echo e($blog->featuredImageUrl()); ?>" class="blog-card-img" alt=""></a>
                    <div class="blog-card-body">
                        <?php if($blog->category): ?><span class="blog-card-category"><?php echo e($blog->category->name); ?></span><?php endif; ?>
                        <h3><a href="<?php echo e(route('blogs.show', $blog->slug)); ?>"><?php echo e(\Illuminate\Support\Str::limit($blog->title, 70)); ?></a></h3>
                        <div class="blog-card-meta">
                            <span><?php echo e($blog->author->name); ?></span>
                            <span><?php echo e($blog->published_at?->diffForHumans()); ?></span>
                        </div>
                    </div>
                </article>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
        <div class="text-center mt-5"><a href="<?php echo e(route('blogs.index')); ?>" class="btn btn-primary">Browse All Blogs</a></div>
    </div>
</section>
<?php endif; ?>

<?php if($categories->isNotEmpty()): ?>
<section class="container py-5">
    <div class="section-title"><h2>Explore Topics</h2><span class="divider-gold"></span></div>
    <div class="row g-3">
        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="col-md-3 col-6">
            <a href="<?php echo e(route('blogs.category', $cat->slug)); ?>" class="d-block text-center p-4" style="background: white; border:1px solid var(--border); border-radius:6px; transition: all .2s;">
                <h4 class="mb-1"><?php echo e($cat->name); ?></h4>
                <small class="text-muted"><?php echo e($cat->blogs_count); ?> posts</small>
            </a>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</section>
<?php endif; ?>

<?php if($packages->isNotEmpty()): ?>
<section class="container py-5">
    <div class="section-title"><h2>Publish With Us</h2><p class="text-muted">Lifetime hosting. One-time fee. Your story online forever.</p><span class="divider-gold"></span></div>
    <div class="row g-4 justify-content-center">
        <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $package): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="col-md-4">
                <div class="package-card <?php echo e($package->is_featured ? 'featured' : ''); ?>">
                    <div class="package-name"><?php echo e($package->name); ?></div>
                    <div class="package-blogs"><?php echo e($package->blogs_count); ?> <?php echo e($package->blogs_count === 1 ? 'blog' : 'blogs'); ?></div>
                    <div class="package-price">$<?php echo e(number_format($package->price, 0)); ?><small>/once</small></div>
                    <a href="<?php echo e(route('packages.public')); ?>" class="btn btn-<?php echo e($package->is_featured ? 'accent' : 'outline-primary'); ?> w-100">Choose Plan</a>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</section>
<?php endif; ?>

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

<?php echo $__env->make('layouts.public', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp82\htdocs\blog\resources\views/frontend/home.blade.php ENDPATH**/ ?>