<?php
$wrapper_width = get_sub_field('wrapper_width');
$title = get_sub_field('title');
$content = get_sub_field('content');
$link = get_sub_field('link');
?>

<div class="layout-columns" id="flex-section-<?php echo get_row_index();?>">
  <?php if($wrapper_width != 'full') echo "<div class='container {$wrapper_width}'>"; ?>
    <?php if($title) echo "<h3 class='layout-title'><span>{$title}</span></h3>"; ?>
    <div class="row row-padding">
      <div class="col-1-1">
        <div class="block-content">
          <?= $content ?>
        </div><!--content-->
        <?php if($link) echo '<div class="link-wrapper text-center"><a class="btn btn-primary boxed" href="'.$link['url'].'" target="'.$link['target'].'"><span>'.$link['title'].'</span></a></div>';?>
      </div><!--col-->
    </div><!--row-->
  <?php if($wrapper_width != 'full') echo "</div>"; ?>
</div>
