@php
    $width = match ($block->get('max_width', 'lg')) {
        'sm' => 'max-w-3xl', 'md' => 'max-w-5xl', 'lg' => 'max-w-7xl',
        'xl' => 'max-w-[90rem]', 'full' => 'max-w-none', default => 'max-w-7xl',
    };
    if ($variant === 'full_bleed') $width = 'max-w-none';
    if ($variant === 'narrow') $width = 'max-w-3xl';
    $align = $block->get('header_align', 'center');
    $alignClass = ['start' => 'text-start', 'center' => 'text-center mx-auto', 'end' => 'text-end ms-auto'][$align] ?? 'text-center mx-auto';
@endphp
<div class="{{ $width }} mx-auto px-4 sm:px-6 lg:px-8">
    @if ($block->get('eyebrow') || $block->get('title') || $block->get('subtitle'))
        <header class="{{ $alignClass }} max-w-3xl mb-10">
            @if ($block->get('eyebrow'))
                <p class="ec-eyebrow text-sm font-semibold uppercase tracking-widest mb-3">{{ $block->get('eyebrow') }}</p>
            @endif
            @if ($block->get('title'))
                <h2 class="ec-heading text-3xl sm:text-4xl font-bold">{{ $block->get('title') }}</h2>
            @endif
            @if ($block->get('subtitle'))
                <p class="ec-muted mt-4 text-lg leading-relaxed">{{ $block->get('subtitle') }}</p>
            @endif
        </header>
    @endif
    {!! $renderer->renderChildren($block, 'default', $ctx) !!}
</div>
