<?php

/**
 * Theme footer layouts
 * @package Glaciers
 * @since 1.0.0
 */

if (!defined('ABSPATH')) {
	exit; // Exit if accessed directly.
}

/* FOOTER LAYOUT
   ====================================================*/
if (!function_exists('glaciers_footer_layout')) :
	function glaciers_footer_layout()
	{
?>

		<section class="container">
			<div class="footer-content">
				<footer id="footer" class="site-footer row g-0">
					<div class="col-md-8">
						<?php // Footer Menu
						if (has_nav_menu('footer')) {
							echo '<nav aria-label="', esc_attr_e('Footer menu', 'glaciers'), '" id="footer-nav-wrapper">';

							wp_nav_menu(
								array(
									'theme_location' => 'footer',
									'menu_class'     => 'footer-nav',
									'container'         => 'ul',
									'depth'          => 1,
									'link_before'    => '<span>',
									'link_after'     => '</span>',
									'fallback_cb'    => false,
								)
							);
							echo '</nav>';
						}
						?>
						<?php esc_html_e('Copyright &copy;', 'glaciers'); ?><?php echo esc_html(date_i18n(__('Y', 'glaciers'))); ?>
						<span id="copyright-name"><?php echo esc_html(get_theme_mod('glaciers_copyright')); ?></span>.
						<?php esc_html_e('All rights reserved.', 'glaciers'); ?>
					</div>

					<?php // Social Menu
					if (has_nav_menu('social')) {
						echo '<div class="col-lg-4"><nav aria-label="', esc_attr_e('Social Menu', 'glaciers'), '" id="social-menu-wrapper">';
						wp_nav_menu(
							array(
								'menu_id'  => 'social-nav',
								'menu_class'     => 'social-menu',
								'theme_location' => 'social',
								'container'         => 'ul',
								'depth'          => 1,
								'link_before'    => '<span class="social-label visually-hidden">',
								'link_after'     => '</span>',
							)
						);
						echo '</nav></div>';
					}
					?>
				</footer>
			</div>
		</section>


<?php
	}
endif;

add_action('glaciers_footer', 'glaciers_footer_layout');
?>