<div class="container pt-5 pb-5">
<div class="row justify-content-center col-mb-80">
<div class="col-md-9">
<div class=" col-12 portfolio-single-image">
<div class="portfolio-single-image parallax scroll-detect min-vh-75 mb-0 overflow-hidden">
<img  class="parallax-bg lazy" src="<?php echo esc_url(get_the_post_thumbnail_url(get_the_ID(),'full')) ?>" data-src="<?php echo esc_url(get_the_post_thumbnail_url(get_the_ID(),'full')) ?>" alt="<?php echo get_the_title(); ?>" >
</div>
</div>
<h1 class=" fw-bold text-center mt-5"><?php echo esc_attr( $instance['title'] ); ?></h1>
<div class="row gx-5">
<div class="col-md-12">
 <?php echo wp_kses_post( $instance['content'] ); ?>

</div>

</div>
<?php $i = 0;
        foreach( $instance['a_repeater'] as $item ){
            
           
          
            //visibility
            if ( $item['visibility'] == '' ){ 

             $image_url = "";
                if ( $item['image'] != '' ){
                    $image_url = wp_get_attachment_image_src( $item['image'], "full", false );
                }
				 $video_url = "";
                if ( $item['video'] != '' ){
                    $video_url = wp_get_attachment_url( $item['video']);
                }
         
                
                ?>

<div class="pt-5 ">

<div class="row  justify-content-center">
<div class="col-12 col-lg-9 ">
<?php if($video_url ){ ?>
<div class="video-wrap no-placeholder">

<video class="lazy" poster="<?php echo esc_url( $image_url[0] ); ?>"  loop autoplay muted playsinline>
<source  data-src="<?php echo esc_url( $video_url ); ?>" src="<?php echo esc_url( $video_url ); ?>" type="video/mp4">
<source data-src="<?php echo esc_url( $video_url ); ?>" src="<?php echo esc_url( $video_url ); ?>" type="video/webm">
</video>


<div class="video-overlay"></div>
</div>


<?php } elseif( $item['youtube_url'] ) { ?>

<div class="embed-responsive embed-responsive-16by9">
<iframe title="YouTube Video Embed" class="embed-responsive-item lazy h-blog-single"  data-src="<?php echo esc_attr( $item['youtube_url'] ); ?>" allowfullscreen></iframe>
</div>


<?php } elseif( $item['image']  ) {?>
<img data-animate="fadeIn" class="aligncenter" src="<?php echo esc_url( $image_url[0] ); ?>" alt="<?php echo esc_attr( $item['title'] ); ?>">
<?php } ?>

</div>
</div>
<h1 class=" fw-bold text-center mt-5"><?php echo esc_attr( $item['title'] ); ?></h1>
<div class="row gx-5">
<div class="col-md-12">
 <?php echo wp_kses_post( $item['content'] ); ?>

</div>

</div>

</div>

<?php
      $i++;
                        
                    }
                } ?>





<div class="container  bg-white">
<div class=" m-0 p-0 pt-4 pb-0">


<div class="row align-items-stretch">

<div class="item-categories overflow-hidden col-md-12 dark  position-relative mb-5 " style="background-image:url(<?php echo get_bloginfo('template_url');?>/assets/assets/images/newsletterbg.webp)" >
<div class="col-padding2 ">
<div class="cat-img form-img-h d-none1"><img data-animate="fadeInRight" src="<?php echo get_bloginfo('template_url');?>/assets/assets/images/form.webp" alt="<?php echo get_the_title(); ?>"></div>

<div class="text-dark form-text">
<div class="heading-block dark mb-4 border-0" data-bs-theme="dark">
<h2 class="text-transform-none fw-medium text-dark">Subscribe Newsletter</h2>
<div class="widget pad-news subscribe-widget mt-news ">
<h5 ><strong class="text-dark">Subscribe&nbsp;to Our Newsletter to get Important News and Amazing Offers:</strong></h5><strong>
<div class="widget-subscribe-form-result"></div>
<form id="widget-subscribe-form" action="include/subscribe.php" method="post" class="mb-0" novalidate="novalidate">
<div class="input-group mx-auto">
<div class="input-group-text"><i class="bi-envelope-plus"></i></div>
<input type="email" id="widget-subscribe-form-email " name="widget-subscribe-form-email" class="bg-transparent form-control required email" placeholder="Enter your Email">
<button class="btn btn-success" type="submit">Subscribe</button>
</div>
</form>
</strong></div><strong>



