<?php require_once __DIR__ . '/includes/bootstrap.php'; define('PRESTIGE_FRONTEND', true); $slug = slugify($_GET['slug'] ?? ''); $project = db()->fetchOne("SELECT * FROM projects WHERE slug = ? AND status = 'published'", [$slug]); if (!$project) { http_response_code(404); $meta_title = 'Project Not Found - ' . setting('site_name'); $meta_description = ''; include __DIR__ . '/includes/theme_header.php'; ?> <section class="page-hero"> <div class="container page-hero-content"> <div class="page-hero-eyebrow"> Projects</div> <h1 class="page-hero-title">Project not<br><em>found.</em></h1> <p class="page-hero-sub">The project you are looking for is no longer available.</p> </div> </section> <?php include __DIR__ . '/includes/theme_footer.php'; ?> <?php exit; } $meta_title = ($project['meta_title'] ?? '') ?: ($project['title'] . ' - ' . setting('site_name')); $meta_description = ($project['meta_description'] ?? '') ?: ($project['short_description'] ?: 'Selected aluminium fabrication project by ' . setting('site_name') . '.'); $og_image = ($project['og_image'] ?? '') ?: ($project['featured_image'] ? (strpos($project['featured_image'], '/') !== false ? $project['featured_image'] : 'projects/' . $project['featured_image']) : setting('og_image')); $image = $project['featured_image'] ? project_image_url($project['featured_image']) : 'https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?w=1200&q=85'; $related = db()->fetchAll( "SELECT slug, title, category, location, year, featured_image FROM projects WHERE status = 'published' AND id != ? AND category = ? ORDER BY is_featured DESC, sort_order, created_at DESC LIMIT 3", [$project['id'], $project['category']] ); include __DIR__ . '/includes/theme_header.php'; ?> <section class="page-hero"> <div class="container page-hero-content"> <div class="page-hero-eyebrow"> <?= e($project['category'] ?: 'Project') ?></div> <h1 class="page-hero-title"><?= e($project['title']) ?></h1> <?php if ($project['short_description']): ?> <p class="page-hero-sub"><?= e($project['short_description']) ?></p> <?php endif; ?> </div> </section> <section class="page-content"> <div class="container"> <div class="page-content-inner"> <img src="<?= e($image) ?>" alt="<?= e($project['title']) ?>" loading="lazy"> <p class="eyebrow"> <?= e($project['location'] ?: 'Quebec') ?> <?php if ($project['year']): ?> · <?= e($project['year']) ?><?php endif; ?> <?php if ($project['client']): ?> · <?= e($project['client']) ?><?php endif; ?> </p> <?php if ($project['description']): ?> <?= safe_html($project['description']) ?> <?php elseif ($project['short_description']): ?> <p><?= e($project['short_description']) ?></p> <?php endif; ?> <p> <a href="<?= url('request-quote') ?>" class="btn btn-dark"> Plan a similar project <span class="btn-arrow">’!</span> </a> </p> </div> </div> </section> <?php if (!empty($related)): ?> <section class="section projects-grid-page" style="background:var(--bone);"> <div class="container"> <div class="section-header reveal"> <div class="section-meta"> <span class="section-index"> More</span> <span class="section-label-text">Related Work</span> </div> <h2 class="section-title">More selected<br><em>projects.</em></h2> </div> <div class="projects-grid reveal"> <?php foreach ($related as $pr): $img = $pr['featured_image'] ? project_image_url($pr['featured_image']) : 'https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?w=1200&q=85'; ?> <a href="<?= url('projects/' . e($pr['slug'])) ?>" class="project-card"> <div class="project-media"> <img src="<?= e($img) ?>" alt="<?= e($pr['title']) ?>" loading="lazy"> <?php if ($pr['category']): ?><div class="project-tag"><?= e($pr['category']) ?></div><?php endif; ?> </div> <div class="project-info"> <div> <h3 class="project-title"><?= e($pr['title']) ?></h3> <div class="project-location"><?= e($pr['location']) ?></div> </div> <div class="project-year"><?= e($pr['year']) ?></div> </div> </a> <?php endforeach; ?> </div> </div> </section> <?php endif; ?> <section class="final-cta"> <div class="final-cta-inner reveal"> <div class="final-eyebrow"> Your Project Next</div> <h2 class="final-title">Ready to add yours<br><em>to this list?</em></h2> <div class="final-row"> <p class="final-description">Every project starts with a conversation. Tell us what you're building.</p> <div class="final-actions"> <a href="<?= url('request-quote') ?>" class="btn btn-final-primary">Request a Quote <span class="btn-arrow">’!</span></a> </div> </div> </div> </section> <?php include __DIR__ . '/includes/theme_footer.php'; ?>