<?php
/**
* The template for displaying the footer
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package GridRead WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
* @author ThemesDNA <themesdna@gmail.com>
*/
?>

</div>

</div><!--/#gridread-content-wrapper -->
</div><!--/#gridread-wrapper -->

<?php gridread_bottom_wide_widgets(); ?>

<?php gridread_before_footer(); ?>

<?php if ( !(gridread_hide_footer_widgets()) ) { ?>
<?php if ( is_active_sidebar( 'gridread-footer-1' ) || is_active_sidebar( 'gridread-footer-2' ) || is_active_sidebar( 'gridread-footer-3' ) || is_active_sidebar( 'gridread-footer-4' ) || is_active_sidebar( 'gridread-top-footer' ) || is_active_sidebar( 'gridread-bottom-footer' ) ) : ?>
<div class="gridread-clearfix" id="gridread-footer-blocks" itemscope="itemscope" itemtype="http://schema.org/WPFooter" role="contentinfo">
<div class="gridread-clearfix">
<div class="gridread-boxview-wrapper">

<?php if ( is_active_sidebar( 'gridread-top-footer' ) ) : ?>
<div class="gridread-clearfix">
<div class="gridread-top-footer-block">
<?php dynamic_sidebar( 'gridread-top-footer' ); ?>
</div>
</div>
<?php endif; ?>

<?php if ( is_active_sidebar( 'gridread-footer-1' ) || is_active_sidebar( 'gridread-footer-2' ) || is_active_sidebar( 'gridread-footer-3' ) || is_active_sidebar( 'gridread-footer-4' ) ) : ?>
<div class="gridread-footer-block-cols gridread-clearfix">

<div class="gridread-footer-block-col gridread-footer-4-col" id="gridread-footer-block-1">
<?php dynamic_sidebar( 'gridread-footer-1' ); ?>
</div>

<div class="gridread-footer-block-col gridread-footer-4-col" id="gridread-footer-block-2">
<?php dynamic_sidebar( 'gridread-footer-2' ); ?>
</div>

<div class="gridread-footer-block-col gridread-footer-4-col" id="gridread-footer-block-3">
<?php dynamic_sidebar( 'gridread-footer-3' ); ?>
</div>

<div class="gridread-footer-block-col gridread-footer-4-col" id="gridread-footer-block-4">
<?php dynamic_sidebar( 'gridread-footer-4' ); ?>
</div>

</div>
<?php endif; ?>

<?php if ( is_active_sidebar( 'gridread-bottom-footer' ) ) : ?>
<div class="gridread-clearfix">
<div class="gridread-bottom-footer-block">
<?php dynamic_sidebar( 'gridread-bottom-footer' ); ?>
</div>
</div>
<?php endif; ?>

</div>
</div>
</div><!--/#gridread-footer-blocks-->
<?php endif; ?>
<?php } ?>

<?php if ( gridread_is_social_buttons_active() ) { ?>
<?php gridread_footer_social_buttons(); ?>
<div id="gridread-search-overlay-wrapper" class="gridread-search-overlay">
  <div class="gridread-search-overlay-content">
    <?php get_search_form(); ?>
  </div>
  <button class="gridread-search-closebtn" aria-label="<?php esc_attr_e( 'Close Search', 'gridread' ); ?>" title="<?php esc_attr_e('Close Search','gridread'); ?>">&#xD7;</button>
</div>
<?php } ?>

<div class='gridread-clearfix' id='gridread-copyright-area'>
<div class='gridread-copyright-area-inside gridread-clearfix'>
<div class="gridread-boxview-wrapper">

<div class='gridread-copyright-area-inside-content gridread-clearfix'>
<?php if ( gridread_get_option('footer_text') ) : ?>
  <p class='gridread-copyright'><?php echo wp_kses_post( force_balance_tags( gridread_get_option('footer_text') ) ); ?></p>
<?php else : ?>
  <p class='gridread-copyright'><?php /* translators: %s: Year and site name. */ printf( esc_html__( 'Copyright &copy; %s', 'gridread' ), esc_html(date_i18n(__('Y','gridread'))) . ' ' . esc_html(get_bloginfo( 'name' ))  ); ?></p>
<?php endif; ?>
<p class='gridread-credit'><a href="<?php echo esc_url( 'https://themesdna.com/' ); ?>"><?php /* translators: %s: Theme author. */ printf( esc_html__( 'Design by %s', 'gridread' ), 'ThemesDNA.com' ); ?></a></p>
</div>

</div>
</div>
</div><!--/#gridread-copyright-area -->

<?php gridread_after_footer(); ?>

</div>

<?php if ( gridread_is_backtotop_active() ) { ?><button class="gridread-scroll-top" title="<?php esc_attr_e('Scroll to Top','gridread'); ?>"><i class="fas fa-arrow-up" aria-hidden="true"></i><span class="gridread-sr-only"><?php esc_html_e('Scroll to Top', 'gridread'); ?></span></button><?php } ?>

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