<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Solar Services
 */
?>
<!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('solar_services_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', 'solar-services' ); ?></a>

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

<div class="header">
  <?php if ( get_theme_mod('solar_services_topbar', false) != "") { ?>
      <div class="tophead">
        <div class="container ">
          <div class=" row">
            <div class="col-lg-9 col-md-9 align-self-center">
              <?php if ( get_theme_mod('solar_services_phone_text') != "") { ?> 
                <li>
                  <a class="site-mail phn" href="tel:<?php echo esc_attr(get_theme_mod('solar_services_phone_text')); ?>">
                  <i class="fa fa-phone"></i>
                  <p><?php echo esc_html(get_theme_mod('solar_services_phone_text')); ?></p>
                  </a>
                </li>
              <?php }?>
              <?php if ( get_theme_mod('solar_services_email_text') != "") { ?>
                <li>
                  <a class="site-mail email" href="mailto:<?php echo esc_attr(get_theme_mod('solar_services_email_text')); ?>">
                    <i class="fas fa-envelope"></i>
                    <p><?php echo esc_html(get_theme_mod('solar_services_email_text')); ?></p>
                  </a>
                </li>
              <?php }?>
            </div>
            <div class="col-lg-3 col-md-3 social-icons align-self-center text-lg-end text-center">
              <?php if ( get_theme_mod('solar_services_twitt_link') != "") { ?>
                <a title="<?php echo esc_attr('twitter', 'solar-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('solar_services_twitt_link')); ?>"><i class="fab fa-twitter" aria-hidden="true"></i></a>
              <?php }?>
              <?php if ( get_theme_mod('solar_services_insta_link') != "") { ?>
                <a title="<?php echo esc_attr('instagram', 'solar-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('solar_services_insta_link')); ?>"><i class="fab fa-instagram" aria-hidden="true"></i></a>
              <?php }?>
              <?php if ( get_theme_mod('solar_services_pinterest_link') != "") { ?>
                <a title="<?php echo esc_attr('pinterest', 'solar-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('solar_services_pinterest_link')); ?>"><i class="fab fa-pinterest" aria-hidden="true"></i></a>
              <?php }?>
              <?php if ( get_theme_mod('solar_services_fb_link') != "") { ?>
                <a title="<?php echo esc_attr('facebook', 'solar-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('solar_services_fb_link')); ?>"><i class="fab fa-facebook-f" aria-hidden="true"></i></a> 
              <?php }?>
            </div>
          </div>
        </div>
      </div>
  <?php }?>
    <div class="bhead <?php echo esc_attr(solar_services_sticky_menu()); ?> py-lg-3 py-2">
      <div class="container">
        <div class="row">
          <div class="col-lg-3 col-md-4 align-self-center">
            <div class="solar-services-logo text-md-left text-lg-left py-2 py-md-0">
              <?php if (get_theme_mod('solar_services_logo_enable', true)) { ?>
                <?php solar_services_the_custom_logo(); ?>
              <?php } ?>
              <?php $blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $blog_info ) ) : ?>
                <?php if ( get_theme_mod('solar_services_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 endif; ?>
                <?php $solar_services_description = get_bloginfo( 'description', 'display' );
                if ( $solar_services_description || is_customize_preview() ) : ?>
                <span class="site-description"><?php echo esc_html( $solar_services_description ); ?></span>
            <?php endif; ?>
            </div>
          </div>
          <div class="col-lg-7 col-md-4 py-md-0 align-self-center">
            <div class="row menus" style="align-items: center;">
                <div class="toggle-nav text-center text-md-right my-2 my-md-0">
                  <button role="tab"><?php esc_html_e('MENU','solar-services'); ?></button>
                </div>
                <div id="mySidenav" class="nav sidenav text-right">
                  <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu','solar-services' ); ?>">
                    <?php wp_nav_menu( array( 
                        'theme_location' => 'primary',
                        'container_class' => 'main-menu clearfix' ,
                        'menu_class' => 'clearfix',
                        'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav">%3$s</ul>',
                        'fallback_cb' => 'wp_page_menu',
                      ) ); ?>
                    <a href="javascript:void(0)" class="close-button"><?php esc_html_e('CLOSE','solar-services'); ?></a>
                  </nav>
                </div>  
              </div>
            </div>  
            <?php if ( get_theme_mod('solar_services_headerbutton_txt') != "") { ?>
              <div class="col-lg-2 col-md-4 align-self-center">
                <div class="header-btn text-lg-end text-center">
                  <a class="contactus " href="<?php echo esc_url(get_theme_mod('solar_services_headerbutton_link')); ?>">
                    <?php echo esc_attr(get_theme_mod('solar_services_headerbutton_txt')); ?>  <i class="far fa-arrow-alt-circle-right"></i>

                    <div class="clear"></div>
                  </a>
                </div>
                </div> 
            <?php }?>   
        </div>
      </div>
    </div>
</div>