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

?>
<!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="#primary"><?php esc_html_e( 'Skip to content', 'go-mechanic' ); ?></a>
        <header id="masthead" class="site-header">
            <div class="container header-container site-headermargin">
                <div class="site-branding">
                    <?php if ( has_custom_logo() ) : ?>

                    <?php the_custom_logo(); ?>

                    <?php else : ?>

                    <h1 class="site-title">
                        <a href="<?php echo esc_url( home_url('/') ); ?>" rel="home">
                            <?php bloginfo('name'); ?>
                        </a>
                    </h1>

                    <?php endif; ?>
                </div>

                <div class="header-nav-wrapper">
                    <nav id="site-navigation" class="main-navigation">
                        <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
                            <i class="fa-solid mobile-nav-icon fa-caret-down"></i>
                            <i class="fa-solid fa-xmark mobile-nav-icon close"></i>
                        </button>
                        <?php
							wp_nav_menu(
								array(
									'theme_location' => 'menu-1',
									'menu_id'        => 'primary-menu',
									'menu_class'     => 'nav-menu',
									'container'      => false,
								)
							);
							?>
                    </nav><!-- #site-navigation -->

                    <a href="<?php echo esc_url( get_theme_mod( 'go_mechanic_appointment_url', '#' ) ); ?>"
                        class="book-appointment-btn">
                        <i class="fa-solid fa-calendar-check"></i>
                        <span><?php echo esc_html( get_theme_mod( 'go_mechanic_appointment_text', __( 'Book Appointment', 'go-mechanic' ) ) ); ?></span>
                    </a>
                </div><!-- .header-nav-wrapper -->

            </div>

        </header><!-- #masthead -->