<?php
$_index = isset($index) && $index >= 0 ? $index : $block->id();
$_as_group = isset($as_group) ? $as_group : false;
$_parentid = isset($parentid) ? '-' . $parentid : $block->id();
?>

<div class="acc-el">
  <?php if ($_as_group) : ?>
    <?php if ($block->summary()->isNotEmpty()) : ?>
      <input type="radio" id="accrad-<?= $_index ?>" name="accordion" />
      <label class="acc-item" for="accrad-<?= $_index ?>">
        <div class="acc-title">
          <?= $block->summary() ?>
        </div>
        <div class="acc-content">
          <?= $block->details() ?>
        </div>
      </label>
    <?php endif; ?>
  <?php else : ?>
    <?php if ($block->summary()->isNotEmpty()) : ?>
      <input type="checkbox" id="accchk-<?= $_index ?>" name="accordion" />
      <label class="acc-item" for="accchk-<?= $_index ?>">
        <div class="acc-title">
          <?= $block->summary() ?>
        </div>
        <div class="acc-content">
          <?= $block->details() ?>
        </div>
      </label>
    <?php endif; ?>
  <?php endif ?>
</div>