<!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 if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
    <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
<?php endif; ?>

    <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
    <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'nexo' ); ?></a>

    <header class="header">
        <div class="header__container">
            <div class="header__branding">
                <?php
                if ( has_custom_logo() ) :
                    the_custom_logo();
                else :
                    ?>
                    <h3 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h3>
                    <?php
                    $description = get_bloginfo( 'description', 'display' );
                    if ( $description || is_customize_preview() ) :
                        ?>
                        <p class="site-description"><?php echo $description; ?></p>
                    <?php endif; ?>
                <?php endif; ?>
            </div><!-- .header__branding -->
        
            <?php if (get_theme_mod('nexo_show_search', false)) :?>
                <div class="search">
                    <svg class="lente-search" xmlns="http://www.w3.org/2000/svg" height="30" width="30" viewBox="0 0 512 512"><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>
                    <?php get_search_form(); ?>
                </div>
            <?php endif; ?>

            <button id="mobile-menu-toggle" class="hamburger" aria-expanded="false" aria-controls="mobile-menu" aria-label="<?php esc_attr_e( 'Open/Close mobile menu', 'nexo' ); ?>">
                <span></span>
                <span></span>
            </button>

            <?php
            wp_nav_menu(array(
                'theme_location' => 'primary',
                'container'      => 'ul',
                'walker'         => new Nexo_Walker_Nav_Menu(), // Iniezione del walker
                'items_wrap'     => '<ul class="%2$s" aria-label="' . esc_attr__( 'Primary Menu', 'nexo' ) . '">%3$s</ul>',
            ));
            ?>
        </div>
    </header>

<main id="content" class="main">
