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

if ($numeric_list_items) { ?>
  <section <?= inoby_block_attrs($attributes, ["class" => "numeric-list"]) ?>>
    <div class="container">
      <div class="row">
        <div class="col-12">
          <div class="numeric-list-wrap">
            <?php
            $index = 1;
            foreach ($numeric_list_items as $item):
            ?>
              <div class="numeric-list-item">
                <div class="number">
                  <?php
                  if (isset($item["rewrite_number"]) && !empty($item["rewrite_number"])) {
                    echo '<span class="rewrite-number">' . esc_html($item["rewrite_number"]) . '</span>';
                  } else {
                    echo str_pad($index, 2, "0", STR_PAD_LEFT);
                  }
                  ?>
                </div>
                <div class="content">
                  <?php
                  echo isset($item["content"]) ? $item["content"] : "";
                  $index = $index + 1;
                  ?>
                </div>
              </div>
            <?php endforeach; ?>
          </div>
        </div>
      </div>
    </div>
  </section>
<?php } ?>