<?php
/*
* Display Logo and header details
*/
?>
<div class="main-header">
  <div class="headerbox">
    <div class="menubox py-md-2 py-3">
      <div class="container">
        <div class="row">
          <div class="col-lg-6 col-md-6 logo-col">
            <div class="logo my-lg-2 my-3">
              <?php if( has_custom_logo() ) crowdfunding_nonprofit_the_custom_logo(); ?>
              <?php if(get_theme_mod('crowdfunding_nonprofit_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 mb-1">
                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                  </p>
                <?php endif; ?>
              <?php }?>
              <?php $crowdfunding_nonprofit_description = get_bloginfo( 'description', 'display' );
              if ( $crowdfunding_nonprofit_description || is_customize_preview() ) : ?>
                <?php if(get_theme_mod('crowdfunding_nonprofit_site_tagline',false)){ ?>
                  <p class="site-description mb-0"><?php echo esc_html($crowdfunding_nonprofit_description); ?></p>
                <?php }?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-lg-6 col-md-6 align-self-center">
            <div class="top-right-content">
              <?php get_template_part('template-parts/navigation/site-nav'); ?>

              <div class="header-menu-right">
                <div class="offcanvas-div d-flex align-items-center align-self-center">
                  <?php if(get_theme_mod('crowdfunding_nonprofit_header_sidebar',true)){ ?>
                    <button type="button" data-bs-toggle="offcanvas" data-bs-target="#demo">
                      <i class="fas fa-bars"></i>
                    </button>
                    <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">
                        <div class="logo">
                          <?php if( has_custom_logo() ) crowdfunding_nonprofit_the_custom_logo(); ?>
                          <?php if(get_theme_mod('crowdfunding_nonprofit_site_title',true) == 1){ ?>
                            <?php if (is_front_page() && is_home()) : ?>
                              <h1 class="text-capitalize my-2">
                                  <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                              </h1> 
                            <?php else : ?>
                                <p class="text-capitalize site-title my-2">
                                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                                </p>
                            <?php endif; ?>
                          <?php }?>
                          <?php $crowdfunding_nonprofit_description = get_bloginfo( 'description', 'display' );
                          if ( $crowdfunding_nonprofit_description || is_customize_preview() ) : ?>
                            <?php if(get_theme_mod('crowdfunding_nonprofit_site_tagline',false)){ ?>
                              <p class="site-description mb-4"><?php echo esc_html($crowdfunding_nonprofit_description); ?></p>
                            <?php }?>
                          <?php endif; ?>
                        </div>
                        <div class="social-media mt-3">
                          <?php                 
                            $crowdfunding_nonprofit_header_fb_new_tab = esc_attr(get_theme_mod('crowdfunding_nonprofit_header_fb_new_tab','true'));
                            $crowdfunding_nonprofit_header_twt_new_tab = esc_attr(get_theme_mod('crowdfunding_nonprofit_header_twt_new_tab','true'));
                            $crowdfunding_nonprofit_header_ins_new_tab = esc_attr(get_theme_mod('crowdfunding_nonprofit_header_ins_new_tab','true'));
                            $crowdfunding_nonprofit_header_ut_new_tab = esc_attr(get_theme_mod('crowdfunding_nonprofit_header_ut_new_tab','true'));
                            $crowdfunding_nonprofit_header_pint_new_tab = esc_attr(get_theme_mod('crowdfunding_nonprofit_header_pint_new_tab','true'));
                            ?>
                          <?php if( get_theme_mod( 'crowdfunding_nonprofit_facebook_url' ) != '') { ?>
                            <a <?php if($crowdfunding_nonprofit_header_fb_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'crowdfunding_nonprofit_facebook_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('crowdfunding_nonprofit_facebook_icon','fab fa-facebook-f')); ?>"></i></a>
                          <?php } ?>
                          <?php if( get_theme_mod( 'crowdfunding_nonprofit_twitter_url' ) != '') { ?>
                            <a <?php if($crowdfunding_nonprofit_header_twt_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'crowdfunding_nonprofit_twitter_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('crowdfunding_nonprofit_twitter_icon','fab fa-twitter')); ?>"></i></a>
                          <?php } ?>
                          <?php if( get_theme_mod( 'crowdfunding_nonprofit_instagram_url' ) != '') { ?>
                            <a <?php if($crowdfunding_nonprofit_header_ins_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'crowdfunding_nonprofit_instagram_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('crowdfunding_nonprofit_instagram_icon','fab fa-instagram')); ?>"></i></a>
                          <?php } ?>
                          <?php if( get_theme_mod( 'crowdfunding_nonprofit_youtube_url' ) != '') { ?>
                            <a <?php if($crowdfunding_nonprofit_header_ut_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'crowdfunding_nonprofit_youtube_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('crowdfunding_nonprofit_youtube_icon','fab fa-youtube')); ?>"></i></a>
                          <?php } ?>
                          <?php if( get_theme_mod( 'crowdfunding_nonprofit_pint_url' ) != '') { ?>
                            <a <?php if($crowdfunding_nonprofit_header_pint_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'crowdfunding_nonprofit_pint_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('crowdfunding_nonprofit_pinterest_icon','fab fa-pinterest')); ?>"></i></a>
                          <?php } ?>
                        </div>
                        <div class="search_inner">
                        <?php get_search_form(); ?>
                      </div>
                      </div>
                    </div>
                  <?php } ?>
                </div>
              </div>
            </div>
          </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>