<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Lusy_Photography_Portfolio
 */

?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">

	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
	<a class="skip-link screen-reader-text" href="#primary"><?php esc_html_e( 'Skip to content', 'lusy-photography-portfolio' ); ?></a>
 <!-- Preloader 
  
	<div class="preloader-bg"></div>
    <div id="preloader">
        <div id="preloader-status">
            <div class="preloader-position loader"> <span></span> </div>
        </div>
    </div> -->

    <!-- Progress-wrapp scroll-button -->
    <div class="progress-wrap">
        <svg class="progress-circle svg-content" width="100%" height="100%" viewBox="-1 -1 102 102">
            <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98" /> </svg>
    </div>

	<!-- Navbar -->
<nav id="site-navigation" class="navbar navbar-expand-lg">
<div class="container">
        <!-- Logo -->
        <?php $custom_logo_id = get_theme_mod( 'custom_logo' );
            $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
            if ( has_custom_logo() ) {
                echo '<div class="logo-wrapper valign"> <div class="logo"> <a class="lusy-logo" href="' . esc_url( home_url( '/' ) ) . '">
            <img src="' . esc_url( $logo[0] ) . '" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '">
      </a> </div></div>';
            } else {
                echo '<a href="' . esc_url( home_url( '/' ) ) . '"><h3 class="test-logo">' . get_bloginfo('name') . '</h3></a>'; 
            } ?>

        <!-- Burger Button for Mobile with Focus Outline -->
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false"
                aria-label="<?php esc_attr_e( 'Toggle navigation', 'lusy-photography-portfolio' ); ?>">
            <span class="icon-bar"><i class="ti-plus"></i></span>
        </button>
        <!-- Menu -->
        <div class="collapse navbar-collapse" id="navbarSupportedContent" aria-hidden="true" tabindex="-1">
            <!-- Close Button Inside Navbar Collapse with Focus Outline -->
            <button class="close-menu" aria-label="<?php esc_attr_e( 'Close Menu', 'lusy-photography-portfolio' ); ?>">
                <i class="fa fa-close"></i>
            </button>
        <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">Primary Menu</button>
            <?php
                wp_nav_menu( array(
                    'theme_location' => 'menu-1',
                    'container'      => false,
                    'menu_id'        => 'primary-menu',
                    'menu_class'     => 'navbar-nav ml-auto',
                    'walker'         => new Lusy_Photography_Portfolio_Custom_Walker_Nav_Menu(),
                    'fallback_cb'    => 'lusy_photography_portfolio_custom_menu_fallback',
                ) );
            ?>
        </div> <!-- #end-menu -->

        <?php
            function lusy_photography_portfolio_custom_menu_fallback() {
                if (current_user_can('manage_options')) {
                    echo '<ul class="navbar-nav ml-auto">';
                    echo '<li><a href="' . esc_url(admin_url('nav-menus.php')) . '">' . esc_html__('Click here to add a menu', 'lusy-photography-portfolio') . '</a></li>';
                    echo '</ul>';
                }
            }
        ?>
    </div><!-- #site-container -->
</nav><!-- #site-navigation -->

	