<?php
/**
 * Modern Footer
 *
 * @package Your_Theme
 */
?>

<footer class="site-footer modern-site-footer">

    <!-- Footer CTA -->
    <div class="modern-footer-cta">

        <div class="container">

            <div class="modern-footer-cta-inner">

                <div class="modern-footer-cta-content">

                    <span class="modern-footer-kicker">
                        <?php esc_html_e( 'Let’s Stay Connected', 'ca-charity-hope' ); ?>
                    </span>

                    <h2>
                        <?php esc_html_e( 'Everything You Need, All in One Place.', 'ca-charity-hope' ); ?>
                    </h2>

                    <p>
                        <?php esc_html_e( 'Explore our latest updates, useful resources and everything else you need to stay connected.', 'ca-charity-hope' ); ?>
                    </p>

                </div>

                <div class="modern-footer-cta-shape">
                    <span></span>
                    <span></span>
                    <span></span>
                </div>

            </div>

        </div>

    </div>


    <!-- Main Footer -->
    <div class="modern-footer-main">

        <div class="container">

            <div class="row g-4">

                <!-- Column 1 -->
                <div class="col-xl-4 col-lg-4 col-md-12">

                    <div class="modern-footer-about">

                        <div class="modern-footer-logo">

                            <?php
                            if ( has_custom_logo() ) {
                                the_custom_logo();
                            } else {
                                ?>

                                <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
                                    <?php bloginfo( 'name' ); ?>
                                </a>

                                <?php
                            }
                            ?>

                        </div>

                        <p>
                            <?php
                            bloginfo( 'description' );
                            ?>
                        </p>

                        <div class="modern-footer-social">

                            <a href="#" aria-label="<?php esc_attr_e( 'Facebook', 'ca-charity-hope' ); ?>">
                                <span class="dashicons dashicons-facebook"></span>
                            </a>

                            <a href="#" aria-label="<?php esc_attr_e( 'Twitter', 'ca-charity-hope' ); ?>">
                                <span class="dashicons dashicons-twitter"></span>
                            </a>

                            <a href="#" aria-label="<?php esc_attr_e( 'Instagram', 'ca-charity-hope' ); ?>">
                                <span class="dashicons dashicons-camera"></span>
                            </a>

                        </div>

                    </div>

                </div>


                <!-- Widget 1 -->
                <div class="col-xl-3 col-lg-3 col-md-6">

                    <div class="modern-footer-column">

                        <?php if ( is_active_sidebar( 'footer_widget_area1' ) ) : ?>

                            <?php dynamic_sidebar( 'footer_widget_area1' ); ?>

                        <?php endif; ?>

                    </div>

                </div>


                <!-- Widget 2 -->
                <div class="col-xl-2 col-lg-2 col-md-6">

                    <div class="modern-footer-column">

                        <?php if ( is_active_sidebar( 'footer_widget_area2' ) ) : ?>

                            <?php dynamic_sidebar( 'footer_widget_area2' ); ?>

                        <?php endif; ?>

                    </div>

                </div>


                <!-- Widget 3 -->
                <div class="col-xl-3 col-lg-3 col-md-12">

                    <div class="modern-footer-column">

                        <?php if ( is_active_sidebar( 'footer_widget_area3' ) ) : ?>

                            <?php dynamic_sidebar( 'footer_widget_area3' ); ?>

                        <?php endif; ?>

                    </div>

                </div>

            </div>

        </div>

    </div>


    <!-- Bottom Bar -->
    <div class="modern-footer-bottom">

        <div class="container">

            <div class="modern-footer-bottom-inner">

                <div class="modern-footer-copyright">

                    &copy; <?php echo esc_html( gmdate( 'Y' ) ); ?>

                    <?php bloginfo( 'name' ); ?>.

                    <?php esc_html_e( 'All Rights Reserved.', 'ca-charity-hope' ); ?>

                </div>


                <div class="modern-footer-legal">

                    <?php
                    $privacy_policy_url = get_privacy_policy_url();

                    if ( $privacy_policy_url ) :
                        ?>

                        <a href="<?php echo esc_url( $privacy_policy_url ); ?>">
                            <?php esc_html_e( 'Privacy Policy', 'ca-charity-hope' ); ?>
                        </a>

                    <?php endif; ?>


                    <?php
                    $terms_page = get_page_by_path( 'terms-and-conditions' );

                    if ( $terms_page ) :
                        ?>

                        <a href="<?php echo esc_url( get_permalink( $terms_page->ID ) ); ?>">
                            <?php esc_html_e( 'Terms & Conditions', 'ca-charity-hope' ); ?>
                        </a>

                    <?php endif; ?>


                    <?php
                    $cookie_page = get_page_by_path( 'cookie-policy' );

                    if ( $cookie_page ) :
                        ?>

                        <a href="<?php echo esc_url( get_permalink( $cookie_page->ID ) ); ?>">
                            <?php esc_html_e( 'Cookie Policy', 'ca-charity-hope' ); ?>
                        </a>

                    <?php endif; ?>


                    <?php
                    $disclaimer_page = get_page_by_path( 'disclaimer' );

                    if ( $disclaimer_page ) :
                        ?>

                        <a href="<?php echo esc_url( get_permalink( $disclaimer_page->ID ) ); ?>">
                            <?php esc_html_e( 'Disclaimer', 'ca-charity-hope' ); ?>
                        </a>

                    <?php endif; ?>

                </div>

            </div>

        </div>

    </div>

</footer>


<button
    type="button"
    class="modern-back-to-top"
    aria-label="<?php esc_attr_e( 'Back to top', 'ca-charity-hope' ); ?>"
>
    <span class="back-to-top-arrow">↑</span>
    <span class="back-to-top-text">
        <?php esc_html_e( 'Top', 'ca-charity-hope' ); ?>
    </span>
</button>
