<?php
/**
 * Page liste des projets
 */

$pageTitle = 'Mes Projets';
$pageDescription = 'Découvrez mes réalisations web : sites vitrines, e-commerce, applications et plus encore.';
$currentPage = 'projets';

$featuredProjects = getProjectsByCategory('vedette');
$secondaryProjects = getProjectsByCategory('secondaire');

include_template('header', compact('pageTitle', 'pageDescription'));
include_template('navbar', compact('currentPage'));
?>

<main>
    <!-- Header de page -->
    <section class="section">
        <div class="container-content">
            <div class="section-header">
                <h1 class="section-title">Mes Projets</h1>
                <p class="section-subtitle">
                    Découvrez les réalisations qui illustrent mon travail et mes compétences.
                </p>
            </div>

            <!-- Grille des projets vedettes -->
            <?php if (!empty($featuredProjects)): ?>
                <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-8">
                    <?php foreach ($featuredProjects as $project): ?>
                        <?php include_template('project-card', ['project' => $project]); ?>
                    <?php endforeach; ?>
                </div>
            <?php else: ?>
                <p class="text-center text-text-secondary py-12">
                    Projets à venir...
                </p>
            <?php endif; ?>
        </div>
    </section>

    <!-- Section projets secondaires -->
    <?php if (!empty($secondaryProjects)): ?>
        <section class="section pt-0">
            <div class="container-content">
                <hr class="border-border mb-12">

                <h2 class="text-xl lg:text-heading font-semibold text-text-primary mb-8">Autres projets</h2>

                <div class="space-y-4">
                    <?php foreach ($secondaryProjects as $project): ?>
                        <?php include_template('project-card-compact', ['project' => $project]); ?>
                    <?php endforeach; ?>
                </div>
            </div>
        </section>
    <?php endif; ?>
</main>

<?php include_template('footer'); ?>
