{% set current_path = template_path ~ '/modules/blog/components/editorial' %}

{% if editorial %}
<section class="editorial">
    <div class="container">
        <div class="editorial-head">
            <h2 class="editorial-head__title">{{ function('pll_e', 'COSMO тема редакции') }}</h2>
            <img src="{{ current_path }}/assets/img/editorial-head-icon.png" alt="" class="editorial-head__img">
            <img src="{{ current_path }}/assets/img/editorial-head-star.png" alt="" class="editorial-head__star">
        </div>
        <ul class="editorial-card__wrap">
           {% for item in editorial %}
            {% set _post = item.post %}
            <li class="editorial-card">
                <a href="{{_post.link}}" class="main-img">
                    <img src="{{_post.thumbnail.src}}" alt="{{_post.thumbnail.alt}}">
                </a>
                <div class="editorial-card__content">
                    <ul class="editorial-card__content-alerts">
                            {% for category in _post.categories %}
                                <li>
                                    <a href="{{ category.link }}">{{ category.name }}</a>
                                </li>
                                {% endfor %}
                    </ul>
                    <a href="{{_post.link}}" class="editorial-card__content-title">{{_post.name}}</a>
                    <div class="editorial-card__content-data">
                        <p>{{_post.date}}</p>
                        <p>{{_post.reading_time}}</p>
                    </div>
                </div>
            </li>
            {% endfor %}
        </ul>
    </div>
</section>
{% endif %}