{# Grid column configurations for different layout ratios #}
{% set grid_class = {
  '100':         'cols-100',
  '50-50':       'cols-50-50',
  '33-33-33':    'cols-33-33-33',
  '75-25':       'cols-75-25',
  '25-75':       'cols-25-75',
  '67-33':       'cols-67-33',
  '33-67':       'cols-33-67',
  '50-25-25':    'cols-50-25-25',
  '25-25-50':    'cols-25-25-50',
  '25-25-25-25': 'cols-25-25-25-25',
}[columns] ?? 'cols-100' %}

<section class="section-grid">
  {% if section_header %}
    {% set header_content %}
      {% block header_slot %}
      {% endblock %}
    {% endset %}
    {% if header_content|trim is not empty %}
      <header class="section-header">
        {{ header_content }}
      </header>
    {% endif %}
  {% endif %}

  <div class="section-main {{ grid_class }}">
    {% block main_slot %}
    {% endblock %}
  </div>

  {% if section_footer %}
    {% set footer_content %}
      {% block footer_slot %}
      {% endblock %}
    {% endset %}
    {% if footer_content|trim is not empty %}
      <footer class="section-footer">
        {{ footer_content }}
      </footer>
    {% endif %}
  {% endif %}
</section>
