<?php
$center = $s['align'] === 'center';
$size = ['md' => 'text-3xl', 'lg' => 'text-4xl sm:text-5xl', 'xl' => 'text-5xl sm:text-7xl'][$s['size']] ?? 'text-4xl sm:text-5xl';
?>
<div class="<?= $center ? 'mx-auto max-w-3xl text-center' : 'max-w-3xl' ?>">
    <?php if ($s['eyebrow']): ?><p class="eyebrow"><?= e($s['eyebrow']) ?></p><?php endif ?>
    <?php if ($s['title']): ?><h2 class="heading mt-4 <?= $size ?> <?= heading_weight_class() ?> leading-tight text-balance"><?= e($s['title']) ?></h2><?php endif ?>
    <?php if ($s['content']): ?>
        <div class="rich mt-6 text-lg leading-8 text-zinc-600"><?php foreach (preg_split('/\n\s*\n/', $s['content']) as $paragraph): ?><p><?= nl2br(e($paragraph)) ?></p><?php endforeach ?></div>
    <?php endif ?>
    <?php if ($s['button_text']): ?>
        <a href="<?= e(section_link($s['link'])) ?>" class="btn-primary mt-8"><?= e($s['button_text']) ?><?= icon('arrow', 'size-4', '2') ?></a>
    <?php endif ?>
</div>
