{% set container_type = container_type|default('container mx-auto') %}

{% set grid_cols = grid_cols|default(12) %}
{% set grid_cols_2xl = grid_cols_2xl|default(12) %}
{% set grid_cols_xl = grid_cols_xl|default(12) %}
{% set grid_cols_lg = grid_cols_lg|default(12) %}
{% set grid_cols_md = grid_cols_md|default(12) %}
{% set grid_cols_sm = grid_cols_sm|default(12) %}
{% set grid_classes = ['grid', grid_cols ? 'grid-cols-' ~ grid_cols, grid_cols_2xl ? '2xl:grid-cols-' ~ grid_cols_2xl, grid_cols_xl ? 'xl:grid-cols-' ~ grid_cols_xl, grid_cols_lg ? 'lg:grid-cols-' ~ grid_cols_lg, grid_cols_md ? 'md:grid-cols-' ~ grid_cols_md, grid_cols_sm ? 'sm:grid-cols-' ~ grid_cols_sm] %}
{% set grid_classes_attributes = create_attribute().addClass(grid_classes) %}

{% set col_span = col_span|default(12) %}
{% set col_span_2xl = col_span_2xl|default(12) %}
{% set col_span_xl = col_span_xl|default(12) %}
{% set col_span_lg = col_span_lg|default(12) %}
{% set col_span_md = col_span_md|default(12) %}
{% set col_span_sm = col_span_sm|default(12) %}
{% set col_first_classes = [col_span ? 'col-span-' ~ col_span, col_start ? 'col-start-' ~ col_start, col_span_2xl ? '2xl:col-span-' ~ col_span_2xl, col_start_2xl ? '2xl:col-start-' ~ col_start_2xl, col_span_xl ? 'xl:col-span-' ~ col_span_xl, col_start_xl ? 'xl:col-start-' ~ col_start_xl, col_span_lg ? 'lg:col-span-' ~ col_span_lg, col_start_lg ? 'lg:col-start-' ~ col_start_lg, col_span_md ? 'md:col-span-' ~ col_span_md, col_start_md ? 'md:col-start-' ~ col_start_md, col_span_sm ? 'sm:col-span-' ~ col_span_sm, col_start_sm ? 'sm:col-start-' ~ col_start_sm] %}
{% set col_first_attributes = create_attribute().addClass(col_first_classes) %}

{% set attributes = attributes.addClass(background_size, background_position, background_repeat) %}

{% if background_image %}
  {% set attributes = attributes.setAttribute('style', 'background-image: url(' ~ background_image ~ ')') %}
{% endif %}

<section {{ attributes.addClass(container_type != 'bg-breakout' ? grid_classes, container_type) }} >
{% if container_type == 'bg-breakout' %}
  <div {{ grid_classes_attributes.addClass('container', 'mx-auto') }} >
{% endif %}
  <div {{ col_first_attributes }}>
    {{ col_first }}
  </div>
{% if container_type == 'bg-breakout' %}
  </div>
{% endif %}
</section>
