@php
    $testimonialItems = [];
    if (!empty($items)) {
        $decoded = json_decode($items, true);
        if (is_array($decoded)) $testimonialItems = $decoded;
    }
    // Fallback: single testimonial dari field lama
    if (empty($testimonialItems) && !empty($quote)) {
        $testimonialItems = [['quote' => $quote, 'author' => $author ?? '', 'role' => $role ?? '']];
    }
@endphp
@php $fw = $full_width ?? false; @endphp
@if(count($testimonialItems))
<section class="bg-indigo-50 py-16">
    <div class="{{ $fw ? 'px-0' : 'max-w-5xl mx-auto px-4 sm:px-6' }}">
        <div class="grid grid-cols-1 {{ count($testimonialItems) > 1 ? 'md:grid-cols-2' : '' }} gap-6">
            @foreach($testimonialItems as $item)
            @if(!empty($item['quote']))
            <div class="bg-white rounded-2xl p-8 shadow-sm">
                <svg class="w-8 h-8 text-indigo-300 mb-4" fill="currentColor" viewBox="0 0 24 24">
                    <path d="M14.017 21v-7.391c0-5.704 3.731-9.57 8.983-10.609l.995 2.151c-2.432.917-3.995 3.638-3.995 5.849h4v10h-9.983zm-14.017 0v-7.391c0-5.704 3.748-9.57 9-10.609l.996 2.151c-2.433.917-3.996 3.638-3.996 5.849h3.983v10h-9.983z"/>
                </svg>
                <blockquote class="text-gray-800 font-medium leading-relaxed mb-6 italic">
                    "{{ $item['quote'] }}"
                </blockquote>
                @if(!empty($item['author']))
                <div class="flex items-center gap-3">
                    <div class="w-10 h-10 rounded-full bg-indigo-200 flex items-center justify-center text-indigo-700 font-bold text-sm">
                        {{ substr($item['author'], 0, 1) }}
                    </div>
                    <div>
                        <p class="font-semibold text-gray-900 text-sm">{{ $item['author'] }}</p>
                        @if(!empty($item['role']))
                        <p class="text-xs text-gray-500">{{ $item['role'] }}</p>
                        @endif
                    </div>
                </div>
                @endif
            </div>
            @endif
            @endforeach
        </div>
    </div>
</section>
@endif
