<?php
/*
* Display Logo and nav
*/
?>

<?php
$stylish_blog_sticky = get_theme_mod('stylish_blog_sticky');
    $stylish_blog_data_sticky = "false";
    if ($stylish_blog_sticky) {
    $stylish_blog_data_sticky = "true";
    }
    global $wp_customize;
?>

<div class="headerbox <?php if( is_user_logged_in() && !isset( $wp_customize ) ){ echo "login-user";} ?>" data-sticky="<?php echo esc_attr($stylish_blog_data_sticky); ?>">
  <div class="container">
    <div class="row">
      <div class="col-lg-9 col-md-6 col-6 align-self-center">
        <?php
          get_template_part( 'template-parts/navigation/site', 'nav' );
        ?>
      </div>

      <div class="col-lg-3 col-md-6 col-6 offcanvas-div d-flex align-items-center align-self-center">
        <?php if(get_theme_mod('stylish_blog_header_sidebar',true)){ ?>
          <button type="button" data-bs-toggle="offcanvas" data-bs-target="#demo">
                <i class="fas fa-bars"></i>
          </button>
        <?php } ?>
        <div class="offcanvas offcanvas-end" id="demo">
          <div class="offcanvas-header"> 
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas"><i class="fas fa-times"></i></button>
          </div>
          <div class="offcanvas-body">
            <?php $stylish_blog_logo_settings = get_theme_mod( 'stylish_blog_logo_settings','Different Line');
          if($stylish_blog_logo_settings == 'Different Line'){ ?>
            <div class="logo">
              <?php if( has_custom_logo() ) stylish_blog_the_custom_logo(); ?>
              <?php if(get_theme_mod('stylish_blog_site_title',true) == 1){ ?>
                <?php if (is_front_page() || is_home()) : ?>
                    <h1 class="text-capitalize">
                        <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                    </h1>
                <?php else : ?>
                    <p class="text-capitalize site-title">
                        <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                    </p>
                <?php endif; ?>
              <?php }?>
              <?php $stylish_blog_description = get_bloginfo( 'description', 'display' );
              if ( $stylish_blog_description || is_customize_preview() ) : ?>
                <?php if(get_theme_mod('stylish_blog_site_tagline',false)){ ?>
                  <p class="site-description mb-0"><?php echo esc_html($stylish_blog_description); ?></p>
                <?php }?>
              <?php endif; ?>
            </div>
          <?php }else if($stylish_blog_logo_settings == 'Same Line'){ ?>
            <div class="logo logo-same-line mb-md-0 text-center text-lg-left">
              <div class="row">
                <div class="col-lg-5 col-md-5 align-self-md-center">
                  <?php if( has_custom_logo() ) stylish_blog_the_custom_logo(); ?>
                </div>
                <div class="col-lg-7 col-md-7 align-self-md-center">
                  <?php if(get_theme_mod('stylish_blog_site_title',true) == 1){ ?>
                    <?php if (is_front_page() || is_home()) : ?>
                        <h1 class="text-capitalize">
                            <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                        </h1>
                    <?php else : ?>
                        <p class="text-capitalize site-title">
                            <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                        </p>
                    <?php endif; ?>
                    <?php }?>
                    <?php $stylish_blog_description = get_bloginfo( 'description', 'display' );
                    if ( $stylish_blog_description || is_customize_preview() ) : ?>
                    <?php if(get_theme_mod('stylish_blog_site_tagline',false)){ ?>
                      <p class="site-description mb-0"><?php echo esc_html($stylish_blog_description); ?></p>
                    <?php }?>
                  <?php endif; ?>
                </div>
              </div>
            </div>
          <?php }?>
            <div class="social-media">
              <?php                 
                $stylish_blog_header_fb_new_tab = esc_attr(get_theme_mod('stylish_blog_header_fb_new_tab','true'));
                $stylish_blog_header_twt_new_tab = esc_attr(get_theme_mod('stylish_blog_header_twt_new_tab','true'));
                $stylish_blog_header_ins_new_tab = esc_attr(get_theme_mod('stylish_blog_header_ins_new_tab','true'));
                $stylish_blog_header_ut_new_tab = esc_attr(get_theme_mod('stylish_blog_header_ut_new_tab','true'));
                $stylish_blog_header_pint_new_tab = esc_attr(get_theme_mod('stylish_blog_header_pint_new_tab','true'));
                ?>
              <?php if( get_theme_mod( 'stylish_blog_facebook_url' ) != '') { ?>
                <a <?php if($stylish_blog_header_fb_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'stylish_blog_facebook_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('stylish_blog_facebook_icon','fab fa-facebook-f')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'stylish_blog_twitter_url' ) != '') { ?>
                <a <?php if($stylish_blog_header_twt_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'stylish_blog_twitter_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('stylish_blog_twitter_icon','fab fa-twitter')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'stylish_blog_instagram_url' ) != '') { ?>
                <a <?php if($stylish_blog_header_ins_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'stylish_blog_instagram_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('stylish_blog_instagram_icon','fab fa-instagram')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'stylish_blog_youtube_url' ) != '') { ?>
                <a <?php if($stylish_blog_header_ut_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'stylish_blog_youtube_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('stylish_blog_youtube_icon','fab fa-youtube')); ?>"></i></a>
              <?php } ?>
              <?php if( get_theme_mod( 'stylish_blog_pint_url' ) != '') { ?>
                <a <?php if($stylish_blog_header_pint_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'stylish_blog_pint_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('stylish_blog_pinterest_icon','fab fa-pinterest')); ?>"></i></a>
              <?php } ?>
            </div>
            <div class="search_inner">
            <?php get_search_form(); ?>
          </div>
          </div>
        </div>
      </div>
      
    </div>
  </div>
</div>