<?php

/**
 * Itinerary Archive Template
 *
 * This template can be overridden by copying it to yourtheme/wp-travel/archive-itineraries.php.
 *
 * HOWEVER, on occasion wp-travel will need to update template files and you (the theme developer).
 * will need to copy the new files to your theme to maintain compatibility. We try to do this.
 * as little as possible, but it does happen. When this occurs the version of the template file will.
 * be bumped and the readme will list any important changes.
 *
 * @see         http://docs.wensolutions.com/document/template-structure/
 * @author      WenSolutions
 * @package     WP_Travel
 * @since       1.0.0
 */

$sanitized_get = WP_Travel::get_sanitize_request('get', true);
$view_mode     = wptravel_get_archive_view_mode($sanitized_get);

?>
<!DOCTYPE html>
<html>

<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<?php
	$block_header = do_blocks( '<!-- wp:template-part {"slug":"header","theme":"gotrip","tagName":"header","className":"site-header"} /-->');
	$block_main = do_blocks( '<!-- wp:group {"tagName":"main","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60","left":"0","right":"0"}}},"backgroundColor":"secondary","layout":{"type":"constrained"}} -->
<main class="wp-block-group has-secondary-background-color has-background" style="padding-top:var(--wp--preset--spacing--60);padding-right:0;padding-bottom:var(--wp--preset--spacing--60);padding-left:0">');
	
	$block_main_close = do_blocks( '</main><!-- /wp:group -->');
	$block_footer = do_blocks( '<!-- wp:template-part {"slug":"footer","theme":"gotrip","tagName":"footer","className":"site-footer"} /-->');
 	?>
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
	<?php wp_body_open(); ?>
		<div class="wp-site-blocks">
			<?php echo $block_header; ?>
			<?php echo $block_main; ?>
<!-- 			<main class="wp-block-group trip-archive-page is-layout-constrained wp-block-group-is-layout-constrained" style="padding-right:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)" id="wp--skip-link--target"> -->

				<div id="page" class="wrapper">
					<?php do_action('wp_travel_before_main_content'); ?>

					<div id="wptravel-archive-wrapper" class="wptravel-archive-wrapper <?php echo esc_attr('grid' === $view_mode ? 'grid-view' : ''); ?> ">
						<?php
						if (have_posts()) :
							while (have_posts()) :
								the_post();
								wptravel_get_template_part('v2/content', 'archive-itineraries');
							endwhile; // end of the loop.
						else :
							wptravel_get_template_part('v2/content', 'archive-itineraries-none');
						endif;
						?>
					</div>
					<?php
					do_action('wp_travel_archive_listing_sidebar');

					do_action('wp_travel_after_main_content');
					?>
			</div>
<!-- 		</main> -->
			<?php echo $block_main_close; ?>
		<?php echo $block_footer; ?>
		<?php wp_footer(); ?>
	</div>	
	<?php wp_footer(); ?>
</body>