<?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 wheelify
*/
?>

<!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(); ?>
<div id="page" class="site">
	<a class="skip-link screen-reader-text" href="#container"><?php esc_html_e( 'Skip to Content', 'wheelify' ); ?></a>

    <!-- desktop-menu -->
    <div class="row first-menu navbar-dark bg-dark <?php 
                    if ( !has_nav_menu( 'primary' ) ) : echo "mobileoff"; endif;?>">
        <div class="container">
            <nav class="navbar navbar-expand-sm offcanvas-desktop">
                <div class="col-md-3 ">
                    <?php if(has_custom_logo())  { ?>
                        <?php the_custom_logo(); ?>
                    <?php } ?>
                        <div class="logo">
                            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                               
                            <?php
                            $wheelify_description = get_bloginfo( 'description', 'display' );
                            if ( $wheelify_description || is_customize_preview() ) :
                                ?>
                                <p class="site-description"> <?php bloginfo('description'); ?></p>
                            <?php endif; ?>
                        </div>
                </div>
                <div class="col-md-9 collapse navbar-collapse">
                    <?php 
                        wp_nav_menu( array (
                            'container'      => 'ul',
                            'theme_location' => 'primary',
                            'before'         => '',
                            'items_wrap'     => '<ul class="navbar-nav">%3$s</ul>',
                            'walker'         =>  new wheelifyCustomNavWalker(),
                            'fallback_cb'    => 'wheelify_primary_navigation_fallback',
                            ) 
                        );
                    ?>                    
                </div>
            </nav>
        </div>
    </div>
    <!-- desktop-menu -->

    <?php $custom_logo_id = get_theme_mod( 'custom_logo' ); 
    $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
    if ( has_custom_logo() ) { 
    ?>
        <div class="mobile-menu" data-type="logo" data-link="<?php echo esc_attr( home_url('/') ); ?>" data-logo="<?php echo esc_attr( $logo[0] ); ?>"> </div>
    <?php } else{ ?>
        <div class="mobile-menu" data-type="text" data-link="<?php echo esc_attr( home_url('/') ); ?>" data-logo="<?php bloginfo( 'name' ); ?>"> </div>
    <?php } ?>