@php
    /** @var \App\Models\BlogPost $post */
    $thumb = $post->featured_image
        ? url('uploads/blog/posts/' . $post->featured_image)
        : asset('theme/assets/image/blog-1.jpg');
    $postDate = \App\Support\Jalali::format($post->published_at ?: $post->created_at, 'j F Y');
@endphp
<div class="blog-item">
    <a href="{{ $post->url() }}">
        <div class="image">
            <img src="{{ $thumb }}" alt="{{ $post->featured_image_alt ?: $post->title }}" class="img-fluid">
        </div>
        <div class="title">
            <div class="d-flex align-items-center justify-content-between">
                <div class="title-item">
                    <i class="bi bi-tag me-1"></i>
                    <span class="font-12">{{ $post->category?->name ?: '—' }}</span>
                </div>
                <div class="title-item">
                    <i class="bi bi-alarm me-1"></i>
                    <span class="font-12">{{ $postDate }}</span>
                </div>
            </div>
            <h4 class="font-16 text-overflow-1 h4">{{ $post->title }}</h4>
        </div>
    </a>
</div>
