<?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 cleanlogic
 */

?>
</div>
</div>
<!-- #content -->

<footer id="colophon" class="site-footer" role="contentinfo">
        <div class="site-info"><?php
                                $social_links = array(
                                        'Facebook'  => get_theme_mod('Facebook'),
                                        'Instagram' => get_theme_mod('Instagram'),
                                        'Linkedin'  => get_theme_mod('Linkedin'),
                                        'Twitter'   => get_theme_mod('Twitter'),
                                );

                                // Build class safely for the wrapper.
                                $has_social = (bool) array_filter($social_links);
                                $wrap_class = trim('wrap' . ($has_social ? ' social-link' : ''));

                                ?>
                <div class="<?php echo esc_attr($wrap_class); ?>">
                        <div class="row-site-info">
                                <span>&copy; <?php echo esc_html(date_i18n('Y')); ?></span>
                                <span class="sep"> | </span>
                                <?php echo esc_html__('CleanLogic WordPress Theme', 'cleanlogic'); ?>
                                <span class="sep"> | </span>
                                <?php echo esc_html__('By LogicRays Technologies', 'cleanlogic'); ?>
                        </div>
                        <?php

                        if (array_filter($social_links)) :
                        ?>
                                <div class="footer-right">
                                        <ul class="alignleft">
                                                <?php if (get_theme_mod('Facebook')) : ?>
                                                        <li class="social-facebook"><a href="<?php echo esc_url(get_theme_mod('Facebook')); ?>" target="_blank"><i class="fa fa-facebook"></i></a> </li>
                                                <?php endif; ?>
                                                <?php if (get_theme_mod('Instagram')) : ?>
                                                        <li class="social-instgram"><a href="<?php echo esc_url(get_theme_mod('Instagram')); ?>" target="_blank"><i class="fa fa-instagram"></i></a></li>
                                                <?php endif; ?>

                                                <?php if (get_theme_mod('Linkedin')) : ?>
                                                        <li class="social-linkedin"><a href="<?php echo esc_url(get_theme_mod('Linkedin')); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
                                                <?php endif; ?>
                                                <?php if (get_theme_mod('Twitter')) : ?>
                                                        <li class="social-twitter"><a href="<?php echo esc_url(get_theme_mod('Twitter')); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
                                                <?php endif; ?>
                                        </ul>
                                </div>
                        <?php endif; ?>
                </div>
        </div>
        <!-- .site-info -->
</footer>
<!-- #colophon -->
</div>
<!-- #page -->
<?php wp_footer(); ?>

</body>

</html>