<?php
    $bodyClass = 'blog-detail';
    $layout_path = 'frontend.layouts.content-sidebar';
    if($post->layout_type == 'blocks') {
        $bodyClass .= ' blog-detail--blocks';
        $layout_path = 'frontend.layouts.main';

        if($post->header_overlap) {
            $bodyClass .= ' header-over';
        }
    }
?>



<?php if($post->layout_type == 'blocks'): ?>

    <?php $__env->startSection('content'); ?>
        <div class="blog-detail__content-blocks">
            <?php echo $__env->make('frontend.templates.components.blocks_section', ['blocks' => $post->blocks], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        </div>
    <?php $__env->stopSection(); ?>

<?php else: ?>

    <?php $__env->startSection('content-top'); ?>
        <div class="blog-detail__header" data-controller="pages/blog-detail">
            <div class="blog__control">
                <a href="<?php echo e($backUrl); ?>" data-action="goBack"><?php echo app('translator')->get('frontend.blog_detail_label'); ?></a>
            </div>
            <h1><?php echo e($post->title); ?></h1>
            <div class="blog-detail__date-cats">
                <span class="blog-detail__date"><?php echo e(format_date($post->date)); ?></span>
                <?php $__currentLoopData = $post->categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if($i > 0): ?>
                    |
                    <?php endif; ?>
                    <a href="<?php echo e($redirectPath . '?c=' . $category->id); ?>"><?php echo e($category->title); ?></a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <div class="blog-detail__authors">
                <?php $__currentLoopData = $post->authors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $author): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <a href="<?php echo e(lang_url($author->lang_uri)); ?>" class="blog-detail__author">
                    <div class="blog-detail__author-image">
                        <?php echo getMediaImg($author->media, '200x200'); ?>

                    </div>
                    <div class="blog-detail__author-info">
                        <div class="blog-detail__author-name"><?php echo e($author->title); ?></div>
                        <div class="blog-detail__author-position"><?php echo e($author->position_company); ?></div>
                    </div>
                </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('content-toolbar'); ?>
        <?php echo $__env->make('frontend.templates.components.share_buttons', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('content-left'); ?>
        <?php echo getMediaImg($post->media, '800w', htmlspecialchars($post->title), 'blog-detail__main-image'); ?>

        <div class="blog-detail__content rich-content">
            <?php echo wpautop($post->content); ?>

            <?php if($post->type == 'interview'): ?>
                <div class="blog-detail__interview">
                    <?php $firstAnswer = [null, true, true, true]; ?>
                    <?php $__currentLoopData = $post->questions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $question): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="blog-detail__question">
                            <?php echo e(empty(trim($question->question)) ? $question->title : $question->question); ?>

                        </div>
                        <div class="blog-detail__answer">
                            <span class="blog-detail__interviewed">
                                <?php
                                    $abbreviation = abbreviate($question->getInterviewed());
                                    if ($firstAnswer[$question->person * 1]) {
                                        $person = $question->getInterviewed() . " ($abbreviation)";
                                        $firstAnswer[$question->person * 1] = false;
                                    } else {
                                        $person = $abbreviation;
                                    }
                                ?>
                                <?php echo e($person); ?>:
                            </span>
                            <?php echo $question->answer; ?>

                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            <?php endif; ?>
        </div>
        <?php if($post->cta_bar_type === 'contact' && $post->ctaBarContact): ?>
            <div class="blog-detail__testimonials-section">
                <div class="blog-detail__testimonials-image">
                    <?php echo getMediaImg($post->ctaBarContact->image, '200x200'); ?>

                </div>
                <div class="blog-detail__testimonials-info">
                    <h2><?php echo e($post->ctaBarContact->name); ?></h2>
                    <span><?php echo e($post->ctaBarContact->job_position); ?></span>
                    <p>“<?php echo e($post->cta_bar_text); ?>”</p>
                </div>
                <a
                    href="#"
                    class="std-button blog-detail__contact-button std-button--large contact-open"
                    data-name="<?php echo e($post->ctaBarContact->name); ?>"
                    data-contact="<?php echo e(base64_encode(json_encode(["Contact_person" => $post->ctaBarContact->name ]))); ?>"
                    data-controller="components/form-modal"
                    data-popupid="contact-us-modal">
                    Contact us
                </a>
            </div>
        <?php endif; ?>
        <?php if($post->cta_bar_type === 'regular'): ?>
            <div class="blog-detail__cta-section">
                <div class="blog-detail__cta-info">
                    <h2><?php echo e($post->cta_bar_title); ?></h2>
                    <p><?php echo e($post->cta_bar_text); ?></p>
                </div>
                <?php echo generateLink($post->cta_bar_cta, 'std-button std-button--large blog-detail__cta-button'); ?>

            </div>
        <?php endif; ?>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('sidebar-top'); ?>
        <?php if(!isset($post->hide_newsletter) || $post->hide_newsletter == 0): ?>
            <div class="default-sidebar blog-detail__top-sidebar">
                <?php echo $__env->make('frontend.templates.components.sidebar-widgets.subscribe', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </div>
        <?php endif; ?>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('sidebar-bottom'); ?>
        <div class="default-sidebar blog-detail__bottom-sidebar">
            <?php echo $__env->make('frontend.templates.components.sidebar-widgets.related-posts', ['relatedPosts' => $relatedPosts], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        </div>
    <?php $__env->stopSection(); ?>
<?php endif; ?>

<?php echo $__env->make($layout_path, [
    'body_class' => $bodyClass
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html-staging/resources/views/frontend/templates/page/blog_detail.blade.php ENDPATH**/ ?>