{% comment %}
  Dropmagic Section | Version: 1.1.0
  This file is generated by Dropmagic and can be overwritten at any moment.
{% endcomment %}
<script src="{{ 'dm-marquee.js' | asset_url }}" defer="defer"></script>


<style>
  /* Mobile breakpoint - overriding the variable */
  :root {
    --{{ section.id }}--sectionPaddingTop_responsive_range: {{ section.settings.sectionPaddingTop_responsive_range_mobile | default: section.settings.sectionPaddingTop_responsive_range_desktop }}px;
    --{{ section.id }}--sectionPaddingBottom_responsive_range: {{ section.settings.sectionPaddingBottom_responsive_range_mobile | default: section.settings.sectionPaddingBottom_responsive_range_desktop }}px;
    --{{ section.id }}--sectionPaddingLeft_responsive_range: {{ section.settings.sectionPaddingLeft_responsive_range_mobile | default: section.settings.sectionPaddingLeft_responsive_range_desktop }}px;
    --{{ section.id }}--sectionPaddingRight_responsive_range: {{ section.settings.sectionPaddingRight_responsive_range_mobile | default: section.settings.sectionPaddingRight_responsive_range_desktop }}px;
  }

  /* Desktop breakpoint - overriding the variable */
  @media screen and (min-width: 768px) {
    :root {
      --{{ section.id }}--sectionPaddingTop_responsive_range: {{ section.settings.sectionPaddingTop_responsive_range_desktop }}px;
      --{{ section.id }}--sectionPaddingBottom_responsive_range: {{ section.settings.sectionPaddingBottom_responsive_range_desktop }}px;
      --{{ section.id }}--sectionPaddingLeft_responsive_range: {{ section.settings.sectionPaddingLeft_responsive_range_desktop }}px;
      --{{ section.id }}--sectionPaddingRight_responsive_range: {{ section.settings.sectionPaddingRight_responsive_range_desktop }}px;
    }
  }
</style>


<div
  data-section-combination="{{section.settings.section_combination}}"
  class="relative w-full transition-colors mx-auto bg-background border border-border "
  style="background: {{ section.settings.sectionBackground_color }}; padding-top: var(--{{ section.id }}--sectionPaddingTop_responsive_range); padding-bottom: var(--{{ section.id }}--sectionPaddingBottom_responsive_range); padding-left: var(--{{ section.id }}--sectionPaddingLeft_responsive_range); padding-right: var(--{{ section.id }}--sectionPaddingRight_responsive_range); border-color: {{ section.settings.border_color }}; border-top-width: {{ section.settings.topBorder_number }}px; border-bottom-width: {{ section.settings.bottomBorder_number }}px;">
  <div class="mx-auto py-2.5" style="max-width: {% if section.settings.layout_select == "normal" %}{{ section.settings.sectionMaxWidth_number }}{% else %}100%{% endif %};">
    <div class="w-full !ease-linear {% if section.settings.layout_select == "normal" %}flex flex-col sm:flex-row justify-between gap-6 md:gap-14 mx-auto{% else %}{% endif %} ">
      {% if section.settings.layout_select == "carousel" %}
        
<style>
  /* Standard CRO Ysenra : Vitesse de lecture humaine 50-60 px/s */
  dm-marquee .horizontal-marquee-inner {
    animation-duration: 52s !important;
  }
</style>
<script>
  (function() {
    function tuneMarquees() {
      document.querySelectorAll('dm-marquee .horizontal-marquee-inner').forEach(function(el) {
        if (el.scrollWidth > 0) {
          // Formule canonique : dur = scrollWidth / 52s -> vitesse exacte ~52 px/s
          var dur = Math.round(el.scrollWidth / 52);
          el.style.setProperty('animation-duration', dur + 's', 'important');
        }
      });
    }
    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', tuneMarquees);
    } else {
      tuneMarquees();
    }
    window.addEventListener('load', tuneMarquees);
    window.addEventListener('resize', tuneMarquees);
  })();
