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

<div class="layout-valuta-grid" id="flex-section-<?php echo get_row_index();?>" >
  <h4 class="layout-title"><span><?= $title ?></span></h4>
  <div class="layout-content"><?= $content ?></div>

  <?php if( have_rows('grid') ): ?>

  	<div class="grid-valuta">

  	<?php while( have_rows('grid') ): the_row();

  		// vars
  		$image = get_sub_field('image');
  		$content = get_sub_field('txt');
  		$sub_content = get_sub_field('sub_txt');

  		?>

  		<div class="grid-el el-<?php echo get_row_index();?>" data-mh>
        <div class="el--inner">
    			<img class="" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" />
    		   <?php echo '<h5>'.$content.'</h5>'; ?>
    		   <?php echo '<h6>'.$sub_content.'</h6>'; ?>
        </div>
  		</div>

  	<?php endwhile; ?>

  </div>

  <?php endif; ?>
</div>
