<?php
/**
 * The Header: Logo and main menu
 *
 * @package TOURIMO
 * @since TOURIMO 1.0
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js
									<?php
										// Class scheme_xxx need in the <html> as context for the <body>!
										echo ' scheme_' . esc_attr( tourimo_get_theme_option( 'color_scheme' ) );
									?>
										">
<head>
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

	<?php
	if ( function_exists( 'wp_body_open' ) ) {
		wp_body_open();
	} else {
		do_action( 'wp_body_open' );
	}
	do_action( 'tourimo_action_before_body' );
	?>

	<div class="body_wrap">

		<div class="page_wrap">
			
			<?php
			$tourimo_full_post_loading = ( is_singular( 'post' ) || is_singular( 'attachment' ) ) && tourimo_get_value_gp( 'action' ) == 'full_post_loading';
			$tourimo_prev_post_loading = ( is_singular( 'post' ) || is_singular( 'attachment' ) ) && tourimo_get_value_gp( 'action' ) == 'prev_post_loading';

			// Don't display the header elements while actions 'full_post_loading' and 'prev_post_loading'
			if ( ! $tourimo_full_post_loading && ! $tourimo_prev_post_loading ) {

				// Short links to fast access to the content, sidebar and footer from the keyboard
				?>
				<a class="tourimo_skip_link skip_to_content_link" href="#content_skip_link_anchor" tabindex="1"><?php esc_html_e( "Skip to content", 'tourimo' ); ?></a>
				<?php if ( tourimo_sidebar_present() ) { ?>
				<a class="tourimo_skip_link skip_to_sidebar_link" href="#sidebar_skip_link_anchor" tabindex="1"><?php esc_html_e( "Skip to sidebar", 'tourimo' ); ?></a>
				<?php } ?>
				<a class="tourimo_skip_link skip_to_footer_link" href="#footer_skip_link_anchor" tabindex="1"><?php esc_html_e( "Skip to footer", 'tourimo' ); ?></a>
				
				<?php
				do_action( 'tourimo_action_before_header' );

				// Header
				$tourimo_header_type = tourimo_get_theme_option( 'header_type' );
				if ( 'custom' == $tourimo_header_type && ! tourimo_is_layouts_available() ) {
					$tourimo_header_type = 'default';
				}
				get_template_part( apply_filters( 'tourimo_filter_get_template_part', "templates/header-{$tourimo_header_type}" ) );

				// Side menu
				if ( in_array( tourimo_get_theme_option( 'menu_side' ), array( 'left', 'right' ) ) ) {
					get_template_part( apply_filters( 'tourimo_filter_get_template_part', 'templates/header-navi-side' ) );
				}

				// Mobile menu
				get_template_part( apply_filters( 'tourimo_filter_get_template_part', 'templates/header-navi-mobile' ) );

				do_action( 'tourimo_action_after_header' );

			}
			?>

			<div class="page_content_wrap">
				<?php
				do_action( 'tourimo_action_page_content_wrap', $tourimo_full_post_loading || $tourimo_prev_post_loading );

				// Single posts banner
				if ( is_singular( 'post' ) || is_singular( 'attachment' ) ) {
					if ( $tourimo_prev_post_loading ) {
						if ( tourimo_get_theme_option( 'posts_navigation_scroll_which_block' ) != 'article' ) {
							do_action( 'tourimo_action_between_posts' );
						}
					}
					// Single post thumbnail and title
					$tourimo_path = apply_filters( 'tourimo_filter_get_template_part', 'templates/single-styles/' . tourimo_get_theme_option( 'single_style' ) );
					if ( tourimo_get_file_dir( $tourimo_path . '.php' ) != '' ) {
						get_template_part( $tourimo_path );
					}
				}

				// Widgets area above page content
				$tourimo_body_style   = tourimo_get_theme_option( 'body_style' );
				$tourimo_widgets_name = tourimo_get_theme_option( 'widgets_above_page' );
				$tourimo_show_widgets = ! tourimo_is_off( $tourimo_widgets_name ) && is_active_sidebar( $tourimo_widgets_name );
				if ( $tourimo_show_widgets ) {
					if ( 'fullscreen' != $tourimo_body_style ) {
						?>
						<div class="content_wrap">
							<?php
					}
					tourimo_create_widgets_area( 'widgets_above_page' );
					if ( 'fullscreen' != $tourimo_body_style ) {
						?>
						</div><!-- </.content_wrap> -->
						<?php
					}
				}

				// Content area
				?>
				<div class="content_wrap<?php echo 'fullscreen' == $tourimo_body_style ? '_fullscreen' : ''; ?>">

					<div class="content">
						<?php
						// Skip link anchor to fast access to the content from keyboard
						?>
						<a id="content_skip_link_anchor" class="tourimo_skip_link_anchor" href="#"></a>
						<?php
						// Single posts banner between prev/next posts
						if ( ( is_singular( 'post' ) || is_singular( 'attachment' ) )
							&& $tourimo_prev_post_loading 
							&& tourimo_get_theme_option( 'posts_navigation_scroll_which_block' ) == 'article'
						) {
							do_action( 'tourimo_action_between_posts' );
						}

						// Widgets area inside page content
						tourimo_create_widgets_area( 'widgets_above_content' );
