<?php
/**
 * The template part for Top Header
 *
 * @package Archaeology Museums 
 * @subpackage archaeology-museums
 * @since archaeology-museums 1.0
 */
?>
<?php 
  $archaeology_museums_topbar_image = file_get_contents(get_template_directory() . '/assets/images/top-sidebar.svg');
?>

<div class="main-header <?php if( get_theme_mod( 'archaeology_museums_sticky_header', false) == 1 || get_theme_mod( 'archaeology_museums_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="main-topbar ps-2">
    <div class="container px-0">
      <div class="menu-sec">
        <div class="row">
          <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-4 col-sm-6 col-6 align-self-center">
            <div class="logo pb-0 pb-md-0">
              <?php if ( has_custom_logo() ) : ?>
                <div class="site-logo"><?php the_custom_logo(); ?></div>
              <?php endif; ?>
              <?php $archaeology_museums_blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $archaeology_museums_blog_info ) ) : ?>
                  <?php if ( is_front_page() && is_home() ) : ?>
                    <?php if( get_theme_mod('archaeology_museums_logo_title_hide_show',true) == 1){ ?>
                      <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                    <?php } ?>
                  <?php else : ?>
                    <?php if( get_theme_mod('archaeology_museums_logo_title_hide_show',true) == 1){ ?>
                      <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                    <?php } ?>
                  <?php endif; ?>
                <?php endif; ?>
                <?php
                  $archaeology_museums_description = get_bloginfo( 'description', 'display' );
                  if ( $archaeology_museums_description || is_customize_preview() ) :
                ?>
                <?php if( get_theme_mod('archaeology_museums_tagline_hide_show',false) == 1){ ?>
                  <p class="site-description mb-0 text-start">
                    <?php echo esc_html($archaeology_museums_description); ?>
                  </p>
                <?php } ?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xxl-8 col-xl-8 col-lg-7 col-md-5 col-sm-3 col-3 align-self-center header-sec-top">
            <?php get_template_part('template-parts/header/navigation'); ?>
          </div>
          <div class="col-xxl-1 col-xl-1 col-lg-2 col-md-3 col-sm-3 col-3 align-self-center text-lg-end text-md-end text-center toggle-btn">
            <a href="#" id="sidebar-pop"><?php echo $archaeology_museums_topbar_image; ?></a>
          </div>
          <div class="header-sidebar">
            <div class="close-pop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('archaeology_museums_barclose_icon','fas fa-window-close')); ?>"></i></a>
            </div>
            <div class="menu-drawer">
              <div class="logo">
                <?php if ( has_custom_logo() ) : ?>
                  <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $archaeology_museums_blog_info = get_bloginfo( 'name' ); ?>
                      <?php if ( ! empty( $archaeology_museums_blog_info ) ) : ?>
                        <?php if ( is_front_page() && is_home() ) : ?>
                          <?php if( get_theme_mod('archaeology_museums_logo_title_hide_show',true) == 1){ ?>
                            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                          <?php } ?>
                        <?php else : ?>
                          <?php if( get_theme_mod('archaeology_museums_logo_title_hide_show',true) == 1){ ?>
                            <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                          <?php } ?>
                        <?php endif; ?>
                      <?php endif; ?>
                      <?php
                        $archaeology_museums_description = get_bloginfo( 'description', 'display' );
                        if ( $archaeology_museums_description || is_customize_preview() ) :
                      ?>
                      <?php if( get_theme_mod('archaeology_museums_tagline_hide_show',false) == 1){ ?>
                        <p class="site-description mb-0">
                          <?php echo esc_html($archaeology_museums_description); ?>
                        </p>
                      <?php } ?>
                <?php endif; ?>
              </div>
              <?php if(get_theme_mod('archaeology_museums_openclose_text') != '') {?>
                <p class="mt-3"><?php echo esc_html(get_theme_mod('archaeology_museums_openclose_text')) ?></p>
              <?php }?>
              <div class="phone-box mb-3">
                <div class="row">
                  <?php if( get_theme_mod( 'archaeology_museums_phone_text') != '' || get_theme_mod( 'archaeology_museums_phone_number') != '') { ?>
                    <div class="col-xl-2 col-lg-2 col-md-2 col-2 align-self-center text-start">
                      <div class="phone">
                        <i class="<?php echo esc_attr(get_theme_mod('archaeology_museums_phone_no_icon','fas fa-phone')); ?>"></i>
                      </div>
                    </div>
                    <div class="col-xl-10 col-lg-10 col-md-10 col-10 align-self-center text-start">
                      <h6 class="text-capitalize"><?php echo esc_html(get_theme_mod('archaeology_museums_phone_text',''));?></h6>
                      <p class="mb-0"><a href="tel:<?php echo esc_attr( get_theme_mod('archaeology_museums_phone_number','') ); ?>"><?php echo esc_html(get_theme_mod('archaeology_museums_phone_number',''));?></a></p>
                    </div>
                  <?php }?>
                </div>
              </div>
              <div class="mail-box mb-4">
                <div class="row">
                  <?php if( get_theme_mod( 'archaeology_museums_email_text') != '' || get_theme_mod( 'archaeology_museums_email_address') != '') { ?>
                      <div class="col-xl-2 col-lg-2 col-md-2 col-2 align-self-center text-start">
                        <div class="envelope">
                          <i class="<?php echo esc_attr(get_theme_mod('archaeology_museums_email_address_icon','fas fa-envelope-open')); ?>"></i>
                        </div>
                      </div>
                      <div class="col-xl-10 col-lg-10 col-md-10 col-10 align-self-center text-start">
                        <h6 class="text-capitalize"><?php echo esc_html(get_theme_mod('archaeology_museums_email_text',''));?></h6>
                        <p class="mb-0"><a href="mailto:<?php echo esc_attr(get_theme_mod('archaeology_museums_email_address',''));?>"><?php echo esc_html(get_theme_mod('archaeology_museums_email_address',''));?><span class="screen-reader-text"><?php esc_html_e( 'support@example.com','archaeology-museums' );?></span></a></p>
                      </div>
                  <?php }?>
                </div>
              </div>
              <?php if ( is_active_sidebar( 'social-widget-sidemenu' ) ) : ?>
                <div class="topbar-social-icon">
                  <?php dynamic_sidebar('social-widget-sidemenu'); ?>
                </div>
              <?php endif; ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>