<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="content-ts">
 *
 * @package Multi Advance
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
  <meta charset="<?php bloginfo( 'charset' ); ?>">
  <meta name="viewport" content="width=device-width">
  <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
  <?php if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
  } else {
    do_action( 'wp_body_open' );
  } ?>
  <header role="banner">
        <!-- preloader -->
    <?php if(get_theme_mod('multi_advance_preloader_option',false)!= '' || get_theme_mod('multi_advance_responsive_preloader', false) != ''){ ?>
      <?php if(get_theme_mod('multi_advance_preloader_type_options', 'Preloader 1')  == 'Preloader 1') {?>
        <div id="loader-wrapper" class="w-100 h-100">
          <div id="loader" class="rounded-circle"></div>
          <div class="loader-section section-left"></div>
          <div class="loader-section section-right"></div>
        </div>
      <?php } else if(get_theme_mod('multi_advance_preloader_type_options', 'Preloader 2') ==  'Preloader 2') {?>
        <div id="loader-wrapper" class="w-100 h-100">
          <div class="loader">
            <div></div>
            <div></div>
            <div></div>
          </div>
        </div>
      <?php }?>
    <?php }?>
  <!-- preloader end -->

    <a class="screen-reader-text skip-link" href="#maincontent" ><?php esc_html_e( 'Skip to content', 'multi-advance' ); ?></a>    

    <div id="header" class="position-relative">
      <?php if( get_theme_mod('multi_advance_display_topbar',false) != ''){ ?>
        <div class="topbar">
          <div class="container">
            <div class="row">
              <div class="col-lg-5 col-md-12 align-self-center text-lg-start text-center">
                <?php if(get_theme_mod('multi_advance_topbar_text') != ''){ ?>
                  <p class="topbar-text mb-md-0"><?php echo esc_html(get_theme_mod('multi_advance_topbar_text')); ?></p>
                <?php }?>
              </div>
              <div class="col-lg-7 col-md-12 text-lg-end text-center align-self-center my-lg-0 my-2">
                <?php if( get_theme_mod('multi_advance_mail_address') != '') {?>
                  <span class="contact">
                    <a href="mailto:<?php echo esc_attr(get_theme_mod('multi_advance_mail_address')); ?>"><?php echo esc_html(get_theme_mod('multi_advance_mail_address')); ?><span class="screen-reader-text"><?php echo esc_html(get_theme_mod('multi_advance_mail_address')); ?></span></a>
                  </span>
                <?php }?>
                <?php if( get_theme_mod('multi_advance_phoneno') != '') {?>
                  <span class="contact">
                    <a href="tel:<?php echo esc_attr(get_theme_mod('multi_advance_phoneno')); ?>"><?php echo esc_html(get_theme_mod('multi_advance_phoneno')); ?><span class="screen-reader-text"><?php echo esc_html(get_theme_mod('multi_advance_phoneno')); ?></span></a>
                  </span>
                <?php }?>
                <div class="social-icons d-md-inline-block">
                  <?php if(get_theme_mod('multi_advance_facebook_url') != ''){?>
                    <a href="<?php echo esc_url(get_theme_mod('multi_advance_facebook_url')); ?>" target="_blank"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_facebook_icon','fab fa-facebook-f')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Facebook', 'multi-advance'); ?></span></a>
                  <?php }?>
                  <?php if(get_theme_mod('multi_advance_twitter_url') != ''){?>
                    <a href="<?php echo esc_url(get_theme_mod('multi_advance_twitter_url')); ?>" target="_blank"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_twitter_icon','fab fa-twitter')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Twitter', 'multi-advance'); ?></span></a>
                  <?php }?>
                  <?php if(get_theme_mod('multi_advance_instagram_url') != ''){?>
                    <a href="<?php echo esc_url(get_theme_mod('multi_advance_instagram_url')); ?>" target="_blank"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_instagram_icon','fab fa-instagram')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Instagram', 'multi-advance'); ?></span></a>
                  <?php }?>
                  <?php if(get_theme_mod('multi_advance_linkedin_url') != ''){?>
                    <a href="<?php echo esc_url(get_theme_mod('multi_advance_linkedin_url')); ?>" target="_blank"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_linkedin_icon','fab fa-linkedin')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Linkedin', 'multi-advance'); ?></span></a>
                  <?php }?>
                  <?php if(get_theme_mod('multi_advance_youtube_url') != ''){?>
                    <a href="<?php echo esc_url(get_theme_mod('multi_advance_youtube_url')); ?>" target="_blank"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_youtube_icon','fab fa-youtube')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Youtube', 'multi-advance'); ?></span></a>
                  <?php }?>
                </div>
              </div>
            </div>
          </div>
        </div>
      <?php }?>
      <div class="middle-header">
        <div class="container">
          <div class="row">
            <div class="col-lg-3 col-md-4 col-9 align-self-center">
              <div class="logo">
                <?php if ( has_custom_logo() ) : ?>
                  <div class="site-logo"><?php the_custom_logo(); ?></div>
                <?php endif; ?>
                <?php $blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $blog_info ) ) : ?>
                  <?php if( get_theme_mod('multi_advance_site_title',true) != ''){ ?>
                    <?php if ( is_front_page() && is_home() ) : ?>
                      <h1 class="site-title p-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="text-start pt-0" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                    <?php else : ?>
                      <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="text-start pt-0"><?php bloginfo( 'name' ); ?></a></p>
                    <?php endif; ?>
                  <?php }?>
                <?php endif; ?>
                <?php
                $description = get_bloginfo( 'description', 'display' );
                if ( $description || is_customize_preview() ) :
                  ?>
                  <?php if( get_theme_mod('multi_advance_tagline',false) != ''){ ?>
                    <p class="site-description mb-0">
                      <?php echo esc_html($description); ?>
                    </p>
                  <?php }?>
                <?php endif; ?>
              </div>
            </div>
            <div class="col-lg-6 col-md-4 col-3 align-self-center">
              <div class="main-menu">
                <div class="toggle-menu mobile-menu text-end">
                  <button class="mobiletoggle responsive-toggle"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_open_menu_icon','fas fa-bars')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Open Menu','multi-advance'); ?></span></button>
                </div>
                <div id="menu-sidebar" class="nav sidebar text-start">
                  <nav id="primary-site-navigation" class="primary-navigation ps-0" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'multi-advance' ); ?>">
                    <?php
                      wp_nav_menu( array(
                        'theme_location' => 'primary',
                        'container_class' => 'main-menu-navigation responsive-menu clearfix' ,
                        'menu_class' => 'main-menu-navigation clearfix',
                        'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav">%3$s</ul>',
                        'fallback_cb' => 'wp_page_menu',
                      ) );
                    ?>
                    <a href="javascript:void(0)" class="closebtn mobile-menu"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_close_menu_icon','far fa-times-circle')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Close Menu','multi-advance'); ?></span></a>
                  </nav>
                </div>
              </div>
            </div>
            <div class="col-lg-3 col-md-4 align-self-center text-md-end text-center">
              <?php if(get_theme_mod('multi_advance_search_option',true) != ''){ ?>
                <div class="search-box text-md-end text-start position-relative">
                  <button type="button" class="search-open"><i class="<?php echo esc_attr(get_theme_mod('multi_advance_search_icon','fas fa-search')); ?>"></i></button>
                  <div class="search-open-box">
                    <div class="serach_inner">
                      <?php get_search_form(); ?>
                      <button type="button" class="search-close"><i class="fas fa-times"></i></button>
                    </div>
                  </div>
                </div>
              <?php }?>
              <?php if(get_theme_mod('multi_advance_header_button_text') != '' || get_theme_mod('multi_advance_header_button_url') != '') {?>
                <a href="<?php echo esc_url(get_theme_mod('multi_advance_header_button_url')); ?>" class="reach-btn"><?php echo esc_html(get_theme_mod('multi_advance_header_button_text')); ?><i class="<?php echo esc_attr(get_theme_mod('multi_advance_header_btn_icon','fas fa-arrow-right')); ?> ms-2"></i><span class="screen-reader-text"><?php echo esc_html(get_theme_mod('multi_advance_header_button_text')); ?></span></a>
              <?php }?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>