<?php
/*
 * Displays the header section with logo, site title, tagline, navigation, and contact information.
 */
?>

<div class="headerbox my-2">
    <div class="container header-main">
        <div class="row m-0">
            <div class="col-lg-3 col-md-4 col-12 logo-col align-self-center">
                <div class="logo text-center">
                    <?php if (has_custom_logo()) : ?>
                        <?php the_custom_logo(); ?>
                    <?php endif; ?>

                    <?php if (get_theme_mod('business_accountant_site_title', 1)) : ?>
                        <?php if (is_front_page() && is_home()) : ?>
                            <p class="text-capitalize mb-0">
                                <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                            </p>
                        <?php else : ?>
                            <h1 class="text-capitalize">
                                <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                            </h1>
                        <?php endif; ?>
                    <?php endif; ?>

                    <?php
                    $description = get_bloginfo('description', 'display');
                    if ($description || is_customize_preview()) :
                        if (get_theme_mod('business_accountant_site_tagline', 1)) :
                            ?>
                            <p class="site-description my-1 text-capitalize"><?php echo esc_html($description); ?></p>
                        <?php endif; 
                    endif;
                    ?>
                </div>
            </div>
            <div class="col-lg-6 col-md-4 col-12 align-self-center">
                <div class="main-navhead">
                    <div class="menubox">
                        <div class="menu-content">
                            <?php get_template_part('template-parts/navigation/site-nav'); ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3 col-md-4 col-12 align-self-center">
                <div class="contact call py-3">
                    <?php 
                        $business_accountant_call_number = get_theme_mod('business_accountant_call');
                        if ($business_accountant_call_number) : ?>
                            <div class="align-self-center text-center contact-col call">
                                <p class="mb-0 contact-content call">
                                    <a href="tel:<?php echo esc_attr($business_accountant_call_number); ?>" aria-label="<?php echo esc_attr($business_accountant_call_number); ?>">
                                        <i class="fas fa-phone-volume me-3"></i><?php echo esc_html($business_accountant_call_number); ?>
                                    </a>
                                </p>
                            </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
</div>