@extends($activeTemplate . 'layouts.frontend')
@section('content')
    <section class="page-section py-120" id="tools">
        <div class="container">
            <div class="row gy-5 gx-0 gy-lg-0 gx-lg-5">
                <div class="col-lg-8 col-xl-9">
                    <div class="page-content">
                        <div class="blog-details">
                            <div class="blog-details__thumb">
                                <img src="{{ frontendImage('blog', @$blog->data_values->image, '960x450') }}"
                                     class="fit-image" alt="image">
                            </div>

                            <div class="blog-details__content">
                                <ul class="blog-item-meta">
                                    <li class="blog-item-meta__item">
                                        <span class="icon"><i class="fas fa-calendar-alt"></i></span>
                                        <span class="text">{{ showDateTime($blog->created_at, 'd M Y') }}</span>
                                    </li>
                                </ul>

                                <h2 class="blog-details__title">
                                    {{ __($blog->data_values->title) }}
                                </h2>

                                <div class="blog-details__desc">
                                    <p>@php echo @$blog->data_values->description @endphp</p>
                                </div>

                                <div class="blog-details__share">
                                    <h5 class="social-share__title mb-0 me-sm-3 me-1 d-inline-block">
                                        @lang('Share'):
                                    </h5>
                                    <ul class="social-list">
                                        <li class="social-list__item">
                                            <a href="https://www.facebook.com/sharer/sharer.php?u={{ urlencode(url()->current()) }}"
                                               class="social-list__link flex-center">
                                                <i class="fab fa-facebook-f"></i>
                                            </a>
                                        </li>
                                        <li class="social-list__item">
                                            <a href="https://twitter.com/intent/tweet?text= {{ __(strLimit($blog->data_values->title, 150)) }}&amp;url={{ urlencode(url()->current()) }}"
                                               class="social-list__link flex-center">
                                                <i class="fab fa-twitter"></i>
                                            </a>
                                        </li>
                                        <li class="social-list__item">
                                            <a href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ urlencode(url()->current()) }}&amp;title={{ __(strLimit($blog->data_values->title, 150)) }}&amp;summary={{ __(strLimit(strip_tags(@$blog->data_values->description_nic), 300)) }}"
                                               class="social-list__link flex-center">
                                                <i class="fab fa-linkedin-in"></i>
                                            </a>
                                        </li>
                                        <li class="social-list__item">
                                            <a href="https://www.pinterest.com/pin/create/button/?url={{ urlencode(url()->current()) }}&description={{ __(@$blog->data_values->title) }}&media={{ frontendImage('blog', $blog->data_values->image, '1000x500') }}"
                                               class="social-list__link flex-center">
                                                <i class="fab fa-pinterest"></i>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                                <div class="fb-comments" data-href="{{ url()->current() }}" data-numposts="5"></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-xl-3 col-lg-4">
                    <div class="blog-details-sidebar">
                        @if (gs('custom_ads'))
                            <div class="sidebar-block">
                                <div class="ad-banner ad-banner--page sidebar-thumb">
                                    <x-ads size="300x600" />
                                </div>
                            </div>
                        @endif
                        <div class="sidebar-block">
                            <div class="sidebar-block__header">
                                <h5 class="sidebar-block__title">@lang('Latest Blogs')</h5>
                            </div>

                            <div class="sidebar-block__body">
                                <div class="latest-blog">
                                    @foreach ($recentBlogs as $blog)
                                        <div class="latest-blog-item">
                                            <a href="{{ route('blog.details', $blog->slug) }}"
                                               class="latest-blog-item__thumb">
                                                <img src="{{ frontendImage('blog', @$blog->data_values->image, '480x225', thumb: true) }}" alt="image">
                                            </a>
                                            <div class="latest-blog-item__content">
                                                <h6 class="latest-blog-item__title">
                                                    <a href="{{ route('blog.details', $blog->slug) }}">{{ __(@$blog->data_values->title) }}</a>
                                                </h6>
                                                <span class="latest-blog-item__date">{{ showDateTime($blog->created_at, 'd M Y') }}</span>
                                            </div>
                                        </div>
                                    @endforeach
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </section>
@endsection
@push('fbComment')
    @php echo loadExtension('fb-comment') @endphp
@endpush

@push('style')
    <style>
        .blog-details__thumb {
            height: 450px;
            max-height: 100%;
            border-radius: 6px;
            overflow: hidden;
        }

        .blog-details__content {
            padding: 0;
            margin-top: 30px;
        }
    </style>
@endpush
