@extends(getTemplate().'.layouts.app')

@php
    $blogHeroExtra = view('web.default.blog.partials.hero_search')->render();
@endphp

@section('content')
    @include('web.default.includes.premium.page_hero', [
        'variant' => 'image',
        'backgroundUrl' => getPageBackgroundSettings('blog'),
        'backgroundAlt' => '',
        'title' => $pageTitle,
        'kicker' => trans('home.blog'),
        'subtitle' => $blogCount.' '.trans('site.posts'),
        'extra' => $blogHeroExtra,
    ])

    <section class="container mt-10 mt-md-40">
        <div class="row">
            <div class="col-12 col-lg-8">
                <div class="row premium-blog-index-grid">
                    @foreach($blog as $post)
                        <div class="col-12 col-md-6">
                            <div class="mt-10 mt-md-15 h-100">
                                @include('web.default.blog.grid-list',['post' => $post])
                            </div>
                        </div>
                    @endforeach
                </div>
            </div>

            <div class="col-12 col-lg-4">
                @include('web.default.includes.premium.sidebar_panel', [
                    'title' => trans('categories.categories'),
                    'body' => view('web.default.blog.partials.sidebar_categories_body', ['blogCategories' => $blogCategories])->render(),
                    'class' => 'mt-10 mt-lg-30',
                ])

                @include('web.default.includes.premium.sidebar_panel', [
                    'title' => trans('site.popular_posts'),
                    'body' => view('web.default.blog.partials.sidebar_popular_body', ['popularPosts' => $popularPosts])->render(),
                    'class' => 'mt-30',
                ])
            </div>
        </div>

        <div class="mt-20 mt-md-50 pt-30 pb-20">
            {{ $blog->appends(request()->input())->links('vendor.pagination.panel') }}
        </div>
    </section>
@endsection
