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

<div {% render 'section-attr' %}>
  <xo-container {% render 'section-layout' %}>
    <xo-grid class='banner-v3__grid' style='--xo-grid-col-gap: {{section.settings.gap}}px; --xo-grid-row-gap: {{section.settings.gap}}px'>
      {% for block in section.blocks %}
        <div class='banner-v3__item' style='--sm:12; --md: 12; --lg: 4;'>
          <div href='{{ block.settings.button_link }}' class='banner-v3__img'>
            {%- render 'image', image: block.settings.img -%}
            <a href='{{ section.settings.button_link }}' class='banner-v3__overlay'></a>
            <div class='banner-v3__content'>
              {%- if block.settings.icon -%}
                <div class='banner-v3__icon'>
                  {%- render 'image', image: block.settings.icon -%}
                </div>
              {%- endif -%}
              {%- if block.settings.title -%}
                <div class='banner-v3__title'>
                  {{ block.settings.title }}
                </div>
              {%- endif -%}
              {%- if block.settings.desc -%}
                <div class='banner-v3__desc'>
                  {{ block.settings.desc }}
                </div>
              {%- endif -%}
            </div>
            {%- if block.settings.button_text -%}
              <div class='banner-v3__button'>
                <a href='{{ block.settings.button_link }}' class='banner-v3__link'>
                  <span>{{ block.settings.button_text }}</span>
                  <svg width='15px' height='10px' viewBox='0 0 13 10'>
                    <path d="M1,5 L11,5"></path>
                    <polyline points="8 1 12 5 8 9"></polyline>
                  </svg>
                </a>
              </div>
            {%- endif -%}
          </div>
        </div>
      {% endfor %}
    </xo-grid>
  </xo-container>
</div>

{% schema %}
{
  "name": "t:sections.banner_v3.name",
  "tag": "section",
  "class": "section",
  "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": "Banner setting"
    },
    {
      "type": "range",
      "id": "gap",
      "min": 0,
      "max": 80,
      "step": 1,
      "unit": "px",
      "label": "t:sections.banner_v3.settings.gap.label",
      "default": 0
    },
    {
      "type": "select",
      "id": "hover",
      "label": "t:sections.all.hover.label",
      "default": "hover1",
      "options": [
        {
          "value": "hover1",
          "label": "t:sections.all.hover.option__1.label"
        },
        {
          "value": "hover2",
          "label": "Style 02"
        },
        {
          "value": "hover3",
          "label": "Style 03"
        },
        {
          "value": "hover4",
          "label": "Style 04"
        },
        {
          "value": "hover5",
          "label": "Style 05"
        },
        {
          "value": "hover6",
          "label": "Style 06"
        }
      ]
    },
    {
      "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": "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": "item",
      "name": "t:sections.banner_v3.settings.item.label",
      "settings": [
        {
          "type": "image_picker",
          "id": "img",
          "label": "t:sections.banner_v3.settings.image.label"
        },
        {
          "type": "image_picker",
          "id": "icon",
          "label": "t:sections.banner_v3.settings.icon.label"
        },
        {
          "type": "text",
          "id": "title",
          "label": "t:sections.banner_v3.settings.title.label"
        },
        {
          "type": "html",
          "id": "desc",
          "label": "t:sections.banner_v3.settings.desc.label"
        },
        {
          "type": "text",
          "id": "button_text",
          "label": "t:sections.banner_v3.settings.button_text.label",
          "default": "Read More"
        },
        {
          "type": "url",
          "id": "button_link",
          "label": "t:sections.banner_v3.settings.button_link.label"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_v3.presets.name"
    }
  ]
}
{% endschema %}
