<?php get_header();
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'single' ) ):?>
    <main>
        <?php if (have_posts()): ?><?php while (have_posts()): the_post(); ?>

            <div class="mt-4 mb-5">
                <div class="custom-container">

                    <!-- breadcrumb -->
                    <?php banta_breadcrumb(); ?>

                    <!-- page head -->
                    <?php $thumbnailUrl = get_the_post_thumbnail_url(); ?>
                    <div class="single-page-head" style="background-image: url(<?php echo $thumbnailUrl; ?>)">
                        <div class="single-page-head-content">
                            <h1 class="single-title"><?php the_title(); ?></h1>
                        </div>
                    </div>


                    <!-- content -->
                    <div class="single-box single-page-content-box">

                        <div class="single-page-content-right">
                            <!-- share -->
                            <?php $shareUrl = get_the_permalink();
                            $shareTitle = get_the_title(); ?>
                            <div class="post-share-box-icons">
                                <a href="https://api.whatsapp.com/send?text=<?php echo $shareUrl ?>"
                                   class="social-icon-link" rel="nofollow" target="_blank"
                                   data-bs-toggle="tooltip" data-bs-placement="left"
                                   title="<?php _e('Share in Whatsapp', TEXT_DOMAIN); ?>"><i
                                            class="icon-whatsapp"></i></a>
                                <a href="https://t.me/share/url?url=<?php echo $shareUrl ?>"
                                   class="social-icon-link" rel="nofollow" target="_blank"
                                   data-bs-toggle="tooltip" data-bs-placement="left"
                                   title="<?php _e('Share in Telegram', TEXT_DOMAIN); ?>"><i
                                            class="icon-telegram"></i></a>
                                <a href="https://twitter.com/intent/tweet?url=<?php echo $shareUrl ?>&text=<?php echo $shareTitle ?>"
                                   class="social-icon-link" rel="nofollow" target="_blank"
                                   data-bs-toggle="tooltip" data-bs-placement="left"
                                   title="<?php _e('Share in X', TEXT_DOMAIN); ?>"><i class="icon-x"></i></a>
                                <a href="https://pinterest.com/pin/create/button/?url=<?php echo $shareUrl ?>&media=<?php echo $thumbnailUrl; ?>&description=<?php echo $shareTitle ?>"
                                   class="social-icon-link" rel="nofollow" target="_blank"
                                   data-bs-toggle="tooltip" data-bs-placement="left"
                                   title="<?php _e('Share in Pinterest', TEXT_DOMAIN); ?>"><i
                                            class="icon-pinterest"></i></a>
                                <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $shareUrl ?>&title=<?php echo $shareTitle ?>"
                                   class="social-icon-link" rel="nofollow" target="_blank"
                                   data-bs-toggle="tooltip" data-bs-placement="left"
                                   title="<?php _e('Share in Linkedin', TEXT_DOMAIN); ?>"><i
                                            class="icon-linkedin"></i></a>
                                <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $shareUrl ?>"
                                   class="social-icon-link" rel="nofollow" target="_blank"
                                   data-bs-toggle="tooltip" data-bs-placement="left"
                                   title="<?php _e('Share in Facebook', TEXT_DOMAIN); ?>"><i
                                            class="icon-facebook"></i></a>
                            </div>

                            <div class="horizontal-line mx-auto my-4 d-none d-lg-block"></div>

                            <div class="flex-row flex-lg-column d-flex mb-lg-4 mt-4 mt-lg-0 w-100 justify-content-center align-items-center">
                                <div class="post-date">
                                    <span class="day"><?php banta_date('j', get_the_date('y-m-d')); ?></span>
                                    <span class="month"><?php banta_date('F', get_the_date('y-m-d')); ?></span>
                                    <span class="year"><?php banta_date('Y', get_the_date('y-m-d')); ?></span>
                                </div>

                                <?php $shopPostReadingTime = get_option(TEXT_DOMAIN . '_show_post_reading_time');
                                $readingTime = get_post_meta(get_the_ID(), TEXT_DOMAIN . '_reading-time', true);
                                ?>
                                <?php if ($shopPostReadingTime != 'false' && !empty($readingTime)): ?>
                                    <div class="post-date post-reading-time">
                                        <span class="day"><?php echo $readingTime?></span>
                                        <span class="month"><?php _e('Minutes', TEXT_DOMAIN); ?></span>
                                        <span class="year"><?php _e('Reading', TEXT_DOMAIN); ?></span>
                                    </div>
                                <?php endif; ?>

                            </div>
                        </div>

                        <div class="single-page-content-left <?php echo has_post_thumbnail() ? '':'single-page-content-no-thumb';?>">
                            <!-- thumbnail -->
                            <?php if (has_post_thumbnail()): ?>
                                <div class="single-image">
                                    <?php the_post_thumbnail(); ?>
                                </div>
                            <?php endif; ?>

                            <!-- content -->
                            <div class="html-content">
                                <?php the_content(); ?>
                            </div>
                        </div>
                    </div>



                </div>
            </div>

        <?php endwhile; ?>
        <?php endif; ?>
    </main>
<?php endif; get_footer(); ?>