<?php
$navigation = mb_get_block_field("navigation") ?? "";

if ($navigation) { ?>
<section <?= inoby_block_attrs($attributes, ["class" => "navigation"]) ?>>
  <div class="container">
    <div class="row">
      <div class="col-12 navigation-wrap">
        <?php foreach ($navigation as $nav) {
          echo '<div class="navigation-column">';
          $nav_headline = $nav["headline"] ?? "";
          $nav_navigation = $nav["navigation"] ?? "";
          if ($nav_headline) {
            echo "<h3>" . $nav_headline . "</h3>";
          }
          echo "<ul>";
          foreach ($nav_navigation as $item) {
            $item_text = $item[0] ?? "";
            $item_link = $item[1] ?? "";
            echo '<li><a href="' . $item_link . '">' . $item_text . "</a></li>";
          }
          echo "</ul>";
          echo "</div>";
        } ?>
      </div>
    </div>
  </div>
</section>
<?php }
