<?php
/**
 * Footer da campanha: logo do "Maringá Faz Mais" à esquerda, redes sociais
 * no centro e logo horizontal da Prefeitura (link pro portal) à direita.
 * No mobile empilha nessa mesma ordem.
 */

$mfm_redes = array(
	'facebook'  => array( 'url' => mfm_get( 'rede_facebook' ), 'rotulo' => 'Facebook' ),
	'instagram' => array( 'url' => mfm_get( 'rede_instagram' ), 'rotulo' => 'Instagram' ),
	'tiktok'    => array( 'url' => mfm_get( 'rede_tiktok' ), 'rotulo' => 'TikTok' ),
	'x'         => array( 'url' => mfm_get( 'rede_x' ), 'rotulo' => 'X' ),
	'youtube'   => array( 'url' => mfm_get( 'rede_youtube' ), 'rotulo' => 'YouTube' ),
);
?>

<footer class="mfm-footer">
	<div class="mfm-container mfm-footer__inner">
		<div class="mfm-footer__campanha">
			<a href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="Maringá Faz Mais — página inicial">
				<img src="<?php echo esc_url( MFM_URI . '/assets/img/logo-maringa-faz-mais.png' ); ?>" alt="Maringá Faz Mais" width="138" height="56" loading="lazy">
			</a>
		</div>

		<ul class="mfm-footer__redes" aria-label="Redes sociais da Prefeitura">
			<?php foreach ( $mfm_redes as $mfm_slug => $mfm_rede ) : ?>
				<?php if ( $mfm_rede['url'] ) : ?>
					<li>
						<a href="<?php echo esc_url( $mfm_rede['url'] ); ?>" target="_blank" rel="noopener" aria-label="<?php echo esc_attr( $mfm_rede['rotulo'] ); ?>">
							<svg class="mfm-icone" width="22" height="22" aria-hidden="true"><use href="#icone-<?php echo esc_attr( $mfm_slug ); ?>"></use></svg>
						</a>
					</li>
				<?php endif; ?>
			<?php endforeach; ?>
		</ul>

		<div class="mfm-footer__marca">
			<a href="https://www.maringa.pr.gov.br/" target="_blank" rel="noopener noreferrer">
				<img src="<?php echo esc_url( MFM_URI . '/assets/img/logo-prefeitura-branco.png' ); ?>" alt="Prefeitura de Maringá — Trabalhando por você" width="174" height="56" loading="lazy">
			</a>
			<!-- <p class="mfm-footer__tagline">O Maior Programa de Obras e Serviços da Nossa História</p> -->
		</div>
	</div>
	<div class="mfm-footer__base">
		<div class="mfm-container">
			<p>© <?php echo esc_html( gmdate( 'Y' ) ); ?> Prefeitura de Maringá · maringafazmais.com.br</p>
		</div>
	</div>
</footer>

<!-- Sprite dos ícones de redes sociais (inline: zero requisição extra) -->
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
	<symbol id="icone-facebook" viewBox="0 0 24 24"><path fill="currentColor" d="M13.5 21v-7h2.4l.4-3h-2.8V9.1c0-.9.3-1.5 1.6-1.5H16.4V4.9c-.3 0-1.2-.1-2.3-.1-2.3 0-3.9 1.4-3.9 4V11H7.8v3h2.4v7h3.3z"/></symbol>
	<symbol id="icone-instagram" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4.3c2.5 0 2.8 0 3.8.1 2.5.1 3.7 1.3 3.8 3.8 0 1 .1 1.3.1 3.8s0 2.8-.1 3.8c-.1 2.5-1.3 3.7-3.8 3.8-1 0-1.3.1-3.8.1s-2.8 0-3.8-.1c-2.5-.1-3.7-1.3-3.8-3.8 0-1-.1-1.3-.1-3.8s0-2.8.1-3.8C4.5 5.7 5.7 4.5 8.2 4.4c1-.1 1.3-.1 3.8-.1zM12 2.5c-2.6 0-2.9 0-3.9.1-3.4.2-5.3 2-5.5 5.5-.1 1-.1 1.3-.1 3.9s0 2.9.1 3.9c.2 3.4 2 5.3 5.5 5.5 1 .1 1.3.1 3.9.1s2.9 0 3.9-.1c3.4-.2 5.3-2 5.5-5.5.1-1 .1-1.3.1-3.9s0-2.9-.1-3.9c-.2-3.4-2-5.3-5.5-5.5-1-.1-1.3-.1-3.9-.1zm0 4.6a4.9 4.9 0 1 0 0 9.8 4.9 4.9 0 0 0 0-9.8zm0 8.1a3.2 3.2 0 1 1 0-6.4 3.2 3.2 0 0 1 0 6.4zm5.1-9.4a1.1 1.1 0 1 0 0 2.3 1.1 1.1 0 0 0 0-2.3z"/></symbol>
	<symbol id="icone-tiktok" viewBox="0 0 24 24"><path fill="currentColor" d="M16.6 3c.3 2.4 1.7 3.9 4 4.1v2.7c-1.4.1-2.6-.3-4-1.2v5.6c0 7.1-7.7 9.3-10.8 4.2-2-3.2-.8-8.9 5.7-9.1v2.8c-.5.1-1 .2-1.5.4-1.5.5-2.3 1.5-2.1 3.1.4 3.2 6.3 4.2 5.8-2.1V3h2.9z"/></symbol>
	<symbol id="icone-x" viewBox="0 0 24 24"><path fill="currentColor" d="M17.8 3h3l-6.7 7.6L22 21h-6.2l-4.8-6.3L5.4 21h-3l7.1-8.1L2 3h6.3l4.4 5.8L17.8 3zm-1.1 16.2h1.7L7.4 4.7H5.6l11.1 14.5z"/></symbol>
	<symbol id="icone-youtube" viewBox="0 0 24 24"><path fill="currentColor" d="M21.6 7.2a2.5 2.5 0 0 0-1.8-1.8C18.2 5 12 5 12 5s-6.2 0-7.8.4A2.5 2.5 0 0 0 2.4 7.2 26.3 26.3 0 0 0 2 12c0 1.6.1 3.2.4 4.8a2.5 2.5 0 0 0 1.8 1.8C5.8 19 12 19 12 19s6.2 0 7.8-.4a2.5 2.5 0 0 0 1.8-1.8c.3-1.6.4-3.2.4-4.8s-.1-3.2-.4-4.8zM10 15.2V8.8l5.2 3.2-5.2 3.2z"/></symbol>
</svg>

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