<?php
require_once __DIR__ . '/includes/functions.php';
require_once __DIR__ . '/includes/blog_posts.php';
startSecureSession();
$posts = ah_all_posts();
$pageTitle = 'Blog - UPI Payment Guides for Creators & Developers';
$metaDesc  = 'Learn how to accept UPI payments online: FamPay API guides, UPI QR tutorials, payment gateway comparisons and troubleshooting for Indian creators and developers.';
$navActive = 'blog';
$schemaOrg = '<script type="application/ld+json">
{"@context":"https://schema.org","@type":"Blog","name":"AdityaHost Blog","url":"' . htmlspecialchars(getBaseUrl()) . '/blog.php","description":"' . $metaDesc . '"}
</script>';
include __DIR__ . '/includes/public_header.php';
?>

<section class="page-hero">
  <div class="wrap">
    <div class="crumb" style="color:#8ab0ff">AdityaHost Blog</div>
    <h1>Guides for creators, bot owners &amp; developers</h1>
    <p>Practical, step-by-step tutorials on accepting UPI payments in India — no jargon, no fluff.</p>
  </div>
</section>

<section class="section">
  <div class="wrap">
    <?php foreach (array_chunk($posts, 3) as $row): ?>
    <div class="blog-grid" style="margin-top:0;margin-bottom:34px">
      <?php foreach ($row as $bp): ?>
      <a class="blog-card" href="blog-post.php?slug=<?= $bp['slug'] ?>">
        <div class="blog-cover"><?= ah_cover($bp) ?><span class="blog-cat"><?= htmlspecialchars($bp['category']) ?></span></div>
        <div class="blog-body">
          <div class="blog-meta"><span><?= date('M j, Y', strtotime($bp['date'])) ?></span><span class="sep"></span><span><?= $bp['readMins'] ?> min read</span></div>
          <h3><?= htmlspecialchars($bp['title']) ?></h3>
          <p class="blog-ex"><?= htmlspecialchars($bp['metaDesc']) ?></p>
          <span class="blog-read">Read guide <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg></span>
        </div>
      </a>
      <?php endforeach; ?>
    </div>
    <?php endforeach; ?>
  </div>
</section>

<section class="section section-dark">
  <div class="wrap center">
    <h2 class="section-title">Have a payment question we haven&rsquo;t covered?</h2>
    <p class="section-sub" style="color:var(--on-dark-soft);margin:0 auto 30px">Our team replies within a few hours.</p>
    <a href="contact.php" class="btn btn-light btn-lg">Contact support</a>
  </div>
</section>

<?php include __DIR__ . '/includes/public_footer.php'; ?>