<?php
    $showFeaturedImage = theme_option('blog_show_featured_image_in_post_detail', 'yes') == 'yes';
    Theme::set('breadcrumbEnabled', $showFeaturedImage ? 'no' : 'yes');
    Theme::set('breadcrumbStyle', 'without-title');
    Theme::set('currentPostId', $post->getKey());
    $bottomPostDetailSidebar = dynamic_sidebar('bottom_post_detail_sidebar');
    Theme::layout('full-width');
    Theme::set('pageTitle', $post->name);
?>

<?php if($post->image && $showFeaturedImage): ?>
    <section class="flat-banner-blog">
        <?php echo e(RvMedia::image($post->image, $post->name, lazy: false)); ?>

    </section>
<?php endif; ?>

<section class="<?php echo \Illuminate\Support\Arr::toCssClasses(['flat-section-v2', 'flat-section' => ! $bottomPostDetailSidebar]); ?>">
    <div class="container">
        <?php echo apply_filters('ads_render', null, 'post_detail_before'); ?>


        <div class="row">
            <div class="col-lg-10 mx-auto">
                <div class="flat-blog-detail">
                    <?php if($post->firstCategory): ?>
                        <a href="<?php echo e($post->firstCategory->url); ?>" class="blog-tag primary"><?php echo e($post->firstCategory->name); ?></a>
                    <?php endif; ?>
                    <h1 class="h2"><?php echo BaseHelper::clean($post->name); ?></h1>
                    <div class="mt-12 d-flex align-items-center gap-16 mb-3">
                        <?php if(theme_option('blog_show_author_name', 'yes') == 'yes' && class_exists($post->author_type) && ($author = $post->author ?? null) && trim($author->name)): ?>
                            <div class="avatar avt-40 round">
                                <?php echo e(RvMedia::image($author->avatar_url, $author->name)); ?>

                            </div>
                        <?php endif; ?>
                        <div class="post-author style-1">
                            <?php if(theme_option('blog_show_author_name', 'yes') == 'yes' && class_exists($post->author_type) && ($author = $post->author ?? null) && trim($author->name)): ?>
                                <span><?php echo e($post->author->name); ?></span>
                            <?php endif; ?>
                            <span><?php echo e(Theme::formatDate($post->created_at)); ?></span>
                        </div>
                    </div>

                    <div class="ck-content single-detail">
                        <?php echo BaseHelper::clean($post->content); ?>

                    </div>

                    <div class="my-40 d-flex justify-content-between flex-wrap gap-16">
                        <?php if($post->tags->isNotEmpty()): ?>
                            <div class="d-flex flex-wrap align-items-center gap-12">
                                <span class="text-black"><?php echo e(__('Tag:')); ?></span>
                                <ul class="d-flex flex-wrap gap-12">
                                    <?php $__currentLoopData = $post->tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li>
                                            <a href="<?php echo e($tag->url); ?>" class="blog-tag"><?php echo e($tag->name); ?></a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            </div>
                        <?php endif; ?>

                        <?php
                            $shareSocials = \Botble\Theme\Supports\ThemeSupport::getSocialSharingButtons($post->url, $post->name);
                        ?>
                        <?php if($shareSocials): ?>
                            <div class="d-flex flex-wrap align-items-center gap-16">
                                <span class="text-black"><?php echo e(__('Share:')); ?></span>
                                <ul class="d-flex flex-wrap gap-12">
                                    <?php $__currentLoopData = $shareSocials; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $social): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li>
                                            <a href="<?php echo e($social['url']); ?>" class="box-icon w-40 social square" title="<?php echo e($social['name']); ?>">
                                                <?php echo $social['icon']; ?>

                                            </a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            </div>
                        <?php endif; ?>
                    </div>

                    <?php
                        $relatedPosts = get_related_posts($post->id, 2);
                    ?>

                    <?php if($relatedPosts->isNotEmpty()): ?>
                        <div class="post-navigation">
                            <?php $__currentLoopData = $relatedPosts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="<?php echo \Illuminate\Support\Arr::toCssClasses(['previous-post' => $loop->first, 'next-post' => ! $loop->first]); ?>">
                                    <div class="subtitle"><?php echo e($loop->first ? __('Previous') : __('Next')); ?></div>
                                    <div class="h7 fw-7 text-black text-capitalize">
                                        <a href="<?php echo e($post->url); ?>"><?php echo BaseHelper::clean($post->name); ?></a>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    <?php endif; ?>

                    <?php echo apply_filters(BASE_FILTER_PUBLIC_COMMENT_AREA, null, $post); ?>

                </div>
            </div>
        </div>

        <?php echo apply_filters('ads_render', null, 'post_detail_after'); ?>

    </div>
</section>

<?php if($bottomPostDetailSidebar): ?>
    <?php echo $bottomPostDetailSidebar; ?>

<?php endif; ?>
<?php /**PATH /home/agriwurd/capitalpropertiesandresidence.com/platform/themes/homzen/views/post.blade.php ENDPATH**/ ?>