{{ 'section-banner-v4.css' | asset_url | stylesheet_tag }}

{%- if section.settings.reverse -%}
  {%- assign order = 1 -%}
  {%- assign reversed = true -%}
  {% comment %} {%- assign percent-width = 45 -%} {% endcomment %}
{%- else -%}
  {%- assign order = 0 -%}
  {% comment %} {%- assign percent-width = 55 -%} {% endcomment %}
{%- endif -%}

<div
  {% render 'section-attr' %}
>
  {% render 'section-bg-image' %}
  <xo-container
    {% render 'section-layout' %}
  >
    <xo-animate xo-cascade>
      <xo-grid style="--xs: 1; --sm: 2; --xl: 3; --xo-grid-col-gap: 0; --xo-grid-row-gap: 0">
        {%- for block in section.blocks -%}
          <div class="banner-v4">
            <div class="banner-v4__image">
              {%- render 'image', image: block.settings.image -%}
            </div>
            <div class="banner-v4__title">
              {{ block.settings.title }}
            </div>
            <div class="banner-v4__content">
              {{ block.settings.content }}
            </div>
          </div>
          {% endfor %}
      </xo-grid>
    </xo-animate>
  </xo-container>
</div>

{% schema %}
{
  "name": "t:sections.banner_v4.name",
  "settings": [
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.all.width.label",
      "default": "box",
      "options": [
        {
          "value": "box",
          "label": "t:sections.all.width.options__1.label"
        },
        {
          "value": "wide",
          "label": "t:sections.all.width.options__2.label"
        },
        {
          "value": "fullwidth",
          "label": "t:sections.all.width.options__3.label"
        }
      ]
    },
    {
      "type": "header",
      "content": "t:sections.all.heading.content"
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.color_scheme.label"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:sections.all.bg_color.label"
    },
    {
      "type": "color_background",
      "id": "background_gradient",
      "label": "t:sections.all.bg_gradient.label"
    },
    {
      "type": "image_picker",
      "id": "background_image_desktop",
      "label": "t:sections.all.background_image_desktop.label"
    },
    {
      "type": "image_picker",
      "id": "background_image_mobile",
      "label": "t:sections.all.background_image_mobile.label"
    },
    {
      "type": "checkbox",
      "id": "use_parallax",
      "label": "t:sections.all.use_parallax.label",
      "default": true
    },
    {
      "type": "number",
      "id": "padding_top",
      "label": "t:sections.all.padding_top.label",
      "default": 50
    },
    {
      "type": "number",
      "id": "padding_bottom",
      "label": "t:sections.all.padding_bottom.label",
      "default": 50
    }
  ],
  "blocks": [
    {
      "type": "review",
      "name": "banner",
      "limit": 6,
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.banner_v4.blocks.settings.image.label",
          "info": "Support jpg, jpeg, png, svg"
        },
        {
          "type": "text",
          "id": "title",
          "label": "t:sections.banner_v4.blocks.settings.title.label"
        },
        {
          "type": "text",
          "id": "content",
          "label": "t:sections.banner_v4.blocks.settings.content.label"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_v4.presets.name"
    }
  ]
}
{% endschema %}
