{% load wagtailcore_tags wagtailimages_tags core_tags i18n %}

{% load_descendant_articles_for_section section featured_in_homepage=True count=3 as featured_articles %}
{% if featured_articles %}
  <div class="section-listing section-listing__theme-bg{{section.get_effective_extra_style_hints}}">
    <h1 class="heading section-listing__theme-bg-title">
      <a href="{% pageurl section %}" class="section-listing__theme-bg-link">{{section.title}}</a>
    </h1>
    <ul class="promoted-article-list promoted-article-list--theme-bg">
      {% for article in featured_articles %}
        <li class="promoted-article-list__item promoted-article-list__item--theme-bg">
          {% if article.get_effective_image %}
            <a href="{% pageurl article %}" class="promoted-article-list__anchor promoted-article-list__anchor--theme-bg">
              {% include "patterns/basics/images/article-thumbnail.html" with curve="none" %}
            </a>
          {% endif %}
          <a href="{% pageurl article %}" class="promoted-article-list__anchor promoted-article-list__anchor--theme-bg">
            <h3 class="heading promoted-article-list__heading">
              {{article.title}}
            </h3>
          </a>
          <p class="promoted-article-list__desc promoted-article-list__desc--theme-bg">{{article.subtitle}}</p>
        </li>
      {% endfor %}
    </ul>
  </div>
{% endif %}

{% include "patterns/basics/pagination/pagination-pageof.html" %}
