{% extends "fm/base.twig" %}

{% block content %}
  {% include 'fm/partials/heroes/hero-internal.twig' %}
  <div class="container-custom mt-5">
    <div class="row">
      {% if results %}

      {% for post in results %}

        <div class="col-lg-3 my-4">
          <div class="item-article">
            <a href="{{ post.link }}">
              {% if post.thumbnail %}
              <img src="{{ post.thumbnail.src }}" alt="{{ post.thumbnail.alt }}">
              {% else %}
              <img src="{{site_options.default_images.magazine_post.featured.url }}" alt="{{site_options.default_images.magazine_post.featured.alt }}">
              {% endif %}
            </a>
              <div class="item-article--data">
                <a href="{{ post.link }}" class='show-txt'><h3 class="heading-3 pt-2">{{post.title}}</h3></a>
                <div class="detail">
                  <p>{{post.preview}}</p>
                </div>
              </div>
            <div class="bg-black"></div>
            <div class="item-article--vermas">
              <a href="{{ post.link }}" class="text-white">Ver más<i class="fas fa-long-arrow-alt-right ml-2"></i></a>
            </div>
          </div>
        </div>

      {% endfor %}

      {% else %}

      <div class="col-md-8 offset-md-2">
        <div class="alert alert-secondary text-center" role="alert">
          <h4>No se han encontrado resultados para la búsqueda seleccionada.</h4>
        </div>
      </div>

      {% endif %}

    </div>
      {% if results.pagination %}
        <div class="grilla-ediciones--pagination">
           {% include 'fm/partials/elements/pagination.twig' with {'pagination' : results.pagination} %}
        </div>
      {% endif %}
  </div>

{% endblock %}
