<?= $this->extend('layouts/main') ?>
<?= $this->section('content') ?>

<div class="hero text-center">
    <div class="container">
        <h1 class="display-5 fw-bold">Find your next hire. Or your next job.</h1>
        <p class="lead mb-4">One platform for agencies and candidates — powered by a smarter ATS.</p>
        <a href="<?= base_url('register') ?>" class="btn btn-light btn-lg me-2">Get Started Free</a>
        <a href="<?= base_url('jobs') ?>" class="btn btn-outline-light btn-lg">Browse Jobs</a>
    </div>
</div>

<div class="container my-5">
    <h4 class="mb-4">Recent job openings</h4>
    <div class="row g-4">
        <?php if (empty($jobs)): ?>
            <p class="text-muted">No jobs published yet.</p>
        <?php endif; ?>
        <?php foreach ($jobs as $job): ?>
            <div class="col-md-4">
                <div class="card h-100 shadow-sm">
                    <div class="card-body">
                        <h6 class="card-title"><?= esc($job['title']) ?></h6>
                        <p class="text-muted small mb-2"><?= esc($job['location'] ?? 'Remote') ?> · <?= esc(str_replace('_', ' ', $job['employment_type'])) ?></p>
                        <a href="<?= base_url('jobs') ?>/<?= esc($job['seo_slug']) ?>" class="btn btn-sm btn-outline-primary">View Job</a>
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
</div>

<?= $this->endSection() ?>
