<footer class="site-footer">
    <div class="container">
        <div class="footer-inner">

            <div class="footer-brand">
                <?php if ( has_custom_logo() ) : ?>
                    <?php the_custom_logo(); ?>
                <?php else : ?>
                    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="footer-site-name">
                        <?php bloginfo( 'name' ); ?>
                    </a>
                <?php endif; ?>
                <?php $desc = get_bloginfo( 'description' ); if ( $desc ) : ?>
                    <p class="footer-tagline"><?php echo esc_html( $desc ); ?></p>
                <?php endif; ?>
            </div>

            <?php if ( has_nav_menu( 'footer' ) ) : ?>
                <nav class="footer-nav" aria-label="<?php esc_attr_e( 'Footer Navigation', 'municipio' ); ?>">
                    <?php
                    wp_nav_menu( [
                        'theme_location' => 'footer',
                        'menu_class'     => 'footer-nav-list',
                        'container'      => false,
                        'fallback_cb'    => false,
                    ] );
                    ?>
                </nav>
            <?php endif; ?>

        </div>

        <div class="footer-bottom">
            <p class="footer-copy">
                <?php
                $footer_text = get_theme_mod( 'municipio_footer_text', '' );
                echo esc_html( $footer_text ?: '&copy; ' . gmdate( 'Y' ) . ' ' . get_bloginfo( 'name' ) );
                ?>
            </p>
        </div>
    </div>
</footer>

<?php wp_footer(); ?>
</body>
</html>
