<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>

<header class="site-header" id="site-header">
    <div class="header-inner container">

        <div class="site-logo">
            <?php if ( has_custom_logo() ) : ?>
                <?php the_custom_logo(); ?>
            <?php else : ?>
                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-name-link">
                    <?php bloginfo( 'name' ); ?>
                </a>
            <?php endif; ?>
        </div>

        <button
            class="nav-toggle"
            aria-label="<?php esc_attr_e( 'Open navigation', 'municipio' ); ?>"
            aria-expanded="false"
            aria-controls="primary-nav"
        >
            <span></span>
            <span></span>
            <span></span>
        </button>

        <nav class="main-nav" id="primary-nav" aria-label="<?php esc_attr_e( 'Primary Navigation', 'municipio' ); ?>">
            <?php
            wp_nav_menu( [
                'theme_location' => 'primary',
                'menu_class'     => 'nav-list',
                'container'      => false,
                'fallback_cb'    => false,
            ] );
            ?>
        </nav>

        <div class="lang-selector" aria-label="<?php esc_attr_e( 'Language selector', 'municipio' ); ?>">
            <?php if ( function_exists( 'pll_the_languages' ) ) : ?>
                <ul class="lang-list">
                    <?php pll_the_languages( [ 'show_flags' => 0, 'show_names' => 1 ] ); ?>
                </ul>
            <?php endif; ?>
        </div>

    </div>
</header>
