<?php
/**
 * The footer for the BASCO UAE theme.
 *
 * Matches bascouae.com — light grey strip with:
 *   - "Conference Secretariat:" in orange
 *   - "INDEX Conferences & Exhibitions Org. Est." + INDEX logo
 *   - Copyright line
 *
 * @package BASCO_UAE
 */
?>

<?php
if ( function_exists( 'elementor_theme_do_location' ) && elementor_theme_do_location( 'footer' ) ) :
	// Elementor Pro footer takeover.
else :
?>

<footer class="site-footer">
	<div class="organiser-details">
		<h6><?php esc_html_e( 'Conference Secretariat :', 'basco-uae' ); ?></h6>

		<a href="https://www.index.ae" target="_blank" rel="noopener">
			<?php echo esc_html( get_theme_mod( 'basco_footer_secretariat', 'INDEX Conferences & Exhibitions Org. Est.' ) ); ?>
		</a>
	</div>

	<a href="https://www.index.ae" target="_blank" rel="noopener">
		<?php
		$index_logo = get_theme_mod( 'basco_footer_index_logo' );

		if ( $index_logo ) :
		?>
			<img src="<?php echo esc_url( $index_logo ); ?>" 
			     alt="INDEX Conferences &amp; Exhibitions" 
			     class="footer-index-logo">
		<?php else : ?>
			<span class="footer-index-fallback" aria-label="INDEX Conferences &amp; Exhibitions">
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130 36" width="120" height="34" aria-hidden="true" focusable="false">
					<text x="0" y="22" font-family="Arial, sans-serif" font-weight="700" font-size="20" fill="#1c2d3a" letter-spacing="2">INDEX</text>
					<text x="0" y="34" font-family="Arial, sans-serif" font-size="6" fill="#7e7e7e" letter-spacing="1">
						CONFERENCES &amp; EXHIBITIONS
					</text>
				</svg>
			</span>
		<?php endif; ?>
	</a>

	<p class="text-center w-100">
		<?php
		$copy = get_theme_mod(
			'basco_footer_copyright',
			sprintf( 'COPYRIGHT © %s. ALL RIGHTS RESERVED.', date( 'Y' ) )
		);

		echo esc_html( $copy );
		?>
	</p>
</footer>

<?php endif; ?>

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