@php
    Theme::set('pageTitle', $post->name);
    Theme::set('headerStyle', theme_option('header_style', 'style-1'));
    Theme::set('headerTopStyle',theme_option('header_top_sidebar_style', 'style-1'));
@endphp

<section class="blog-details-area">
    <div class="container">
        <div class="blog-details-wrap">
            <div class="row justify-content-center">
                <div class="col-71">
                    @if ($image = $post->image)
                        <div class="blog-details-thumb">
                            <img
                                src="{{ RvMedia::getImageUrl($image) }}"
                                alt="{{ $post->name }}"
                            >
                        </div>
                    @endif
                    <div class="blog-details-content">
                        @if (! theme_option('theme_breadcrumb_enabled', 1))
                            <h2 class="title">{{ $post->name }}</h2>
                        @endif

                        <div class="blog-meta-three">
                            <ul class="list-wrap">
                                <li><i class="far fa-calendar"></i>{{ $post->created_at->translatedFormat('M d, Y') }}
                                </li>
                                @if ($post->author && $post->author->exists)
                                    @if ($authorDisplayName = ($post->author->getMetaData('display_name', true) ?: $post->author->name))
                                        <li>
                                            <img src="{{ $post->author->avatar_url }}" alt="{{ $authorDisplayName }}" >
                                            {{ __('by :author', ['author' => $authorDisplayName]) }}
                                        </li>
                                    @endif
                                @endif
                                @if ($post->tags->isNotEmpty())
                                    <li>
                                        <i class="fas fa-tags"></i>
                                        @foreach ($post->tags as $tag)
                                            @if ($loop->last)
                                                <a href="{{ $tag->url }}">{{ $tag->name }}</a>
                                            @else
                                                <a href="{{ $tag->url }}">{{ $tag->name }},</a>
                                            @endif
                                        @endforeach
                                    </li>
                                @endif
                            </ul>
                        </div>
                    </div>

                    <section class="section">
                        <div class="container">
                            <div class="content-detail">
                                <div class="blog-details-content">

                                    @if ($content = $post->content)
                                        <div class="ck-content">
                                            {!! BaseHelper::clean($content) !!}
                                        </div>
                                    @endif

                                    <div class="bd-content-bottom">
                                        <div class="row align-items-center">
                                            @if($post->tags->isNotEmpty())
                                                <div class="col-12">
                                                    <div class="post-tags">
                                                        <h5 class="title">{{ __('Tags:') }}</h5>
                                                        <ul class="list-wrap">
                                                            @foreach($post->tags as $tag)
                                                                <li><a href="{{ $tag->url }}">{{ $tag->name }}</a></li>
                                                            @endforeach
                                                        </ul>
                                                    </div>
                                                </div>
                                            @endif

                                            <div class="col-12">
                                                <div class="blog-post-share justify-content-start mt-4">
                                                    <h5 class="title">{{ __('Share:') }}</h5>
                                                    <ul class="list-wrap">
                                                        <li><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u={{ urlencode($post->url) }}"><i class="fab fa-facebook-f"></i></a></li>
                                                        <li><a target="_blank" href="https://twitter.com/intent/tweet?url={{ urlencode($post->url) }}&text={{ strip_tags($post->description) }}"><i class="fab fa-twitter"></i></a></li>
                                                        <li><a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url={{ urlencode($post->url) }}&summary={{ rawurldecode(strip_tags($post->description)) }}"><i class="fab fa-linkedin-in"></i></a></li>
                                                        <li><a target="_blank" href="https://pinterest.com/pin/create/button?media={{ urlencode(RvMedia::getImageUrl($post->image, null, false, RvMedia::getDefaultImage())) }}&url={{ urlencode($post->url) }}&description={{ strip_tags($post->description) }}"><i class="fab fa-pinterest-p"></i></a></li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
                <div class="col-29">
                    <aside class="sidebar-widget">
                        {!! dynamic_sidebar('blog_sidebar') !!}
                    </aside>
                </div>
            </div>
        </div>
    </div>
</section>
