<?php get_header() ?>



<!--
================================
SEZIONE HERO
================================
-->

<section class="hero hero--page">

    <div class="hero__sfondo" style="background:linear-gradient( #00000052 100%, rgba(0, 0, 0, 0.5)100%), url(<?php echo get_the_post_thumbnail_url(get_the_ID(),'full'); ?>); background-position: center; background-size: cover; background-repeat: no-repeat;">
		
	</div>

    <div class="hero--page--title">
        <h1><?php the_title(); ?></h1>
        <div class="linea_diversa"></div>
    </div>

</section>

<section class="sfondo_sfumato contenuto_pagina padding--vh animazione--appare--up">
    <div class="container-50">
      <h3><?php echo __('Descrizione Progetto', 'puraluce'); ?></h3>
      <div class="linea_diversa"></div>
        <div class="paragrafo">
            <?php the_content() ?>
        </div>
    </div>
</section>

		<!-- ============== GALLERY ======== -->
<div class="gallery">

<?php
$images = get_field('foto_prodotti');
        $counter = 0;

if( $images ): ?>
	
	<figure class="wp-block-gallery columns-2 is-cropped">

  <ul class="blocks-gallery-grid">
    <?php foreach( $images as $image ): ?>
    <?php $counter++; ?>
    <!-- singola gallery dimensioni -->
    <li class="blocks-gallery-item">
		
		<figure>
			
        <a href="<?php echo $image['url']; ?>" class="image-link">

                <img class="img-fluid" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
        </a>
		
		</figure>

    </li>
    <!-- singola gallery dimensioni -->
    <?php endforeach; ?>

  </ul>

		</figure>
    <?php endif; ?>

</div><!-- ============== GALLERY ======== -->

<?php

    $args = array(
    'post_type' => 'portfolio',
    'posts_per_page' => 6,
    'order' => 'DESC'
);
    $query = new WP_Query($args); ?>
<?php if( $query->have_posts() ) { ?>

<section class="portfolio-canva">

    <div class="swiper-container">
       <div class="swiper-wrapper">

         <?php while( $query->have_posts() ) : $query->the_post(); ?>


        <div class="swiper-slide swiper-portfolio swiper-slide-vertical">
          <a href="<?php the_permalink() ?>" class="swiper-slide-content">
    			  <img class="img-fluid" src="<?php echo get_the_post_thumbnail_url(get_the_ID(),'large'); ?>">
              <h3 class="swiper-link title-overlay"><?php the_title() ?></h3>
            </a>
        </div>

        <?php endwhile; ?>

      </div>
    </div>


    <!-- Add Pagination -->
    <div class="swiper-pagination swiper-pagination-vertical rotate-90">
      <!-- Add Arrows -->
      <span class="swiper-button-prev">Prev /</span><span class="swiper-button-next">Next</span>
    </div>

</section>
<?php } ?>
<?php wp_reset_postdata(); ?>



<div class="cursor-dot-outline"></div>
<div class="cursor-dot"></div>

<?php get_footer() ?>