</script>
<dm-marquee class="[&_.rfm-child>div]:ml-24 [&_.horizontal-marquee-inner>div]:ml-24" data-speed="{{ section.settings.marqueeSpeed_range }}">

          {%- for block in section.blocks -%}

            {%- case block.type -%}
              {%- when 'dm-text-banner-1-block-1' -%}
              {% render 'dm-text-banner-1-block-1' block: block, text_text: block.settings.text_text, textTextColor_color: block.settings.textTextColor_color, textTextStyle_font_desktop: block.settings.textTextStyle_font_desktop, textTextStyle_font_mobile: block.settings.textTextStyle_font_mobile, textTextAlign_text_alignment_desktop: block.settings.textTextAlign_text_alignment_desktop, textTextAlign_text_alignment_mobile: block.settings.textTextAlign_text_alignment_mobile, icon_icon: block.settings.icon_icon, iconIconColor_color: block.settings.iconIconColor_color, iconIconSize_responsive_range_desktop: block.settings.iconIconSize_responsive_range_desktop, iconIconSize_responsive_range_mobile: block.settings.iconIconSize_responsive_range_mobile %}{%- endcase -%}
          {%- endfor -%}
        </dm-marquee>
      {% else %}
        {%- for block in section.blocks -%}

          {%- case block.type -%}
            {%- when 'dm-text-banner-1-block-1' -%}
            {% render 'dm-text-banner-1-block-1' block: block, text_text: block.settings.text_text, textTextColor_color: block.settings.textTextColor_color, textTextStyle_font_desktop: block.settings.textTextStyle_font_desktop, textTextStyle_font_mobile: block.settings.textTextStyle_font_mobile, textTextAlign_text_alignment_desktop: block.settings.textTextAlign_text_alignment_desktop, textTextAlign_text_alignment_mobile: block.settings.textTextAlign_text_alignment_mobile, icon_icon: block.settings.icon_icon, iconIconColor_color: block.settings.iconIconColor_color, iconIconSize_responsive_range_desktop: block.settings.iconIconSize_responsive_range_desktop, iconIconSize_responsive_range_mobile: block.settings.iconIconSize_responsive_range_mobile %}{%- endcase -%}
        {%- endfor -%}
      {% endif %}
    </div>
  </div>
</div>


