@extends('layouts.master')

@section('title', $post->title)

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ route('blog.index') }}">Blog</a></li>
                    @if($post->category)
                        <li class="breadcrumb-item"><a href="{{ route('blog.category', $post->category->slug) }}">{{ $post->category->name }}</a></li>
                    @endif
                    <li class="breadcrumb-item active" aria-current="page">{{ $post->title }}</li>
                </ol>
            </nav>

            <h1 class="fw-bold mb-3">{{ $post->title }}</h1>
            <p class="text-muted mb-4">Published on {{ $post->published_at->format('F d, Y') }}</p>

            @if($post->image)
                <img src="{{ asset('storage/' . $post->image) }}" class="img-fluid rounded mb-4 w-100" alt="{{ $post->title }}">
            @endif

            <div class="content">
                {!! $post->content !!}
            </div>
        </div>
    </div>
</div>
@endsection
