<section class="section section--muted" id="<?= e($module['anchor'] ?? 'video') ?>">
  <div class="container">
    <div class="section-heading">
      <div class="eyebrow"><?= e($module['eyebrow'] ?? '') ?></div>
      <h2><?= e($module['title'] ?? '') ?></h2>
      <p><?= e($module['text'] ?? '') ?></p>
    </div>
    <div class="video-card">
      <?php $videoUrl = (string)($module['video_url'] ?? ''); ?>
      <?php if (preg_match('~\.(mp4|webm)$~i', $videoUrl)): ?>
        <video class="video-card__media" controls playsinline preload="metadata" poster="<?= e($module['image'] ?? '') ?>">
          <source src="<?= e($videoUrl) ?>">
        </video>
      <?php elseif ($videoUrl !== ''): ?>
        <iframe class="video-card__media" src="<?= e($videoUrl) ?>" title="<?= e($module['title'] ?? 'Видео') ?>" loading="lazy" allowfullscreen></iframe>
      <?php else: ?>
        <div class="card">Видео пока не добавлено.</div>
      <?php endif; ?>
    </div>
  </div>
</section>
