
<nav class="navbar navbar-expand-xl">
  <div class="container">

    <?php if (get_theme_mod('thehoot_logo')) : ?>

      <a class="no-transition-link" href='<?php echo esc_url(home_url('/')); ?>' title='<?php echo esc_attr(get_bloginfo('name', 'display')); ?>' rel='home'>
        <img class="logo img-fluid" src='<?php echo esc_url(get_theme_mod('thehoot_logo')); ?>' alt='<?php echo esc_attr(get_bloginfo('description')); ?>'>
      </a>
      <?php else : ?>

        <a class="no-transition-link" href='<?php echo esc_url(home_url('/')); ?>' title='<?php echo esc_attr(get_bloginfo('name', 'display')); ?>' rel='home'>
          <?php bloginfo('name'); ?>
        </a>
        <h2 class='site-description'>
          <?php echo esc_html(get_bloginfo('description')); ?>
        </h2>

        <!--/.logo -->
        <?php endif; ?>

        <a href="#search" class="d-block d-xl-none search-link mobile no-transition-link">
          <i class="fas fa-search fa-lg"></i>
        </a>

          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <div class="navbar-toggler-inner"></div>
          </button>

          <div class="collapse navbar-collapse" id="navbarSupportedContent">

          <?php
            $walker = class_exists('bootstrap_5_wp_nav_menu_walker') ? new bootstrap_5_wp_nav_menu_walker() : null;
            wp_nav_menu(array(
              'menu'           => 'main-menu',
              'theme_location' => 'main-menu',
              'container'      => false,
              'menu_class'     => '',
              'fallback_cb'    => '__return_false',
                'items_wrap' => '<ul id="%1$s" class="navbar-nav me-auto mb-2 mb-md-0 ms-lg-3 %2$s">'
                                . '%3$s'
                                . '</ul>',
              'depth'          => 3,
              'walker'         => $walker
            ));
            
            if ( !function_exists('has_parent_category_slug') ) {
                function has_parent_category_slug($slug, $cat_id) {
                    $category = get_category($cat_id);
                    while ($category && $category->parent != 0) {
                        $category = get_category($category->parent);
                        if ($category && $category->slug === $slug) {
                            return true;
                        }
                    }
                    return false;
                }
            }

            if ( is_page_template( 'template-the-sheff.php' ) ) {
                get_template_part('inc/the-sheff-social-media');
            } else if ( is_category() && has_parent_category_slug('the-sheff', get_queried_object_id()) ) {
                get_template_part('inc/the-sheff-social-media');
            } else {
                get_template_part('inc/social-media');
            }
                ?>
                    <img class="weather-icon" alt="<?php echo esc_attr__('Current weather icon', 'text-domain'); ?>">
                    <span class="weather-temperature"></span>
                    
                  </div>
                </div>
      </div>
      </nav>
      <div class="container nav-border">
          <div class='w-100'>
            <div class="row">
              <div class="col-10 col-md-11">
                  <?php bloginfo('description'); ?>
              </div>

          <div class="col-2 col-md-1 d-flex flex-row-reverse">
              <?php get_template_part('/inc/nav-search'); ?>
            </div>
          </div>
            </div>
        </div>
