@forelse($blogs as $blog)
<div class="col-span-12 mb-30">
    <div class="flex max-sm:flex-col gap-30 items-center">
        <div class="dz-media flex-1">
            <a href="{{DzHelper::laraBlogLink($blog->id)}}">
                <img src="{{ DzHelper::getStorageImage('storage/blog-images/'.@$blog->feature_img->value) }}" alt="{{ __('Blog Image') }}">
            </a>
        </div>
        <div class="dz-info flex-1">
            <div class="dz-meta mb-10">
                <ul>
                    @if(!empty($date_on))
                    <li class="text-base/16 dark:text-bodytext text-textlight pe-10 inline-block relative before:content-[''] before:absolute before:h-1 before:w-10 before:left-0 before:top-1/2 before:-translate-y-1/2 first:before:hidden dark:before:bg-bodytext before:bg-textlight">{{ Carbon\Carbon::parse($blog->publish_on)->format(config('Site.custom_date_format')) }}</li>
                    @endif
                    <li class="text-base/16 dark:text-bodytext text-textlight ps-20 inline-block relative before:content-[''] before:absolute before:h-1 before:w-10 before:left-0 before:top-1/2 before:-translate-y-1/2 first:before:hidden dark:before:bg-bodytext before:bg-textlight">{{ __('By') }} <a href="{{DzHelper::author($blog->user_id)}}">{{ optional($blog->user)->name }}</a></li>
                </ul>
            </div>
                @php
                if($blog->visibility != 'Pu'){
                    $blog_visibility = $blog->visibility == 'Pr' ? __('Private: ') : __('Protected: ') ;
                }else {
                    $blog_visibility = '';
                }

                $blog_title = ($post_title_length_type == 'on_words') ? Str::words($blog->title, $post_title_length, ' ...') : Str::limit($blog->title, $post_title_length, ' ...');
                $blog_excerpt = ($post_excerpt_length_type == 'on_words') ? Str::words($blog->excerpt, $post_excerpt_length, ' ...') : Str::limit($blog->excerpt, $post_excerpt_length, ' ...');
            @endphp
            <h4 class="text-2xxl/35 mb-10">
                <a class="hover:text-primary" href="{{DzHelper::laraBlogLink($blog->id)}}">
                    {{ $blog_visibility }}{{ $blog_title }}
                </a>
            </h4>
            <p class="text-xl mb-25">{{ $blog_excerpt }}</p>
            <a 
                href="{{DzHelper::laraBlogLink($blog->id)}}"
                class="btn btn-primary h-40" 
            >
                {{ __('Read More') }}
            </a>
        </div>
    </div>
</div>
@empty
<div class="col-span-12 py-20 text-center dark:text-white text-xl"><strong>{{ __('No blogs found.') }}</strong></div>
@endforelse