<?php
/**
 * The template part for Top Header
 *
 * @package VW Lifestyle Blog 
 * @subpackage vw-lifestyle-blog
 * @since vw-lifestyle-blog 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_lifestyle_blog_sticky_header', false) == 1 || get_theme_mod( 'vw_lifestyle_blog_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="main-topbar">
    <?php if (get_theme_mod('vw_lifestyle_blog_hide_show_topbar_section', true) == 1 || get_theme_mod( 'vw_lifestyle_blog_resp_topbar_hide_show', true) == 1) {  ?>
      <div class="topbar">
        <div class="container">
          <div class="row">
            <div class="offset-xl-3 col-xl-6 col-lg-6 col-md-6 col-12 topbar-text">
              <?php if(get_theme_mod('vw_lifestyle_blog_topbar_text') != '') {?>
                <p class="mb-0 text-capitalize"><?php echo esc_html(get_theme_mod('vw_lifestyle_blog_topbar_text')) ?></p>
              <?php }?>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-12">
              <div class="topbar-social-icon">
                <?php if ( is_active_sidebar( 'social-widget-sidemenu' ) ) : ?>                
                  <?php dynamic_sidebar('social-widget-sidemenu'); ?>
                <?php else : ?>
                  <!-- Default Social Icons Widgets -->
                    <div class="widget">
                        <ul class="custom-social-icons" >
                          <li><a href="https://facebook.com" target="_blank"><i class="fab fa-facebook"></i></a></li> 
                          <li><a href="https://pinterest.com" target="_blank"><i class="fab fa-pinterest"></i></a></li> 
                          <li><a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a></li> 
                          <li><a href="https://twitter.com" target="_blank"><i class="fab fa-twitter"></i></a></li>                      
                        </ul>
                    </div>
                <?php endif; ?>                 
              </div> 
            </div>
          </div>
        </div>
      </div>
    <?php }?>
    <div class="menu-sec">
      <div class="container">
        <div class="row">
          <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-1 col-sm-4 col-4 align-self-center header-sec-top">
            <?php get_template_part('template-parts/header/navigation'); ?>
          </div>
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-8 col-8 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 $vw_lifestyle_blog_blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $vw_lifestyle_blog_blog_info ) ) : ?>
                  <?php if ( is_front_page() && is_home() ) : ?>
                    <?php if( get_theme_mod('vw_lifestyle_blog_logo_title_hide_show',true) == 1){ ?>
                      <p class="site-title mb-0 text-center"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                    <?php } ?>
                  <?php else : ?>
                    <?php if( get_theme_mod('vw_lifestyle_blog_logo_title_hide_show',true) == 1){ ?>
                      <p class="site-title mb-0 text-center"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                    <?php } ?>
                  <?php endif; ?>
                <?php endif; ?>
                <?php
                  $vw_lifestyle_blog_description = get_bloginfo( 'description', 'display' );
                  if ( $vw_lifestyle_blog_description || is_customize_preview() ) :
                ?>
                <?php if( get_theme_mod('vw_lifestyle_blog_tagline_hide_show',false) == 1){ ?>
                  <p class="site-description mb-0 text-center">
                    <?php echo esc_html($vw_lifestyle_blog_description); ?>
                  </p>
                <?php } ?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-8 col-sm-12 col-12 align-items-center d-flex top-btn gap-4">
            <?php 
              for($vw_lifestyle_blog_k = 1; $vw_lifestyle_blog_k <= 3; $vw_lifestyle_blog_k++) {   
              if( get_theme_mod('vw_lifestyle_blog_topbar_button_text'.$vw_lifestyle_blog_k) != '' ){ ?>
              <div class="topbar-btn">
                <a href="<?php echo esc_html(get_theme_mod('vw_lifestyle_blog_topbar_button_link'.$vw_lifestyle_blog_k)); ?>"><?php echo esc_html( get_theme_mod('vw_lifestyle_blog_topbar_button_text'.$vw_lifestyle_blog_k)); ?><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('vw_lifestyle_blog_topbar_button_text'.$vw_lifestyle_blog_k)); ?></span></a>
              </div>
            <?php }} ?>
            <?php if (get_theme_mod('vw_lifestyle_blog_search_hide_show', true)){ ?>
              <div class="search-box">
                <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('vw_lifestyle_blog_search_open_icon','fas fa-search')); ?> me-2'></i><?php echo esc_html__('Search', 'vw-lifestyle-blog'); ?></a></span>
              </div>
              <div class="serach_outer">
                <div class="closepop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('vw_lifestyle_blog_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
                <div class="serach_inner">
                  <?php get_search_form(); ?>
                </div>
              </div>
            <?php } ?>
            <div class="top-author">
              <div class="top-img">
                <?php 
                  $vw_lifestyle_blog_current_user = wp_get_current_user(); 
                  echo get_avatar($vw_lifestyle_blog_current_user->ID);
                ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>