<?php
/**
 * Displays main header
 *
 * @package AI Services
 */
?>

<div class="main-header text-center text-md-start">
    <div class="container">
        <div class="row nav-box">
            <div class="col-xl-3 col-lg-3 col-md-4 col-9 align-self-center">
                <div class="navbar-brand text-center text-md-start">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $ai_services_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $ai_services_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('ai_services_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('ai_services_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
                            $ai_services_description = get_bloginfo( 'description', 'display' );
                            if ( $ai_services_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('ai_services_theme_description',false) != ''){ ?>
                            <p class="site-description"><?php echo esc_html($ai_services_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-xl-7 col-lg-7 col-md-3 col-3 align-self-center header-box">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            <div class="col-xl-2 col-lg-2 col-md-5 btn-box align-self-center text-end">
                <?php if(get_theme_mod('ai_services_header_btn_url') != '' || get_theme_mod('ai_services_header_btn_text') != ''){?>
                    <div class="header-btn text-md-end text-center">
                        <a href="<?php echo esc_url(get_theme_mod('ai_services_header_btn_url','')); ?>" target="_blank"><?php echo esc_html( get_theme_mod('ai_services_header_btn_text') ); ?></a>
                    </div>
                <?php }?>
            </div>
        </div>
    </div>
</div>
