{% set image_name = page.header.image %}
{% set image = image_name ? page.media[image_name] : null %}
{% set background = page.header.background|default('white') %}
{% set layout = page.header.layout|default('text-only') %}
<section id="{{ page.header.anchor|default(page.slug)|e }}" class="module-flexible spacing-{{ page.header.spacing|default('standard')|e }} bg-{{ background|e }} layout-{{ layout|e }}{{ image ? ' has-image' : '' }}">
    <div class="module-flexible-inner">
        <div class="module-flexible-content">
            {% if page.header.eyebrow %}<p class="module-eyebrow">{{ page.header.eyebrow|e }}</p>{% endif %}
            {% if page.header.heading %}<h2>{{ page.header.heading|e }}</h2>{% endif %}
            <div class="module-richtext">{{ page.content|raw }}</div>
            {% if page.header.button_label and page.header.button_url %}<a class="btn btn-primary" href="{{ page.header.button_url|e }}">{{ page.header.button_label|e }}</a>{% endif %}
        </div>
        {% if image %}<div class="module-flexible-media">{{ image.html(page.header.image_alt|default(''), page.header.image_alt|default(''), 'loading="lazy"')|raw }}</div>{% endif %}
    </div>
</section>