<?php
/**
 * Template Name: Home Page Template
 */

get_header();

$business_office_slider_hide = get_theme_mod('business_office_slider_hide', false);
$business_office_featured_post_heading = get_theme_mod('business_office_featured_post_heading', 'FEATURED POST');
$business_office_featured_post_hide = get_theme_mod('business_office_new_arrivals_hide', false);
?>

<main id="main" class="site-main">

	<?php
		$business_office_blog_hero_enable = get_theme_mod('business_office_blog_hero_hide', false);

		if ($business_office_blog_hero_enable) :

		$business_office_banner_bg = get_theme_mod('business_office_business_banner_bg_image', '');
		$business_office_banner_kicker = get_theme_mod('business_office_business_banner_kicker', __('Your Trusted Business Growth Partner', 'business-office'));
		$business_office_banner_heading_accent = get_theme_mod('business_office_business_banner_heading_accent', __('BUSINESS', 'business-office'));
		$business_office_banner_heading_main = get_theme_mod('business_office_business_banner_heading_main', __('SOLUTIONS', 'business-office'));
		$business_office_banner_description = get_theme_mod('business_office_business_banner_description', __('We provide strategic consulting, financial planning, and operational solutions to help businesses scale efficiently and achieve long-term success.', 'business-office'));
		$business_office_banner_button_text = get_theme_mod('business_office_business_banner_button_text', __('GET CONSULTATION', 'business-office'));
		$business_office_banner_button_url = get_theme_mod('business_office_business_banner_button_url', '#');

		if (empty($business_office_banner_bg)) {
			$business_office_banner_bg = get_template_directory_uri() . '/assets/images/header-img.png';
		}

		?>

		<section id="business-hero-banner" class="business-hero-section">
			<div class="business-hero-wrap" style="background-image:url('<?php echo esc_url($business_office_banner_bg); ?>');">
				<div class="container">

					<div class="business-hero-panel">

						<span class="triangle-line"></span>

						<?php if (!empty($business_office_banner_kicker)) : ?>
							<p class="business-hero-kicker"><?php echo esc_html($business_office_banner_kicker); ?></p>
						<?php endif; ?>

						<h2 class="business-hero-heading">
							<?php if (!empty($business_office_banner_heading_accent)) : ?>
								<span class="business-hero-heading-accent"><?php echo esc_html($business_office_banner_heading_accent); ?></span>
							<?php endif; ?>
							<?php if (!empty($business_office_banner_heading_main)) : ?>
								<span><?php echo esc_html($business_office_banner_heading_main); ?></span>
							<?php endif; ?>
						</h2>

						<span class="business-hero-heading-line" aria-hidden="true"></span>

						<?php if (!empty($business_office_banner_description)) : ?>
							<p class="business-hero-description"><?php echo esc_html($business_office_banner_description); ?></p>
						<?php endif; ?>

						<?php if (!empty($business_office_banner_button_text)) : ?>
							<a class="business-hero-button" href="<?php echo esc_url($business_office_banner_button_url); ?>" target="_blank" rel="noopener noreferrer">
								<?php echo esc_html($business_office_banner_button_text); ?>
							</a>
						<?php endif; ?>
					</div>

				</div>
			</div>
		</section>

	<?php endif; ?>

	<?php
		$business_office_enable = get_theme_mod('business_office_our_services_hide', false);

		if ($business_office_enable) :

		$business_office_our_services_title = get_theme_mod('business_office_our_services_title', __('Our Core Services', 'business-office'));
		$business_office_our_services_left_description = get_theme_mod('business_office_our_services_left_description', __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s.', 'business-office'));
		$business_office_our_services_left_bg_image = get_theme_mod('business_office_our_services_left_bg_image', '');
		$business_office_count = absint(get_theme_mod('business_office_our_services_count', 6));
		$business_office_count = min(6, max(1, $business_office_count));

		if (empty($business_office_our_services_left_bg_image)) {
			$business_office_our_services_left_bg_image = get_template_directory_uri() . '/assets/images/services-default.png';
		}

		$business_office_service_cards_defaults = array(
			1 => array(
				'icon'    => 'fa-solid fa-briefcase',
				'title'   => __('Business Strategy', 'business-office'),
				'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
				'url'     => '',
			),
			2 => array(
				'icon'    => 'fa-solid fa-shield-halved',
				'title'   => __('Audit & Compliance', 'business-office'),
				'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
				'url'     => '',
			),
			3 => array(
				'icon'    => 'fa-solid fa-comment',
				'title'   => __('Advisory Services', 'business-office'),
				'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
				'url'     => '',
			),
			4 => array(
				'icon'    => 'fa-solid fa-comments',
				'title'   => __('Consultancy', 'business-office'),
				'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
				'url'     => '',
			),
			5 => array(
				'icon'    => 'fa-solid fa-chart-line',
				'title'   => __('Growth Strategies', 'business-office'),
				'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
				'url'     => '',
			),
			6 => array(
				'icon'    => 'fa-solid fa-percent',
				'title'   => __('Tax & Legal Services', 'business-office'),
				'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
				'url'     => '',
			),
		);

		$business_office_service_cards = array();
		for ($business_office_service_i = 1; $business_office_service_i <= 6; $business_office_service_i++) {
			$business_office_service_cards[$business_office_service_i] = array(
				'icon'    => get_theme_mod('business_office_our_services_service_' . $business_office_service_i . '_icon', $business_office_service_cards_defaults[$business_office_service_i]['icon']),
				'title'   => get_theme_mod('business_office_our_services_service_' . $business_office_service_i . '_title', $business_office_service_cards_defaults[$business_office_service_i]['title']),
				'text'    => get_theme_mod('business_office_our_services_service_' . $business_office_service_i . '_text', $business_office_service_cards_defaults[$business_office_service_i]['text']),
				'url'     => get_theme_mod('business_office_our_services_service_' . $business_office_service_i . '_url', $business_office_service_cards_defaults[$business_office_service_i]['url']),
			);
		}
		?>

		<section id="ou-services" class="py-4 our-services-section">
			<div class="our-services-layout">

				<div class="our-services-intro" style="background-image: url('<?php echo esc_url($business_office_our_services_left_bg_image); ?>');">
					<div class="our-services-intro-overlay"></div>

					<div class="our-services-intro-content">

						<?php if (!empty($business_office_our_services_title)) : ?>
							<h2 class="our-services-title"><?php echo esc_html($business_office_our_services_title); ?></h2>
						<?php endif; ?>

						<?php if (!empty($business_office_our_services_left_description)) : ?>
							<p class="our-services-desc"><?php echo esc_html($business_office_our_services_left_description); ?></p>
						<?php endif; ?>
					</div>
				</div>

				<div class="our-services-grid">
					<?php for ($business_office_service_i = 1; $business_office_service_i <= $business_office_count; $business_office_service_i++) :
						$business_office_service_card = $business_office_service_cards[$business_office_service_i];
						$business_office_service_url = !empty($business_office_service_card['url']) ? $business_office_service_card['url'] : '';
					?>
						<article class="popular-service-card">
							<?php if (!empty($business_office_service_url)) : ?>
								<a class="popular-service-card-link" href="<?php echo esc_url($business_office_service_url); ?>">
							<?php endif; ?>

							<div class="popular-service-icon" aria-hidden="true">
								<i class="<?php echo esc_attr($business_office_service_card['icon']); ?>"></i>
							</div>

							<?php if (!empty($business_office_service_card['title'])) : ?>
								<h3 class="popular-service-title"><?php echo esc_html($business_office_service_card['title']); ?></h3>
							<?php endif; ?>

							<?php if (!empty($business_office_service_card['text'])) : ?>
								<p class="popular-service-text"><?php echo esc_html($business_office_service_card['text']); ?></p>
							<?php endif; ?>

							<?php if (!empty($business_office_service_url)) : ?>
								</a>
							<?php endif; ?>
						</article>
					<?php endfor; ?>
				</div>

			</div>
		</section>

	<?php endif; ?>
</main>
<?php
get_footer();