<div class="row">
<?php
$i = 0;
$items = [ 1, 2, 3, 4, 5, 6 ];
foreach ( $items as $item ) :
?>
<div class="item<?php echo( $i === 0 ? ' item--red' : null ); ?>">1</div>
<div class="item">2</div>
<div class="item">3</div>
<?php
$i = $i === 2 ? 0 : $i ++;
endforeach;
?>
</div>
.row {
display: grid;
grid-template-columns: repeat(3, 40% 30% 30%);