<header class="main-header">
	<?php 
	  $expert_author_header = get_theme_mod('expert_author_header_setting','1');
	  
	  if($expert_author_header == '1') {
	?>
  	<div class="upper-header-area wow fadeInDown" data-wow-delay="0.5s">
  		<div class="container">
    		<?php
				$expert_author_social_media_facebook = get_theme_mod('expert_author_social_media_facebook','#');
				$expert_author_social_media_twitter = get_theme_mod('expert_author_social_media_twitter','#');
				$expert_author_social_media_instagram = get_theme_mod('expert_author_social_media_instagram','#');
				$expert_author_social_media_linkedin = get_theme_mod('expert_author_social_media_linkedin','#');
				$expert_author_social_media_youtube = get_theme_mod('expert_author_social_media_youtube','#');

				$expert_author_topheader_text = get_theme_mod( 'expert_author_topheader_text','Almost before we knew it, we had left the ground.' );

			?>
			<div class="row">
				<div class="col-lg-8 col-md-6 text-md-start text-center align-self-center">
					<?php if( $expert_author_topheader_text != ''){?>
            		<p class="mb-md-0 mb-2 offer-text"><i class="fas fa-volume-up me-2"></i><?php echo esc_html( apply_filters('expert_author_topheader', $expert_author_topheader_text)); ?></p>
          			<?php } ?>
        		</div>
				<div class="col-lg-4 col-md-6 text-md-end text-center align-self-center social-media">
					<span class="mb-0"><?php echo esc_html( apply_filters('expert_author_topheader', 'Connect With Us-')); ?></span>
					<?php if( $expert_author_social_media_facebook != ''){?>
						<a class="me-3" href="<?php echo esc_url( apply_filters('expert_author_topheader', $expert_author_social_media_facebook)); ?>"><i class="fab fa-facebook-f"></i></a>
					<?php }?>
					<?php if( $expert_author_social_media_twitter != ''){?>
						<a class="me-3" href="<?php echo esc_url( apply_filters('expert_author_topheader', $expert_author_social_media_twitter)); ?>"><i class="fab fa-twitter"></i></a>
					<?php }?>
					<?php if( $expert_author_social_media_instagram != ''){?>
						<a class="me-3" href="<?php echo esc_url( apply_filters('expert_author_topheader', $expert_author_social_media_instagram)); ?>"><i class="fab fa-instagram"></i></a>
					<?php }?>
					<?php if( $expert_author_social_media_linkedin != ''){?>
						<a class="me-3" href="<?php echo esc_url( apply_filters('expert_author_topheader', $expert_author_social_media_linkedin)); ?>"><i class="fab fa-linkedin-in"></i></a>
					<?php }?>
					<?php if( $expert_author_social_media_youtube != ''){?>
						<a href="<?php echo esc_url( apply_filters('expert_author_topheader', $expert_author_social_media_youtube)); ?>"><i class="fab fa-youtube"></i></a>
					<?php }?>
				</div>
			</div>
		</div>
	</div>
	<?php }?>
	<div class="<?php if( get_theme_mod( 'expert_author_sticky_header') != '') { ?>sticky-header<?php } else { ?>close-sticky<?php } ?>">
		<div class="center-header-area py-3">
			<div class="container">
				<div class="row">
					<div class="col-lg-3 col-md-3 align-self-center">
						<div class="logo">
						<?php 
                            if (has_custom_logo()) {
                                the_custom_logo();
                            } else {
                                // Check if both title and tagline settings are disabled
                                $expert_author_tagline_enabled = get_theme_mod('expert_author_tagline_setting', false);
                                $expert_author_title_enabled = get_theme_mod('expert_author_site_title_setting', false);

                                if (!$expert_author_tagline_enabled && !$expert_author_title_enabled) {
                                    // Display the default logo
                                    $expert_author_default_logo_url = get_template_directory_uri() . '/assets/images/logo.png'; // Replace with your default logo path
                                    echo '<a href="' . esc_url(home_url('/')) . '">';
                                    echo '<img src="' . esc_url($expert_author_default_logo_url) . '" alt="' . esc_attr(get_bloginfo('name')) . '">';
                                    echo '</a>';
                                }

                                // Display tagline if the setting is enabled
                                if ($expert_author_tagline_enabled) :
                                    $expert_author_site_desc = get_bloginfo('description'); ?>
                                    <p class="site-description"><?php echo esc_html($expert_author_site_desc); ?></p>
                                <?php endif; ?>

                                <?php
                                // Display site title if the setting is enabled
                                if ($expert_author_title_enabled) : ?>
                                    <p class="site-title">
                                        <a href="<?php echo esc_url(home_url('/')); ?>">
                                            <?php echo esc_html(get_bloginfo('name')); ?>
                                        </a>
                                    </p>
                                <?php endif; ?>
                            <?php } ?>
						</div>
					</div>
					<div class="col-lg-7 col-md-7 col-6 align-self-center">
						<!-- Main menu -->
                        <div class="navbar-menubar responsive-menu navigation_header">
                            <div class="toggle-nav mobile-menu">
                                <button onclick="expert_author_openNav()">
                                    <i class="fa fa-bars"></i> <!-- Initial hamburger icon -->
                                </button>
                            </div>
                            <div id="mySidenav" class="nav sidenav">
                                <nav id="site-navigation" class="main-navigation navbar navbar-expand-xl" aria-label="<?php esc_attr_e( 'Top Menu', 'expert-author' ); ?>">

                                    <?php 
                                        wp_nav_menu(
                                            array(
                                                'theme_location' => 'primary',
                                                'container_class' => 'main-menu clearfix',
                                                'menu_class' => 'clearfix menu',
                                                '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="closebtn mobile-menu" onclick="expert_author_closeNav()">
                                        <i class="fa fa-times"></i> <!-- Close icon for the menu -->
                                    </a>
                                </nav>
                            </div>
                        </div>
					</div>
					<div class="col-lg-2 col-md-2 col-6 align-self-center text-center text-md-end">
						<?php 
						
							$expert_author_sign_in_text = get_theme_mod( 'expert_author_sign_in_text','Sign In' );
							$expert_author_sign_in_link = get_theme_mod( 'expert_author_sign_in_link' );

						if( $expert_author_sign_in_text != '' || $expert_author_sign_in_link != '' ){?>
            				<a href="<?php echo esc_html( apply_filters('expert_author_topheader', $expert_author_sign_in_link)); ?>" class="offer-text"><?php echo esc_html( apply_filters('expert_author_topheader', $expert_author_sign_in_text)); ?></a>
          				<?php } ?>
					</div>
				</div>
			</div>
		</div>
  	</div>
</header>