<?php
/*
 * 
 * Template Name: Certificações
 * 
*/
enqueue_aos();
enqueue_swiper();
get_header(); ?>

<!-- ======= CONTEÚDO ======= -->
<main role="main" class="page-certificacoes">

  <?php
  # SEÇÃO - BANNER
  get_template_part('template-parts/section', 'banner'); ?>

  <?php
  $certificacoes = o2_get_field('certificacoes');

  foreach ($certificacoes as $index => $item) : ?>
    <section class="section-certificacao <?= $index == 0 ? 'active' : ''; ?>" data-tab="<?= stringToSlug(strip_tags(($item['nome']))); ?>">
      <div class="mw-1920 mx-auto">
        <div class="container-xl">
          <div class="row flex-column-reverse flex-md-row">
            <div class="col-12 col-md-6 d-flex justify-content-center">
              <div class="img-wrapper" data-aos="zoom-in" data-aos-duration="700" data-aos-anchor-placement="top">
                <img src="<?= wp_get_attachment_url($item['imagem']); ?>" alt="<?= strip_tags($item['nome']); ?>" class="img-fluid">
              </div>
            </div>
            <div class="col-12 col-md-6">
              <div class="text-wrapper" data-aos="fade-left" data-aos-duration="600" data-aos-anchor-placement="top">
                <h2 class="font60 fw900 text-green"><?= $item['nome']; ?></h2>
                <p class="font18 text-gray font-alternates"><?= $item['descricao']; ?></p>
                <?php
                $btn = $item['arquivo'];
                if (!empty($btn)) : ?>
                  <a href="<?= wp_get_attachment_url($btn) ?>" target="_blank" aria-label="Download" class="btn-principal mt-4">
                    Download
                  </a>
                <?php
                endif; ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  <?php
  endforeach; ?>

</main>

<?php
get_footer(); ?>