<?php
/**
 * Displays main header
 *
 * @package Real Estate Escrow
 */
?>

<div class="main-header text-center text-md-left">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 col-md-4 col-sm-4 align-self-center">
                <div class="navbar-brand text-center text-md-left">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $real_estate_management_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $real_estate_management_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                              <?php if( get_theme_mod('real_estate_management_logo_title_text',true) != ''){ ?>
                                <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                              <?php } ?>
                            <?php else : ?>
                              <?php if( get_theme_mod('real_estate_management_logo_title_text',true) != ''){ ?>
                                <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                              <?php } ?>
                            <?php endif; ?>
                        <?php endif; ?>
                        <?php
                            $real_estate_management_description = get_bloginfo( 'description', 'display' );
                            if ( $real_estate_management_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('real_estate_management_theme_description',false) != ''){ ?>
                        <p class="site-description"><?php echo esc_html($real_estate_management_description); ?></p>
                      <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-lg-7 col-md-2 col-sm-2 col-4 align-self-center">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            <div class="col-lg-2 col-md-6 col-sm-6 col-8 align-self-center text-md-right">
                <?php if(get_theme_mod('real_estate_management_topbar_btn_url') != '' || get_theme_mod('real_estate_management_topbar_btn_text') != ''){ ?>
                    <div class="top-btn">
                        <a href="<?php echo esc_url(get_theme_mod('real_estate_management_topbar_btn_url','')); ?>"><?php echo esc_html(get_theme_mod('real_estate_management_topbar_btn_text','')); ?></a>
                    </div>
                <?php }?>
            </div>
        </div>
    </div>
</div>
