<?php
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) { exit; }

$wte_email = get_theme_mod( 'wte_contact_email', '' );
if ( ! $wte_email ) { return; }

$wte_contact_pages = get_pages( [ 'meta_key' => '_wte_is_contact_page', 'meta_value' => '1', 'number' => 1 ] );
$wte_contact_url   = ! empty( $wte_contact_pages ) ? get_permalink( $wte_contact_pages[0] ) : '#';
$wte_cta_label     = get_theme_mod( 'wte_contact_cta_label', __( 'メールで問い合わせる', 'wte_' ) );
?>
<section id="wte-contact-cta" class="wte-section wte-section--contact-cta">
	<div class="wte-container wte-text-center">
		<h2 class="wte-section__heading"><?php esc_html_e( 'お問い合わせ', 'wte_' ); ?></h2>
		<p class="wte-section__subtext"><?php esc_html_e( 'お気軽にお問い合わせください。', 'wte_' ); ?></p>
		<a href="<?php echo esc_url( $wte_contact_url ); ?>" class="wte-btn wte-btn--primary wte-btn--lg">
			<?php echo esc_html( $wte_cta_label ); ?>
		</a>
	</div>
</section>
