@php $style = $data['style'] ?? 'mosaic'; $items = array_values(array_filter($data['items'] ?? [], fn ($i) => filled($i['title'] ?? null) || filled($i['description'] ?? null))); $image = $style === 'spotlight' ? '' : $url($data['image'] ?? null); $split = $image !== ''; $order = ($data['image_side'] ?? 'right') === 'left' ? ['media', 'copy'] : ['copy', 'media']; $footer = filled($data['footer_text'] ?? null) ? ['text' => $data['footer_text'], 'url' => $href($data['footer_url'] ?? null, '#')] : null; @endphp @if($style === 'spotlight')
@include('builder.partials.head', ['centered' => true, 'linkUrl' => null, 'linkText' => null]) @if($footer) @endif
@else @php $listClass = match ($style) { 'quotes' => 'detail-challenges', 'benefits' => 'home-benefit-grid', default => $split ? 'detail-mosaic detail-mosaic--stack' : 'detail-mosaic', }; @endphp
@if($split)
@foreach($order as $column) @if($column === 'media')
{{ ($data['image_alt'] ?? '') ?: ($data['title'] ?? '') }} @if(filled($data['image_caption'] ?? null))
{{ $data['image_caption'] }}
@endif
@else
@include('builder.partials.head', ['centered' => false, 'linkUrl' => null, 'linkText' => null]) @include('builder.blocks.partials.card-list', ['listClass' => $listClass.' mt-10'])
@endif @endforeach
@else @include('builder.partials.head', ['centered' => true, 'linkUrl' => null, 'linkText' => null]) @include('builder.blocks.partials.card-list', ['listClass' => $listClass.' mt-12']) @endif @if($footer) @endif
@endif