<?php

/**
 * The file for header all actions
 *
 *
 * @package Blog Eye
 */

function blog_eye_header_menu_output()
{
?>
	<nav id="site-navigation" class="main-navigation">
		<?php
		wp_nav_menu(array(
			'theme_location' => 'main-menu',
			'menu_id'        => 'blog-eye-menu',
			'menu_class'        => 'blog-eye-menu',
		));
		?>
	</nav><!-- #site-navigation -->
<?php
}
add_action('blog_eye_main_menu', 'blog_eye_header_menu_output');


function blog_eye_header_logo_output()
{
	$blog_eye_site_tagline_show = get_theme_mod('blog_eye_site_tagline_show');

?>

	<?php if (has_custom_logo()) : ?>
		<div class="site-branding brand-logo">
			<?php
			the_custom_logo();
			?>
		</div>
	<?php endif; ?>
	<?php
	if (display_header_text() == true || (display_header_text() == true && is_customize_preview())) : ?>
		<div class="site-branding brand-text">
			<?php if (display_header_text() == true || (display_header_text() == true && is_customize_preview())) : ?>
				<h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
				<?php
				$blog_eye_description = get_bloginfo('description', 'display');
				if (($blog_eye_description || is_customize_preview()) && empty($blog_eye_site_tagline_show)) :
				?>
					<p class="site-description"><?php echo $blog_eye_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 
												?></p>
				<?php endif; ?>
			<?php endif; ?>

		</div><!-- .site-branding -->
	<?php endif; ?>

<?php
}
add_action('blog_eye_header_logo', 'blog_eye_header_logo_output');




// header style one
function blog_eye_header_style_one()
{
?>
	<div class="container pxm-style1">
		<div class="navigation mx-4">
			<div class="d-flex">
				<div class="pxms1-logo">
					<?php do_action('blog_eye_header_logo'); ?>
				</div>
				<div class="pxms1-menu ms-auto">
					<?php do_action('blog_eye_main_menu'); ?>
				</div>
			</div>
		</div>
	</div>


<?php
}
add_action('blog_eye_header_style_one', 'blog_eye_header_style_one');

// header style one
function blog_eye_header_style_two()
{

?>
	<div class="blog-eye-logo-section">
		<div class="container">
			<div class="head-logo-sec">
				<?php do_action('blog_eye_header_logo'); ?>
			</div>
		</div>
	</div>

	<div class="menu-bar text-center">
		<div class="container">
			<div class="blog-eye-container menu-inner">
				<?php do_action('blog_eye_main_menu'); ?>
			</div>
		</div>
	</div>
<?php
}
add_action('blog_eye_header_style_two', 'blog_eye_header_style_two');


// Blog Eye mobile menu
function blog_eye_mobile_menu_output()
{
?>
	<div class="mobile-menu-bar">
		<div class="container">
			<div class="mobile-menu-header">
				<div class="mobile-brand">
					<?php if (has_custom_logo()) : ?>
						<?php the_custom_logo(); ?>
					<?php else : ?>
						<a href="<?php echo esc_url(home_url('/')); ?>" class="site-title" rel="home"><?php bloginfo('name'); ?></a>
					<?php endif; ?>
				</div>
				<button id="mmenu-btn" class="hamburger-btn" aria-expanded="false" aria-label="<?php esc_attr_e('Toggle mobile menu', 'blog-eye'); ?>">
					<span class="hamburger-line"></span>
					<span class="hamburger-line"></span>
					<span class="hamburger-line"></span>
				</button>
			</div>
		</div>
	</div>
	<div id="mobile-menu-overlay" class="mobile-menu-overlay"></div>
	<nav id="mobile-navigation" class="mobile-nav-drawer" aria-label="<?php esc_attr_e('Mobile Navigation', 'blog-eye'); ?>">
		<div class="mobile-nav-header">
			<span class="mobile-nav-title"><?php esc_html_e('Menu', 'blog-eye'); ?></span>
			<button id="mmenu-close" class="mobile-nav-close" aria-label="<?php esc_attr_e('Close menu', 'blog-eye'); ?>">
				<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
			</button>
		</div>
		<div class="mobile-nav-body">
			<?php
			wp_nav_menu(array(
				'theme_location' => 'main-menu',
				'menu_id'        => 'wsm-menu',
				'menu_class'     => 'wsm-menu',
				'container'      => false,
			));
			?>
		</div>
	</nav>

<?php
}
add_action('blog_eye_mobile_menu', 'blog_eye_mobile_menu_output');
