{% if title or text or image  %}
<section class="m_hero" m-pack="basic">
  <div class="grid">
    {% if title or text or sections %}
      <div class="m_headline">
          {% if title %}
            <h1>{{title|raw}}</h1>
          {% endif %}

          {% if text %}
          <div class="m_content">
            {{fn.apply_filters('the_content', fn.html_entity_decode(text))|raw}}
          </div>
          {% endif %}

          <div class="m_btns">
          {% for section in sections %}
            {% set btn = loop.index%2 == 1 ? "primary" : "secondary" %}
            {% set text = section.btn_text ? section.btn_text : "Voir plus" %}
              <a class="btn btn__{{btn}}" href="{{section.btn_url}}">{{text|raw}}</a>
          {% endfor %}
          </div>
      </div>
    {% endif %}

    {% if image.id %}
      <div class="m_hero__image">
        {% include 'm_components/widgets/picture.twig' with {image: image, title: title} only %}
      </div>
    {% endif %}
  </div>
</section>
{% endif %}
