<?php
/**
 * Site footer and the global newsletter CTA.
 *
 * @package Gustavo_Portfolio
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

get_template_part( 'template-parts/global/newsletter-cta' );
?>

<footer id="colophon" class="site-footer">
	<div class="site-shell site-footer__main">
		<div class="site-footer__brand">
			<div class="site-footer__brand-row">
				<?php gustavoo_portfolio_the_brand(); ?>
				<p class="site-footer__name"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></p>
			</div>
			<p><?php echo esc_html( gustavoo_portfolio_get_setting( 'hero_description' ) ); ?></p>
			<?php gustavoo_portfolio_social_links( 'social-links social-links--footer' ); ?>
		</div>

		<?php if ( has_nav_menu( 'footer' ) ) : ?>
			<nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Navegação do rodapé', 'gustavoo-portfolio' ); ?>">
				<?php
				wp_nav_menu(
					array(
						'theme_location' => 'footer',
						'menu_class'     => 'footer-menu',
						'container'      => false,
						'depth'          => 1,
						'fallback_cb'    => false,
					)
				);
				?>
			</nav>
		<?php endif; ?>
	</div>

	<div class="site-shell site-footer__bottom">
		<p>
			<?php
			printf(
				/* translators: 1: current year, 2: site name. */
				esc_html__( '© %1$s %2$s. Todos os direitos reservados.', 'gustavoo-portfolio' ),
				esc_html( wp_date( 'Y' ) ),
				esc_html( get_bloginfo( 'name' ) )
			);
			?>
		</p>
		<a href="#masthead" class="back-to-top"><?php esc_html_e( 'Voltar ao topo', 'gustavoo-portfolio' ); ?> <span aria-hidden="true">↑</span></a>
	</div>
</footer>

<?php
if ( is_front_page() ) {
	gustavoo_portfolio_the_whatsapp_float();
}
?>

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