<?php
/**
 * The template for displaying the footer
 *
 * Three-column layout: site info | footer nav (menu-2) | social links (social).
 * Dynamic copyright year. All hardcoded external links removed.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package CyyWordpress
 */

?>
	</div><!-- #content .site-content .container -->

</div><!-- #page .site -->

<footer id="colophon" class="site-footer footer">
	<div class="container">
		<div class="columns">

			<!-- Column 1: Site info + footer widget 1 -->
			<div class="column is-4">
				<p class="footer-site-name">
					<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
						<?php bloginfo( 'name' ); ?>
					</a>
				</p>
				<?php
				$description = get_bloginfo( 'description' );
				if ( $description ) :
					echo '<p class="footer-site-description">' . esc_html( $description ) . '</p>';
				endif;
				?>
				<?php if ( is_active_sidebar( 'sidebar-footer-1' ) ) : ?>
					<div class="footer-widget-area">
						<?php dynamic_sidebar( 'sidebar-footer-1' ); ?>
					</div>
				<?php endif; ?>
			</div><!-- .column -->

			<!-- Column 2: Footer navigation (menu-2) + widget 2 -->
			<div class="column is-4">
				<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
					<nav class="footer-nav" aria-label="<?php esc_attr_e( '页脚导航', 'cyywordpress' ); ?>">
						<?php
						wp_nav_menu(
							array(
								'theme_location' => 'menu-2',
								'menu_id'        => 'footer-menu',
								'depth'          => 1,
								'container'      => false,
								'menu_class'     => 'footer-menu-list',
							)
						);
						?>
					</nav>
				<?php endif; ?>
				<?php if ( is_active_sidebar( 'sidebar-footer-2' ) ) : ?>
					<div class="footer-widget-area">
						<?php dynamic_sidebar( 'sidebar-footer-2' ); ?>
					</div>
				<?php endif; ?>
			</div><!-- .column -->

			<!-- Column 3: Social links (social menu) + widget 3 -->
			<div class="column is-4">
				<?php if ( has_nav_menu( 'social' ) ) : ?>
					<nav class="social-nav" aria-label="<?php esc_attr_e( '社交媒体链接', 'cyywordpress' ); ?>">
						<?php
						wp_nav_menu(
							array(
								'theme_location' => 'social',
								'menu_id'        => 'social-menu',
								'depth'          => 1,
								'container'      => false,
								'menu_class'     => 'social-menu-list',
								'link_before'    => '<span class="screen-reader-text">',
								'link_after'     => '</span>',
							)
						);
						?>
					</nav>
				<?php endif; ?>
				<?php if ( is_active_sidebar( 'sidebar-footer-3' ) ) : ?>
					<div class="footer-widget-area">
						<?php dynamic_sidebar( 'sidebar-footer-3' ); ?>
					</div>
				<?php endif; ?>
			</div><!-- .column -->

		</div><!-- .columns -->
	</div><!-- .container -->

	<div class="footer-bottom">
		<div class="container has-text-centered">
			<p class="footer-copyright">
				&copy; <?php echo esc_html( (string) gmdate( 'Y' ) ); ?>
				<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
					<?php bloginfo( 'name' ); ?>
				</a>.
				<?php
				printf(
					/* translators: %s: WordPress link */
					esc_html__( '基于 %s 强力驱动', 'cyywordpress' ),
					'<a href="https://wordpress.org/" target="_blank" rel="noopener">WordPress</a>'
				);
				?>
			</p>
		</div>
	</div>
</footer><!-- #colophon -->

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

