<?php
require_once __DIR__ . '/includes/functions.php';
$slug = $_GET['slug'] ?? '';
$post = findBySlug(getBlogPosts(), $slug) ?? getBlogPosts()[0];
$meta = pageMeta(['title' => $post['seo_title'], 'description' => $post['seo_description'], 'keywords' => $post['seo_keywords'], 'image' => url(blogVisual($post)), 'canonical' => blogUrl($post['slug'])]);
require __DIR__ . '/includes/header.php';
?>
<article class="blog-detail">
    <header class="page-hero compact"><div><span class="eyebrow">ASSK Blog | 4 dk okuma</span><h1><?= e($post['title']) ?></h1><p><?= e($post['excerpt']) ?></p><time><?= e(date('d.m.Y', strtotime($post['created_at'] ?? 'now'))) ?></time></div></header>
    <div class="article-shell">
        <div>
            <img class="detail-image" src="<?= e(url(blogVisual($post))) ?>" alt="<?= e($post['title']) ?>" loading="eager">
            <div class="article-body"><?= $post['content'] ?></div>
        </div>
        <aside class="article-side glass-card">
            <span class="eyebrow">Hemen bilgi alin</span>
            <h2>Size en yakın ASSK şubesini seçelim</h2>
            <p>Yaş grubu, seviye ve hedefe göre ders modelini WhatsApp üzerinden hızlıca planlayalım.</p>
            <a class="btn btn-primary" href="<?= e(CONTACT_WHATSAPP) ?>">WhatsApptan Bilgi Alin</a>
            <a class="btn btn-light" href="tel:<?= e(CONTACT_TEL) ?>">Hemen Ara</a>
        </aside>
    </div>
    <section class="section related-visuals"><div class="section-head"><span class="eyebrow">İlgili deneyimler</span><h2>ASSK ile eğitime başlamadan önce</h2></div><div class="experience-grid"><article class="experience-card"><img src="<?= e(url('assets/img/children-swimming-class.jpg')) ?>" alt="Çocuk yüzme eğitimi blog ilgili görsel" loading="lazy"><div><i class="icon-3d icon-child"></i><h3>Çocuk eğitimi</h3></div></article><article class="experience-card"><img src="<?= e(url('assets/img/private-swimming-lesson.jpg')) ?>" alt="Özel yüzme dersi blog ilgili görsel" loading="lazy"><div><i class="icon-3d icon-coach"></i><h3>Özel ders</h3></div></article><article class="experience-card"><img src="<?= e(url('assets/img/family-swimming-package.jpg')) ?>" alt="Aile yüzme paketi blog ilgili görsel" loading="lazy"><div><i class="icon-3d icon-family"></i><h3>Aile paketleri</h3></div></article></div></section>
</article>
<?php require __DIR__ . '/includes/footer.php'; ?>