{% schema %}
  {
    "name": "Text Banner",
    "tag": "section",
    "class": "dm-section",
    "disabled_on": {
      "groups": ["header", "footer"]
    },
    "settings": [
      {
        "type": "header",
        "content": "Section"
      },
      {
        "type": "color_background",
        "id": "sectionBackground_color",
        "label": "Background"
      },
      {
        "type": "number",
        "id": "sectionPaddingTop_responsive_range_desktop",
        "label": "Padding top (Desktop)",
        "default": 56
      },
      {
        "type": "number",
        "id": "sectionPaddingTop_responsive_range_mobile",
        "label": "Padding top (Mobile)",
        "default": 56
      }, {
        "type": "number",
        "id": "sectionPaddingBottom_responsive_range_desktop",
        "label": "Padding bottom (Desktop)",
        "default": 56
      }, {
        "type": "number",
        "id": "sectionPaddingBottom_responsive_range_mobile",
        "label": "Padding bottom (Mobile)",
        "default": 56
      }, {
        "type": "number",
        "id": "sectionPaddingLeft_responsive_range_desktop",
        "label": "Padding left (Desktop)",
        "default": 64
      }, {
        "type": "number",
        "id": "sectionPaddingLeft_responsive_range_mobile",
        "label": "Padding left (Mobile)",
        "default": 64
      }, {
        "type": "number",
        "id": "sectionPaddingRight_responsive_range_desktop",
        "label": "Padding right (Desktop)",
        "default": 64
      }, {
        "type": "number",
        "id": "sectionPaddingRight_responsive_range_mobile",
        "label": "Padding right (Mobile)",
        "default": 64
      }, {
        "type": "select",
        "id": "section_combination",
        "label": "Section combination",
        "default": "light",
        "options": [
          {
            "label": "White",
            "value": "white"
          },
          {
            "label": "Light",
            "value": "light"
          },
          {
            "label": "Neutral",
            "value": "neutral"
          },
          {
            "label": "Tinted",
            "value": "tinted"
          }, {
            "label": "Tinted secondary",
            "value": "tinted-secondary"
          }, {
            "label": "Tinted tertiary",
            "value": "tinted-tertiary"
          }, {
            "label": "Vibrant",
            "value": "vibrant"
          }, {
            "label": "Gradient",
            "value": "gradient"
          }, {
            "label": "Dark",
            "value": "dark"
          }
        ]
      }, {
        "type": "select",
        "id": "layout_select",
        "label": "Layout",
        "default": "carousel",
        "options": [
          {
            "label": "Normal",
            "value": "normal"
          }, {
            "label": "Carousel",
            "value": "carousel"
          }
        ]
      }, {
        "type": "number",
        "id": "topBorder_number",
        "label": "Top Border",
        "default": 2
      }, {
        "type": "number",
        "id": "bottomBorder_number",
        "label": "Bottom Border",
        "default": 2
      }, {
        "type": "number",
        "id": "sectionMaxWidth_number",
        "label": "Section Max Width",
        "default": 1400
      }, {
        "type": "number",
        "id": "marqueeSpeed_range",
        "label": "Speed",
        "default": 100
      }, {
        "type": "color_background",
        "id": "border_color",
        "label": "Border"
      }
    ],
    "blocks": [
      {
        "type": "dm-text-banner-1-block-1",
        "name": "Text Icon Banner Block",
        "settings": [
          {
            "type": "text",
            "id": "text_text",
            "label": "Text",
            "default": "Lorem ipsum."
          },
          {
            "type": "color_background",
            "id": "textTextColor_color",
            "label": "Text color"
          },
          {
            "type": "text",
            "id": "textTextStyle_font_desktop",
            "label": "Text style (Desktop)",
            "default": "content-md-regular",
            "info": "Get the font key [here](https://app.dropmagic.ai/font-size)"
          },
          {
            "type": "text",
            "id": "textTextStyle_font_mobile",
            "label": "Text style (Mobile)",
            "default": "content-md-regular",
            "info": "Get the font key [here](https://app.dropmagic.ai/font-size)"
          }, {
            "type": "text_alignment",
            "id": "textTextAlign_text_alignment_desktop",
            "label": "Text align (Desktop)",
            "default": "left"
          }, {
            "type": "text_alignment",
            "id": "textTextAlign_text_alignment_mobile",
            "label": "Text align (Mobile)",
            "default": "left"
          }, {
            "type": "textarea",
            "id": "icon_icon",
            "label": "Icon",
            "info": "Get the icon key [here](https://app.dropmagic.ai/icons)"
          }, {
            "type": "color_background",
            "id": "iconIconColor_color",
            "label": "Color"
          }, {
            "type": "number",
            "id": "iconIconSize_responsive_range_desktop",
            "label": "Size (Desktop)",
            "default": 24
          }, {
            "type": "number",
            "id": "iconIconSize_responsive_range_mobile",
            "label": "Size (Mobile)",
            "default": 24
          }
        ]
      }
    ],
    "presets": [
      {
        "name": "Text Banner",
        "category": "Dropmagic 🪄",
        "blocks": [
          {
            "type": "dm-text-banner-1-block-1"
          }, {
            "type": "dm-text-banner-1-block-1"
          }, {
            "type": "dm-text-banner-1-block-1"
          }, {
            "type": "dm-text-banner-1-block-1"
          }
        ]
      }
    ],
    "max_blocks": 12
  }
{% endschema %}