<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Classic Charity NGO
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

<?php if ( function_exists( 'wp_body_open' ) ) {
  wp_body_open();
} else {
  do_action( 'wp_body_open' );
} ?>

<?php if ( get_theme_mod('classic_charity_ngo_preloader', false) != "") { ?>
  <div id="preloader">
    <div id="status">&nbsp;</div>
  </div>
<?php }?>

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

<div id="pageholder" <?php if( get_theme_mod( 'classic_charity_ngo_box_layout', false) != "" ) { echo 'class="boxlayout"'; } ?>>

  <div class="mainhead">

  <?php if ( get_theme_mod('classic_charity_ngo_topbar',false) != "") { ?>
    <div class="header-top py-2">
      <div class="container">
        <div class="row">
          <div class="col-lg-9 col-md-9 contact-box align-self-center">
            <?php if ( get_theme_mod('classic_charity_ngo_email_address') != "") { ?>
              <span class="email me-lg-4 me-md-3 me-0 mb-md-0 mb-2"><i class="far fa-envelope me-2"></i><a href="mailto:<?php echo esc_attr( get_theme_mod('classic_charity_ngo_email_address','') ); ?>"><?php echo esc_html(get_theme_mod ('classic_charity_ngo_email_address','')); ?></a></span>
              <?php } ?>
            <?php if ( get_theme_mod('classic_charity_ngo_time','') != "") { ?>
              <span class="time mb-md-0 mb-2"><i class="far fa-clock me-2"></i><?php echo esc_html(get_theme_mod ('classic_charity_ngo_time','')); ?></span>
            <?php } ?>
          </div>
          <div class="col-lg-3 col-md-3 social-media align-self-center text-md-end text-center">
            <span class="social-icons">
              <?php if ( get_theme_mod('classic_charity_ngo_fb_link') != "") { ?>
                <a title="<?php echo esc_attr('facebook', 'classic-charity-ngo'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_charity_ngo_fb_link')); ?>"><i class="fab fa-facebook-f me-3 me-md-2 me-lg-3"></i></a> 
              <?php } ?>
              <?php if ( get_theme_mod('classic_charity_ngo_insta_link') != "") { ?> 
                <a title="<?php echo esc_attr('instagram', 'classic-charity-ngo'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_charity_ngo_insta_link')); ?>"><i class="fab fa-instagram me-3 me-md-2 me-lg-3"></i></a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_charity_ngo_twitt_link') != "") { ?>
                <a title="<?php echo esc_attr('twitter', 'classic-charity-ngo'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_charity_ngo_twitt_link')); ?>"><i class="fab fa-twitter me-3 me-md-2 me-lg-3"></i></a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_charity_ngo_linkedin_link') != "") { ?> 
                <a title="<?php echo esc_attr('linkedin', 'classic-charity-ngo'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_charity_ngo_linkedin_link')); ?>"><i class="fab fa-linkedin me-3 me-md-2 me-lg-3"></i></a>
              <?php } ?>
              <?php if ( get_theme_mod('classic_charity_ngo_youtube_link') != "") { ?> 
                <a title="<?php echo esc_attr('youtube', 'classic-charity-ngo'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_charity_ngo_youtube_link')); ?>"><i class="fab fa-youtube"></i></a>
              <?php } ?>
            </span>
          </div>
        </div>
      </div>
    </div>
  <?php } ?>

    <div class="main-header">
      <div class="header  py-2 main-stick <?php echo esc_attr(classic_charity_ngo_sticky_menu()); ?>">
        <div class="container">
          <div class="row">
            <div class="col-lg-3 col-md-4 align-self-center">
              <div class="classic-charity-ngo-logo">
                <?php if (get_theme_mod('classic_charity_ngo_logo_enable', true)) { ?>
                  <?php classic_charity_ngo_the_custom_logo(); ?>
                <?php } ?>
                <div class="site-branding-text">
                  <?php if ( get_theme_mod('classic_charity_ngo_title_enable',false) != "") { ?>
                    <?php if ( is_front_page() && is_home() ) : ?>
                      <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></h1>
                    <?php else : ?>
                      <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></p>
                    <?php endif; ?>
                  <?php } ?>
                  <?php $classic_charity_ngo_description = get_bloginfo( 'description', 'display' );
                  if ( $classic_charity_ngo_description || is_customize_preview() ) : ?>
                    <?php if ( get_theme_mod('classic_charity_ngo_tagline_enable',false) != "") { ?>
                    <span class="site-description"><?php echo esc_html( $classic_charity_ngo_description ); ?></span>
                    <?php } ?>
                  <?php endif; ?>
                </div>
              </div>
            </div>
            <div class="col-lg-7 col-md-4 col-6 align-self-center px-md-0">
              <div class="toggle-nav mobile-stick text-center <?php echo esc_attr(classic_charity_ngo_sticky_menu()); ?>">
                  <button role="tab"><?php esc_html_e('Menu','classic-charity-ngo'); ?></button>
              </div>
              <div id="mySidenav" class="nav sidenav">
                <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu','classic-charity-ngo' ); ?>">
                  <ul class="mobile_nav">
                    <?php
                      wp_nav_menu( array( 
                        'theme_location' => 'primary',
                        'container_class' => 'main-menu' ,
                        'items_wrap' => '%3$s',
                        'fallback_cb' => 'wp_page_menu',
                      ) ); 
                     ?>
                  </ul>
                  <a href="javascript:void(0)" class="close-button"><?php esc_html_e('CLOSE','classic-charity-ngo'); ?></a>
                </nav>
              </div>
            </div>
            <div class="col-lg-2 col-md-4 col-6 align-self-center">
              <?php if ( get_theme_mod('classic_charity_ngo_donate_btn_text') != "" && get_theme_mod('classic_charity_ngo_donate_btn_url') != "") { ?> 
                <div class="contact-us text-lg-end text-center">
                  <a href="<?php echo esc_url(get_theme_mod ('classic_charity_ngo_donate_btn_url','')); ?>"><?php echo esc_html(get_theme_mod ('classic_charity_ngo_donate_btn_text','CONTACT US','classic-charity-ngo')); ?></a>
                </div>
              <?php }?>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>