<?php $collection = cms_collection($module['collection'] ?? 'faq'); ?>
<section class="section" id="<?= e($module['anchor'] ?? 'faq') ?>">
  <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="faq-grid">
      <?php foreach (($collection['items'] ?? []) as $index => $item): ?>
        <details class="faq-card" <?= $index === 0 ? 'open' : '' ?>>
          <summary>
            <span><?= e($item['question'] ?? '') ?></span>
            <i></i>
          </summary>
          <div class="faq-card__answer"><?= nl2br(e($item['answer'] ?? '')) ?></div>
        </details>
      <?php endforeach; ?>
    </div>
  </div>
</section>
