@php $split = $variant === 'split_info'; @endphp
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
    <div class="{{ $split ? 'grid md:grid-cols-2 gap-12' : 'max-w-2xl mx-auto' }}">
        <div class="flex flex-col gap-4 {{ $split ? '' : 'text-center mb-8' }}">
            @if ($block->get('eyebrow'))
                <p class="ec-eyebrow">{{ $block->get('eyebrow') }}</p>
            @endif
            @if ($block->get('title'))
                @php
                    $ruleAlign = ($block->get('header_align') ?? ($split ? 'start' : 'center')) === 'center' ? 'center' : 'start';
                    $ruleClass = $block->get('heading_rule') === 'accent_bar'
                        ? 'ec-heading-rule ec-heading-rule--'.$ruleAlign
                        : '';
                @endphp
                <h2 class="ec-heading text-3xl sm:text-4xl font-black {{ $ruleClass }}">
                    {!! website_highlight($block->get('title')) !!}
                </h2>
            @endif
            @if ($block->get('description'))
                <p class="ec-muted text-lg leading-relaxed">{{ $block->get('description') }}</p>
            @endif
            @if ($split)
                {!! $renderer->renderChildren($block, 'default', $ctx) !!}
            @endif
        </div>

        <div class="{{ $variant === 'boxed' ? 'ec-surface rounded-2xl p-8 shadow-sm' : '' }}">
            @livewire('public.website-contact-form', [
                'blockId' => $block->id,
                'showSubject' => (bool) $block->get('show_subject', true),
                'showPhone' => (bool) $block->get('show_phone', true),
                'requirePhone' => (bool) $block->get('require_phone', false),
                'submitLabel' => $block->get('submit_label'),
                'successMessage' => $block->get('success_message'),
            ], key('contact-form-' . $block->id))
        </div>
    </div>
</div>
