{% set articles = getArticles({} , 'latest',10) %}
{% if articles|length > 0 %}
<section class="mx-4 lg:container mt-10 lg:mt-20">
<div class="flex flex-col gap-y-4 xs:flex-row items-center justify-between w-full text-center xs:text-start">
<div class="flex items-center gap-x-2 sm:gap-x-4">
<span class="size-12 hidden xs:flex rounded-lg bg-white shadow-lg dark:bg-gray-800 flex-center">
<svg class="size-7 text-gray-700 dark:text-gray-100">
<use href="#check-badge"></use>
</svg>
</span>
<div class="space-y-1 md:space-y-1">
<h3 class="text-xl md:text-2xl font-MorabbaMedium text-gray-800 dark:text-gray-50">محبوبترین
<span class="text-blue-600 dark:text-blue-500">مقالات</span>
</h3>
<p class="text-sm text-gray-500 dark:text-gray-300">جدیدترین و بروزترین مقالات</p>
</div>
</div>
<div class="w-full xs:w-auto flex justify-between xs:justify-end items-center gap-x-2">
<div class="flex items-center gap-x-2">
<button class="slider-navigate_btn articleSlider-prev-slide">
<svg class="size-6 -rotate-90">
<use href="#chevron"/>
</svg>
</button>
<button class="slider-navigate_btn articleSlider-next-slide">
<svg class="size-6 rotate-90">
<use href="#chevron"/>
</svg>
</button>
</div>
<a href="{{ path('app_shop_site_blog') }}"
class="group shadow-xl text-sm md:text-base flex gap-x-1.5 items-center px-2 h-10 md:px-3 text-white bg-blue-600 rounded-xl">
<p>مشاهده همه</p>
<span
class="w-7 h-7 rounded-full bg-blue-500 flex-center md:group-hover:-translate-x-1 transition-transform duration-300">
<svg class="size-5">
<use href="#arrow"/>
</svg>
</span>
</a>
</div>
</div>
<div class="swiper articleSlider w-full mt-5">
<div class="swiper-wrapper w-full py-5">
{% for item in articles %}
<div class="swiper-slide group article-box">
<div class="relative overflow-hidden rounded-lg">
<img src="{{ path('app_cdn_path' , {'path' :item.imageUrl }) }}" class="article-box_img" alt="{{ item.title }}"/>
<div
class="absolute opacity-0 left-0 top-0 bottom-0 right-0 bg-black/60 flex items-center justify-center group-hover:opacity-100 duration-300 transition-all rounded-bl-3xl rounded-tr-3xl">
<a href="{{ path('app_shop_site_blog_single' , {'urlSlug' : item.urlSlug}) }}"
class="flex items-center px-2 py-1 gap-x-1 font-DanaMedium rounded-lg border-2 border-white text-white">
<p>ادامه مطالب</p>
<svg class="w-4 h-4 rotate-90">
<use href="#chevron"></use>
</svg>
</a>
</div>
</div>
<div class="flex flex-col gap-y-1 py-5 px-1">
<h2 class="font-DanaDemiBold"> {{ item.title }} </h2>
</div>
<span class="flex w-full h-1 py-1 border-t border-gray-100 dark:border-white/10"></span>
<div class="flex items-center justify-between text-sm px-1">
<span class="flex items-center gap-x-1 text-blue-500 dark:text-sky-400">
<svg class="w-4 h-4">
<use href="#calendar"></use>
</svg>
<p class="mt-1"> {{ item.createdAt|persianDate }}</p>
</span>
{# <span class="flex items-start gap-x-1 text-gray-300">#}
{# <p class="font-DanaDemiBold">120</p>#}
{# <svg class="w-4 h-4">#}
{# <use href="#eye"></use>#}
{# </svg>#}
{# </span>#}
</div>
</div>
{% endfor %}
</div>
</div>
</section>
{% endif %}