<link fetchpriority="low" rel="stylesheet" href="{{styles_dir}}/lib/swiper-bundle.min.css" />
<script fetchpriority="low" src="{{scripts_dir}}/swiper-bundle.min.js"></script>

<style>
    .gallery_block {
        max-width: 668px;
        height: 540px;
    }
    .gallery_block .swiper-slide {
        width: 100%;
        max-width: 668px;
        height: 400px;
        display: block !important;
    }

    .gallery_block .swiper {
        width: 100%;
        height: 100%;
    }

    .gallery_block .swiper-slide {
        text-align: center;
        font-size: 18px;
        background: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .gallery_block .swiper-slide img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .gallery_block .swiper {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .gallery_block .swiper-slide {
        background-size: cover;
        background-position: center;
    }

    .gallery_block .mySwiper2 {
        height: 400px;
        width: 100%;
    }

    .gallery_block .mySwiper {
        height: 130px;
        box-sizing: border-box;
        padding: 10px 0;
    }

    .mySwiper .swiper-slide {
        width: 25%;
        height: 100%;
        height: 120px;
        opacity: 0.4;
    }

    .mySwiper .swiper-slide-thumb-active {
        opacity: 1;
    }
    body.leo-skin .gallery_block {
        max-width: 676px;
    }
</style>

<section class="gallery_block relative mb-4 text-white">
    <div id="swiperfull_{{id}}" style="--swiper-navigation-color: #fff; --swiper-pagination-color: #fff" class="swiper mySwiper2 select-none rounded-lg cursor-grab">
        <div class="swiper-wrapper rounded-lg">
            {% for item in section.content %}
            <div class="swiper-slide relative select-none">
                <img loading="lazy" role="presentation" class=" object-contain bg-black" src="{{item.url}}?w=668&h=400" />
                <a href="{{item.url}}" title="visualizza originale" class="fancybox absolute bottom-4 right-4" data-fancybox="swiper_gallery_{{id}}">
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 text-white">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
                      </svg>
                      
                </a>

            </div>
            {% endfor %}
        </div>
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
    </div>
    <div id="swiperthumb_{{id}}" thumbsSlider="" class="swiper mySwiper cursor-pointer">
        <div class="swiper-wrapper">
            {% for item in section.content %}
            <div class="swiper-slide select-none">
                <img loading="lazy" role="presentation" class="object-cover" src="{{item.url}}?w=130&h=120" />
            </div>
            {% endfor %}
        </div>
    </div>

</section>

<script>
    var swiper = new Swiper("#swiperthumb_{{id}}", {
      spaceBetween: 10,
      slidesPerView: 4,
      freeMode: true,
      watchSlidesProgress: true,
    });
    var swiper2 = new Swiper("#swiperfull_{{id}}", {
      spaceBetween: 10,
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev",
      },
      thumbs: {
        swiper: swiper,
      },
    });
</script>