</strong></div>

</div>
</div>
</div>


</div>
</div>
</div>


<div class="card mt-0 border-default rounded-6">
<div class="card-body p-4">
<div class="d-flex align-items-center justify-content-between">
<h6 class="fs-6 fw-semibold mb-0">Connect us on</h6>
<div class="d-flex">
<?php if( get_option('facebook_url')){ ?>
<a href="<?php echo get_option('facebook_url'); ?>" class="social-icon bg-light si-small border-transparent rounded-circle h-bg-facebook" title="Facebook">
<i class="fa-brands fa-facebook-f"></i>
<i class="fa-brands fa-facebook-f"></i>
</a>
<?php } ?>
<?php if( get_option('twitter_url')){ ?>
<a href="<?php echo get_option('twitter_url'); ?>" class="social-icon bg-light si-small border-transparent rounded-circle h-bg-twitter" title="Twitter">
<i class="fa-brands fa-twitter"></i>
<i class="fa-brands fa-twitter"></i>
</a>

<?php } ?>
	<?php if( get_option('instagram_url')){ ?>
<a href="<?php echo get_option('instagram_url'); ?>" class="social-icon bg-light si-small border-transparent rounded-circle h-bg-instagram" title="Instagram">
<i class="fa-brands fa-instagram"></i>
<i class="fa-brands fa-instagram"></i>
</a>
<?php } ?>
<?php if( get_option('linkedin_url')){ ?>
<a href="<?php echo get_option('linkedin_url'); ?>" class="social-icon bg-light si-small border-transparent rounded-circle h-bg-linkedin" title="LinkedIn">
<i class="fa-brands fa-linkedin"></i>
<i class="fa-brands fa-linkedin"></i>
</a>
<?php } ?>
<?php if( get_option('youtube_url')){ ?>
<a href="<?php echo get_option('youtube_url'); ?>" class="social-icon bg-light si-small border-transparent rounded-circle h-bg-youtube me-0" title="Youtube">
<i class="fa-brands fa-youtube"></i>
<i class="fa-brands fa-youtube"></i>
</a>
<?php } ?>
</div>
</div>
</div>
</div>

</div>


<div class=" pt-5 pb-6 footer-stick">
<div class="container">

<h3 class="fw-mbold text-center">Related Events</h3>
<div id="related-portfolio" class="owl-carousel portfolio-carousel carousel-widget" data-margin="30" data-loop="true" data-nav="false" data-autoplay="5000" data-items-xs="1" data-items-sm="2" data-items-md="3" data-items-lg="4" data-items-xl="4">

 <?php
           $event_ID = get_the_ID();
          $qargs = array(
              'post_status'       => 'publish',
              'post_type'         => 'events',
              'posts_per_page'    => -1
          );
          $postCount = 0;
          $recentPosts = new WP_Query( $qargs );
       
          if ( $recentPosts->have_posts() ) : ?>

              <?php while( $recentPosts->have_posts() ) : $recentPosts->the_post();
              $meta = get_post_meta( get_the_ID() ); 
			  		if( $meta !=  get_post_meta( $blog_ID ) )	{	
			  
			  ?>

<a href="<?php echo get_permalink( ); ?>">
<div class="oc-item related">
<div class="portfolio-item">
<div class="portfolio-image">

<img class="lazy" data-src="<?php echo get_the_post_thumbnail_url(get_the_ID(),'swap-events'); ?>" src="<?php echo get_the_post_thumbnail_url(get_the_ID(),'swap-events'); ?>" alt="<?php echo the_title();?>">


</div>
<div class="portfolio-desc p-3">
<h3><?php echo the_title();?></h3>
	<?php  $event_ID = get_the_ID();
	 $category = get_post_meta($event_ID, 'event_category', true);

	    
	
	?>   
<span> <?php echo $category; ?> </span>
	

</div>
</div>
</div></a>


				<?php }
								$postCount++;
				 endwhile; // end of the loop. ?>
            <?php endif; 
            wp_reset_postdata();  ?>   


</div>
</div>
</div>




</div>
</div>