<?php
?>

<div class="head__logo">
    <?php if ( has_custom_logo() ) : ?>
        <?php
        $crt_builder_with_elementor_logo_dark = get_theme_mod( 'logo_dark' );
        $crt_builder_with_elementor_logo_light = wp_get_attachment_url( get_theme_mod( 'custom_logo' ) );
        ?>
        <div class="site-logo">
            <?php echo is_front_page() || is_home() ? '<h1 class="head__sologan m-0">':'<span class="head__sologan m-0">' ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
                <img class="dark" src="<?php echo esc_attr($crt_builder_with_elementor_logo_dark ? $crt_builder_with_elementor_logo_dark : ''); ?>" alt="<?php bloginfo( 'name' ); ?>">
                <img class="light" src="<?php echo esc_attr($crt_builder_with_elementor_logo_light ? $crt_builder_with_elementor_logo_light : ''); ?>" alt="<?php bloginfo( 'name' ); ?>">
            </a>
            <?php echo is_front_page() || is_home() ? '</h1>':'</span>' ?>
        </div>
    <?php else : ?>
        <div class="site-identity">
            <?php echo is_front_page() || is_home() ? '<h1 class="head__sologan m-0">':'<h3 class="head__sologan m-0">' ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
            <span><?php bloginfo( 'description' ); ?></span>
            <?php echo is_front_page() || is_home() ? '</h1>':'</h3>' ?>
        </div>
    <?php endif; ?>
</div>
