<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package aac
 */

 $top_footer = get_field('top_footer_box', 'option');
 $bottom_footer = get_field('bootom_footer_box', 'option');

 $top_footer_col1 = $top_footer['col_1'];
 $top_footer_col2 = $top_footer['col_2'];
 $top_footer_col3 = $top_footer['col_3'];
 $top_footer_col4 = $top_footer['col_4'];
?>

	<footer id="colophon" class="site-footer">
		<div class="container">
			<div class="site-footer--wrapper">
				<div class="row row-1">
					<div class="col col-1">
						<div class="col-title">
							<h3><?php echo $top_footer_col1['title']; ?></h3>
						</div>
						<ul>
							<?php foreach ($top_footer_col1['links'] as $item) : ?>
								<li>
									<a href="<?php echo esc_url($item['link']['url']); ?>" target="<?php echo esc_attr($item['link']['target'] ?: '_self'); ?>">
										<?php echo $item['link']['title']; ?>
									</a>
								</li>
							<?php endforeach; ?>
						</ul>
					</div>
					<div class="col col-2">
						<div class="col-title">
							<h3><?php echo $top_footer_col2['title']; ?></h3>
						</div>
						<ul>
							<?php foreach ($top_footer_col2['links'] as $item) : ?>
								<li>
									<a href="<?php echo esc_url($item['link']['url']); ?>" target="<?php echo esc_attr($item['link']['target'] ?: '_self'); ?>">
										<?php echo $item['link']['title']; ?>
									</a>
								</li>
							<?php endforeach; ?>
						</ul>
					</div>
					<div class="col col-3">
						<div class="col-title">
							<h3><?php echo $top_footer_col3['title']; ?></h3>
						</div>
						<ul>
							<?php foreach ($top_footer_col3['links'] as $item) : ?>
								<li>
									<a href="<?php echo esc_url($item['link']['url']); ?>" target="<?php echo esc_attr($item['link']['target'] ?: '_self'); ?>">
										<?php echo $item['link']['title']; ?>
									</a>
								</li>
							<?php endforeach; ?>
						</ul>
					</div>
					<div class="col col-4">
						<div class="col-title">
							<h3><?php echo $top_footer_col4['title']; ?></h3>
						</div>
						<div class="col-text">
							<?php echo $top_footer_col4['description']; ?>
						</div>
					</div>
				</div>
				<div class="row row-2">
					<div class="col col-1">
						<ul>
							<li>
								<?php echo $bottom_footer['copyright']; ?>
							</li>
							<li>
								<a href="<?php echo esc_url($bottom_footer['privacy_policy']['url']); ?>" target="<?php echo esc_attr($bottom_footer['privacy_policy']['target'] ?: '_self'); ?>">
									<?php echo $bottom_footer['privacy_policy']['title']; ?>
								</a>
							</li>
						</ul>
					</div>
					<div class="col col-2">
						<ul>
							<li>
								<?php echo $bottom_footer['implementation']; ?>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</footer><!-- #colophon -->
</div><!-- #page -->

<?php wp_footer(); ?>

</body>
</html>
