<?php
$currentPage = 'about';
require __DIR__ . '/_includes/db_connect.php';

$site = getSiteSettings();
$page = getPageContent('about');

$pageTitle = ($page['page_title'] ?? 'About School') . ' - ' . ($site['school_name'] ?? '');
$metaDescription = $page['meta_description'] ?? '';
require __DIR__ . '/_includes/header.php';
?>

  <!-- Page Header -->
  <section class="page-header">
    <div class="container">
      <h1><?= e($page['section1_heading'] ?? 'About School') ?></h1>
      <div class="breadcrumb">
        <a href="index.php">Home</a> / About School
      </div>
    </div>
  </section>

  <!-- Content -->
  <section class="section">
    <div class="container">
      <div class="two-col">
        <div>
          <?= raw($page['section1_content'] ?? '') ?>
        </div>
        <div class="placeholder-img placeholder-img--hero">
          <?php if (!empty($page['section1_video_url'])): ?>
          <?= renderVideo($page['section1_video_url']) ?>
          <?php elseif (!empty($page['section1_image_url'])): ?>
          <img src="<?= e($page['section1_image_url']) ?>" alt="<?= e($page['section1_image_alt'] ?? '') ?>" style="width:100%;height:100%;object-fit:cover;">
          <?php else: ?>
          [<?= e($page['section1_image_alt'] ?? 'School Campus Image') ?>]
          <?php endif; ?>
        </div>
      </div>
    </div>
  </section>

  <!-- Mission Section -->
  <?php if (!empty($page['section2_heading']) || !empty($page['section2_content'])): ?>
  <section class="section section--alt">
    <div class="container">
      <h2 class="section-title"><?= e($page['section2_heading'] ?? '') ?></h2>
      <div class="text-center" style="max-width: 700px; margin: 0 auto;">
        <?= raw($page['section2_content'] ?? '') ?>
        <?php if (!empty($page['section2_video_url'])): ?>
        <div style="margin-top: 1.5rem;">
          <?= renderVideo($page['section2_video_url']) ?>
        </div>
        <?php endif; ?>
      </div>
    </div>
  </section>
  <?php endif; ?>

  <!-- Values Section -->
  <?php if (!empty($page['section3_heading']) || !empty($page['section3_content'])): ?>
  <section class="section">
    <div class="container">
      <h2 class="section-title"><?= e($page['section3_heading'] ?? '') ?></h2>
      <?= raw($page['section3_content'] ?? '') ?>
    </div>
  </section>
  <?php endif; ?>

<?php require __DIR__ . '/_includes/footer.php'; ?>
