<?php
$enable_link_in_bio = blogbull_get_option('enable_link_in_bio');
$author_image_link_in_bio = blogbull_get_option('author_image_link_in_bio');
$author_name_link_in_bio = blogbull_get_option('author_name_link_in_bio');
$author_description_link_in_bio = blogbull_get_option('author_description_link_in_bio');
$enable_link_in_bio_custom_label = blogbull_get_option('enable_link_in_bio_custom_label');
$author_appearance_buttons_text = blogbull_get_option('author_appearance_buttons_text');
$author_location_link_in_bio = blogbull_get_option('author_location_link_in_bio');
$link_in_bio_section_title = blogbull_get_option('link_in_bio_section_title');
$link_in_bio_section_description = blogbull_get_option('link_in_bio_section_description');
$link_in_bio_section_button_text = blogbull_get_option('link_in_bio_section_button_text');
$link_in_bio_section_button_url = blogbull_get_option('link_in_bio_section_button_url');

if ($enable_link_in_bio) : ?>

    <section class="wpi-section wpi-link-in-bio">
        <div class="wrapper">
            <div class="row-group">
                <div class="column-lg-4 column-md-5 column-sm-12">
                    <?php if ($author_image_link_in_bio) : ?>
                        <div class="link-in-bio-image">
                            <img src="<?php echo esc_url($author_image_link_in_bio); ?>" alt="<?php echo esc_attr($author_name_link_in_bio); ?>">
                            <?php blogbull_the_theme_svg('badge'); ?>
                        </div>
                    <?php endif; ?>

                    <div class="link-in-bio-summary">
                        <?php if ($author_name_link_in_bio) : ?>
                            <h2><?php echo esc_html($author_name_link_in_bio); ?></h2>
                        <?php endif; ?>

                        <?php if ($author_description_link_in_bio) : ?>
                            <p><?php echo esc_html($author_description_link_in_bio); ?></p>
                        <?php endif; ?>

                        <div class="link-in-bio-info">
                            <?php if ($enable_link_in_bio_custom_label) : ?>
                                <span class="link-in-bio-label"><?php echo esc_html($author_appearance_buttons_text); ?></span>
                            <?php endif; ?>

                            <?php if ($author_location_link_in_bio) : ?>
                                <span class="link-in-bio-location"> <?php blogbull_the_theme_svg('geo-fill'); ?><?php echo esc_html($author_location_link_in_bio); ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>

                <div class="column-lg-8 column-md-7 column-sm-12">
                    <?php if ($link_in_bio_section_title) : ?>
                        <h3 class="link-in-bio-title">
                            <?php echo esc_html($link_in_bio_section_title); ?>
                        </h3>
                    <?php endif; ?>

                    <?php if ($link_in_bio_section_description) : ?>
                        <div class="link-in-bio-description">
                            <?php echo esc_html($link_in_bio_section_description); ?>
                        </div>
                    <?php endif; ?>

                    <?php if ($link_in_bio_section_button_text && $link_in_bio_section_button_url) : ?>
                        <a href="<?php echo esc_url($link_in_bio_section_button_url); ?>" class="wpi-button wpi-button-fancy">
                            <span class="wpi-btn-arrow"></span>
                            <span class="wpi-btn-text"><?php echo esc_html($link_in_bio_section_button_text); ?></span>
                        </a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </section>

<?php endif; ?>