@props([ 'items' => [], 'title' => null, 'eyebrow' => null, ]) @php $faqs = collect($items) ->filter(fn ($item): bool => filled(data_get($item, 'question')) && filled(data_get($item, 'answer'))) ->values(); // Unique prefix so multiple FAQ blocks on one page keep their ARIA wiring // (aria-controls / aria-labelledby) valid. $faqUid = \Illuminate\Support\Str::lower(\Illuminate\Support\Str::random(6)); @endphp @if ($faqs->isNotEmpty())
merge(['class' => '']) }} data-faq> @if (filled($eyebrow))

{{ $eyebrow }}

@endif @if (filled($title))

{{ $title }}

@endif
@foreach ($faqs as $faq) @php $itemId = 'faq-'.$faqUid.'-'.$loop->index; $panelId = $itemId.'-panel'; @endphp
{{-- Smooth height: the animated grid track goes 0fr → 1fr so the answer expands and collapses without measuring heights. The shared duration tokens neutralize it under reduced motion. --}}
{{ $faq['answer'] }}
@endforeach
@endif