<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Classic Law Firm
 */
?>
<!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_law_firm_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-law-firm' ); ?></a>

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

<div class="mainhead">
  <div class="main-header">
    <?php if (get_theme_mod('classic_law_firm_enable_topbar_section', true)) { ?>
      <div class="topbar">
        <div class="container">
          <div class="row m-0">
            <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-6 col-sm-6 col-12 d-flex location py-2">
              <?php if ( get_theme_mod('classic_law_firm_address_location') || get_theme_mod('classic_law_firm_location_title')) { ?>
                <i class="fa-solid fa-location-dot me-2"></i><a target="_blank" href="<?php echo esc_url(get_theme_mod('classic_law_firm_track_locatin_url')); ?>"><span class="location-title text-uppercase mb-0 me-2"><?php echo esc_html(get_theme_mod('classic_law_firm_location_title', 'classic-law-firm')) . '  :'; ?></span><span class="location-text"><?php echo esc_html(get_theme_mod('classic_law_firm_address_location')) ?></span></a> 
              <?php } ?>
            </div>
            <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-6 col-sm-6 col-12 d-flex email justify-content-center py-2">
              <?php if ( get_theme_mod('classic_law_firm_email_address') || get_theme_mod('classic_law_firm_email_title')) { ?>
                <i class="fa-solid fa-envelope-open-text me-2"></i><p class="mail-title text-uppercase mb-0 me-2"><?php echo esc_html(get_theme_mod('classic_law_firm_email_title', 'classic-law-firm')) . '  :'; ?></p><a class="mail" href="mailto:<?php echo esc_attr( get_theme_mod('classic_law_firm_email_address','') ); ?>"><?php echo esc_html(get_theme_mod ('classic_law_firm_email_address','')); ?></a>
              <?php } ?>
            </div>
            <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-6 col-sm-6 col-12 d-flex phone justify-content-center py-2">
              <?php if ( get_theme_mod('classic_law_firm_phone_number') || get_theme_mod('classic_law_firm_phone_title')) { ?>
                <i class="fas fa-phone me-2"></i><p class="phone-title text-uppercase mb-0 me-2"><?php echo esc_html(get_theme_mod('classic_law_firm_phone_title', 'classic-law-firm')) . '  :'; ?></p><a class="phone-no" href="tel:<?php echo esc_url( get_theme_mod('classic_law_firm_phone_number','' )); ?>"><?php echo esc_html(get_theme_mod ('classic_law_firm_phone_number','')); ?></a>
              <?php } ?>
            </div>
            <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-6 col-sm-6 col-12 align-self-center py-2 social-top-icons">
              <div class="social-icons d-flex gap-4 justify-content-end">
                <?php if ( get_theme_mod('classic_law_firm_fb_link') != "") { ?>
                  <a title="<?php echo esc_attr('facebook', 'classic-law-firm'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_law_firm_fb_link')); ?>"><i class="fa-brands fa-facebook-f"></i></a> 
                <?php } ?>
                <?php if ( get_theme_mod('classic_law_firm_youtube_link') != "") { ?> 
                  <a title="<?php echo esc_attr('youtube', 'classic-law-firm'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_law_firm_youtube_link')); ?>"><i class="fa-brands fa-youtube"></i></a>
                <?php } ?>
                <?php if ( get_theme_mod('classic_law_firm_instagram_link') != "") { ?>
                  <a title="<?php echo esc_attr('instagram', 'classic-law-firm'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_law_firm_instagram_link')); ?>"><i class="fa-brands fa-instagram"></i></a>
                <?php } ?>
                <?php if ( get_theme_mod('classic_law_firm_linkedin_link') != "") { ?> 
                  <a title="<?php echo esc_attr('linkedin', 'classic-law-firm'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_law_firm_linkedin_link')); ?>"><i class="fa-brands fa-linkedin-in"></i></a>
                <?php } ?>
                <?php if ( get_theme_mod('classic_law_firm_twitter_link') != "") { ?> 
                  <a title="<?php echo esc_attr('twitter', 'classic-law-firm'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_law_firm_twitter_link')); ?>"><i class="fa-brands fa-x-twitter"></i></a>
                <?php } ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    <?php } ?>
    <div class="header-sec <?php if( get_theme_mod( 'classic_law_firm_sticky_header', false) == 1 ) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
      <div class="container">
        <div class="row">
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-12 col-12 align-self-center">
            <div class="classic-law-firm-logo">
              <?php if (get_theme_mod('classic_law_firm_logo_enable', true)) { ?>
                <?php classic_law_firm_the_custom_logo(); ?>
              <?php } ?>
              <div class="site-branding-text">
                <?php if (get_theme_mod('classic_law_firm_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_law_firm_description = get_bloginfo('description', 'display');
                if ($classic_law_firm_description || is_customize_preview()) : ?>
                  <?php if (get_theme_mod('classic_law_firm_tagline_enable', false)) { ?>
                    <span class="site-description"><?php echo esc_html($classic_law_firm_description); ?></span>
                  <?php } ?>
                <?php endif; ?>
              </div>
            </div>
          </div>
          <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-4 col-sm-5 col-4 align-self-center">
            <div class="toggle-nav text-center">
              <?php if (has_nav_menu('primary')) { ?>
                <button role="tab"><?php esc_html_e('Menu', 'classic-law-firm'); ?></button>
              <?php } ?>
            </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-law-firm'); ?>">
                <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-law-firm'); ?></a>
              </nav>
            </div>
          </div>
          <div class="col-xxl-1 col-xl-1 col-lg-1 col-md-2 col-sm-2 col-2 align-self-center top-search">
            <div class="main-search d-inline-block">
              <span class="search-box text-center me-3">
                <button type="button" class="search-open"><i class="fas fa-search"></i></button>
              </span>
            </div>
            <div class="search-outer">
              <div class="serach_inner w-100 h-100">
                <?php get_search_form(); ?>
              </div>
              <button type="button" class="search-close"><span>X</span></button>
            </div>
          </div>
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-5 col-6 align-self-center text-end header-btn">
            <?php if ( get_theme_mod('classic_law_firm_header_btn_text') || get_theme_mod('classic_law_firm_header_btn_url')) { ?> 
              <a href="<?php echo esc_url(get_theme_mod ('classic_law_firm_header_btn_url','')); ?>"><?php echo esc_html(get_theme_mod ('classic_law_firm_header_btn_text','classic-law-firm')); ?></a>
            <?php }?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>