<?php
/**
 * Template Name: EasySite Contact
 *
 * @package EasySite_Pro
 */

get_header();
?>

<div class="easysite-page-hero easysite-section">
	<div class="easysite-container">
		<h1><?php the_title(); ?></h1>
		<p><?php esc_html_e( 'We would love to hear from you. Fill in the form below and we will get back to you soon.', 'easysite-pro' ); ?></p>
	</div>
</div>

<div class="easysite-container easysite-content-area easysite-contact-layout">
	<div class="easysite-contact-form-col">
		<?php echo do_shortcode( '[easysite_contact_form]' ); ?>

		<?php if ( easysite_is_bundle() ) : ?>
			<h2><?php esc_html_e( 'Book an Appointment', 'easysite-pro' ); ?></h2>
			<?php echo do_shortcode( '[easysite_booking_form]' ); ?>
		<?php endif; ?>
	</div>

	<aside class="easysite-contact-details">
		<h2><?php esc_html_e( 'Contact Details', 'easysite-pro' ); ?></h2>
		<ul>
			<?php if ( $phone = easysite_get_mod( 'easysite_contact_phone' ) ) : ?>
				<li><strong><?php esc_html_e( 'Phone:', 'easysite-pro' ); ?></strong> <a href="tel:<?php echo esc_attr( preg_replace( '/\s+/', '', $phone ) ); ?>"><?php echo esc_html( $phone ); ?></a></li>
			<?php endif; ?>
			<?php if ( $email = easysite_get_mod( 'easysite_contact_email', get_option( 'admin_email' ) ) ) : ?>
				<li><strong><?php esc_html_e( 'Email:', 'easysite-pro' ); ?></strong> <a href="mailto:<?php echo esc_attr( $email ); ?>"><?php echo esc_html( $email ); ?></a></li>
			<?php endif; ?>
			<?php if ( $address = easysite_get_mod( 'easysite_contact_address' ) ) : ?>
				<li><strong><?php esc_html_e( 'Address:', 'easysite-pro' ); ?></strong> <?php echo esc_html( $address ); ?></li>
			<?php endif; ?>
			<?php if ( $hours = easysite_get_mod( 'easysite_contact_hours' ) ) : ?>
				<li><strong><?php esc_html_e( 'Hours:', 'easysite-pro' ); ?></strong> <?php echo esc_html( $hours ); ?></li>
			<?php endif; ?>
		</ul>
		<?php easysite_social_links(); ?>

		<?php if ( $map = easysite_get_mod( 'easysite_contact_map_embed' ) ) : ?>
			<div class="easysite-map-embed">
				<?php echo wp_kses_post( $map ); ?>
			</div>
		<?php endif; ?>
	</aside>
</div>

<?php get_footer(); ?>
