<!DOCTYPE html>
<html>
<head>

    <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <link rel="stylesheet" href="https://use.typekit.net/iqa2hfc.css">

    <link type="text/css" rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">


    <?php wp_head(); ?>

</head>

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

<div id="page">
<div class="wrapper">
<header id="header" class="site-header sticky">
    <div class="wide-container header-inner">
        <div class="header-element">
            <a href="<?php bloginfo('url'); ?>" class="header-brand-logo">
                <img class="responsive-img" src="<?php bloginfo('template_directory'); ?>/assets/img/logo.png" alt="<?php bloginfo('name'); ?>" width="232px" height="59px">
            </a>
        </div> <!-- header-element -->

        <div class="menu-container header-element">



            <div class="sticky-main-menu-container main-menu-container">
                <?php if ( has_nav_menu( 'main_menu' ) ): ?>
                    <?php wp_nav_menu( array( 'theme_location' => 'main_menu', 
                    'walker' => new wrapped_menu_walker() 
                ) ); ?>
                <?php endif; ?>
            </div>



            <div class="top-menu-container">

                <div class="header-button-menu hide-on-small-only">
                    <div class="header-search-wrapper">
                        <div class="header-search">                    

                            <button class="header-icon-search hide-on-small-only">
                                <?php echo file_get_contents(get_template_directory() . '/assets/img/icons/search-grey.svg'); ?>
                            </button>
                            <div class="header-search-form-wrapper">
                                <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    <!--                             <button class="header-icon-close">
                                    <img src="<?php bloginfo('template_directory'); ?>/assets/img/icons/close.svg">
                                    <?php echo file_get_contents(get_template_directory() . '/assets/img/icons/close.svg'); ?>
                                </button> -->
                            </div>
                        </div>
                    </div>

                        <a href="<?php bloginfo('url');?>/construction#updates" class="btn btn-outline-gray">Construction updates</a>
                        <a href="#" data-toggle="modal" data-target="#subscribe" class="btn btn-outline-gray">Stay Informed</a>
                        <a href="https://m2mediadev.com/qw/contact/" class="btn btn-outline-gray">Contact</a>
                </div>


                <div class="header-hamburg">
                    <button class="hamburger">
                        <img src="<?php bloginfo('template_directory'); ?>/assets/img/icons/menu.svg">
                    </button>
                </div> <!-- header hamburger -->

            </div>


            <div class="bottom-menu-container main-menu-container">
                <?php if ( has_nav_menu( 'main_menu' ) ): ?>
                    <?php wp_nav_menu( array( 'theme_location' => 'main_menu', 
                    'walker' => new wrapped_menu_walker() 
                ) ); ?>
                <?php endif; ?>
            </div>


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

<?php 

   //display custom menu or custom sidebar if that function is required 
   
   global $post;
   $menu = get_field('menu_to_show');
   if (!is_search()) {
       if ( get_post_type() == 'explore') {
        $menu = 'explore_menu';
       } elseif ( get_post_type() == 'news') {
        $menu = 'news_menu';
       } elseif ( get_post_type() == 'media') {
        $menu = 'media_menu';
       }
    }
    if (isset($menu)){
       //display custom menu 
       if($menu != ''){
        if ( has_nav_menu( $menu ) ){
            echo '<div class="custom-menu secondary-page-menu hide-on-med-and-down">';
             wp_nav_menu( array( 'theme_location' => $menu ) ); 
            echo '</div>';
        }
       }
    }

?>