{% if sections or title or text %}
<section class="m_column" m-pack="basic">
  {% include 'm_components/widgets/headline.twig' with {title: title, text: text} only %}

  {% if sections %}
  <div class="grid">

    {% set nbColumns = sections|length > 3 ? '3' : 12 / sections|length %}
    {% for section in sections %}
    <{% if section.button_url %}a href="{{section.button_url|raw}}" {% else %}article{% endif %} class="m_column__block cs--4 clg--{{nbColumns}} ">


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

        <div class="m_column__content">
          {# title #}
          {% if section.title %}<h2 class="h3">{{section.title|raw}}</h2>{% endif %}


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

        </{% if section.button_url %}a{% else %}article{% endif %}>
    {% endfor %}
    </div>
  {% endif %}
  {% include 'm_components/widgets/link.twig' with {textBtn: button_text, link:button_link} only %}
</section>

{% endif %}
