<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Sparta
 */

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="profile" href="http://gmpg.org/xfn/11">

    <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div class="main-wrapper">
    <?php
    $meta_page_header_style = '';
    if (is_page()) :
        global $post;
        $meta_page_header_style = get_post_meta($post->ID, 'univer_header_style', true);
    endif;

    $header_layout = get_theme_mod('sparta_header_layout', 'fullwidth');

    if (is_page() && $meta_page_header_style !== '' && $meta_page_header_style !== 'default') :

        get_template_part('template-parts/header/header', $meta_page_header_style);

    else:
        get_template_part('template-parts/header/header', $header_layout);

    endif;

    if (get_post_type() === 'room'):
    $hotelier_archive_style = get_theme_mod('sparta_hotelier_archive_style', 'grid');
    if (is_search()) {
        $page_title = sprintf(esc_html__('Search results for: "%s"', 'sparta'), '<span>' . get_search_query() . '</span>');

        if (get_query_var('paged'))
            $page_title .= sprintf(esc_html__('&nbsp;&ndash; Page %s', 'sparta'), get_query_var('paged'));

    } elseif (is_tax()) {

        $page_title = single_term_title("", false);

    } elseif (is_single()) {
        $page_title = esc_html__('Rooms Single', 'sparta');
    } else {

        $page_title = esc_html__('Rooms', 'sparta');
        $page_title = apply_filters('hotelier_rooms_archive_page_title', $page_title);
    }
    ?>
    <section class="vk-content">
        <div class="vk-banner vk-background-image-1 page-title-bg">
            <div class="vk-background-overlay"></div>
            <div class="container ">
                <div class="vk-banner-wrapper">
                    <div class="page-heading">
                        <h1 class="entry-title"><?php echo apply_filters('hotelier_page_title', $page_title); ?></h1>
                    </div>
                    <div class="vk-breadcrumb">
                        <?php
                        Sparta_Core::get_sparta_template('breadcrumbs');
                        ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="vk-page sparta-hotel-room <?php if (!is_single()) : echo esc_attr($hotelier_archive_style); endif; ?>">
<?php
echo '<div class="container">';
echo '<div class="row">';
endif; ?>