<?php
/**
 * The footer template.
 *
 * Closes the main content area and displays the footer.
 *
 * @package Eshraq_Portfolio
 * @since 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
	</main><!-- .site-main -->

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

			<div class="footer-grid">
				<div class="footer-copyright">
					<?php
					$copyright = get_theme_mod( 'eshraq_copyright', '' );
					if ( ! empty( $copyright ) ) {
						echo '<span>' . esc_html( $copyright ) . '</span>';
					} else {
						printf(
							'<span>&copy; All rights reserved. %s</span>',
							esc_html( gmdate( 'Y' ) )
						);
					}
					?>
				</div>

				<?php if ( has_nav_menu( 'footer' ) ) : ?>
				<nav class="footer-nav" aria-label="<?php esc_attr_e( 'Footer Navigation', 'eshraq-portfolio' ); ?>">
					<?php
					wp_nav_menu( array(
						'theme_location' => 'footer',
						'container'      => false,
						'menu_class'     => 'footer-nav-list',
						'depth'          => 1,
					) );
					?>
				</nav>
				<?php endif; ?>

				<div class="footer-credit">
					<?php
					$credit_text = get_theme_mod( 'eshraq_credit_text', 'Theme by' );
					$credit_url  = get_theme_mod( 'eshraq_credit_url', 'https://eshraq.dev' );
					$credit_name = get_theme_mod( 'eshraq_credit_name', 'Eshraq' );
					printf(
						'<span>%s <a href="%s" target="_blank" rel="noopener noreferrer">%s</a></span>',
						esc_html( $credit_text ),
						esc_url( $credit_url ),
						esc_html( $credit_name )
					);
					?>
				</div>
			</div>

		</div>
	</footer>

</div><!-- .site-wrapper -->

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