@extends('layouts.public')
@section('content')
@php
/**
* Modern single-post page (template-blend). Reuses the working logic of
* blog-detail.php verbatim (comment render closure, comment flash extraction,
* share url, comment form, prev/next nav, related posts) and swaps the chrome
* for the .qm-blogm-* creative subheader + two-sidebar layout.
*
* @var array $post the post row (joined with category_name/slug, author_avatar)
* @var array $related up to 3 related posts
* @var array $comments threaded approved comments (parents w/ 'replies')
* @var int $commentCount total approved comments
* @var array|null $prevPost ['title','slug'] or null
* @var array|null $nextPost ['title','slug'] or null
* @var array $tags real per-post tags: [['label'=>..,'url'=>..], ..]
* @var int $readMinutes estimated reading time in minutes
* @var array $popularPosts 4 popular post rows (+ 'tags') for the left sidebar
* @var array $tagCloud deduped [['label'=>..,'url'=>..], ..] for the left sidebar
* @var array $categories {name, slug, post_count} for the left sidebar
* @var array $featuredRestaurants restaurant rows for the left sidebar
* @var array|null $featured most-viewed post for the right sidebar
*/
$tags = $tags ?? [];
$readMinutes = (int) ($readMinutes ?? 1);
/** Render one comment block; replies are indented by the caller. */
$renderComment = static function ($c): void { // array row or BlogComment model
$when = !empty($c['created_at']) ? fmt_day($c['created_at']) : '';
@endphp
@php
};
// Consume the comment-specific flash here so it renders INLINE in the form card
// (not in the global top-of-page banner). getFlashes() in the layout will then
// not see these keys.
$commentOk = \App\Support\Session::pullFlash('comment_ok');
$commentErr = \App\Support\Session::pullFlash('comment_err');
$shareUrl = url('/blog/' . $post['slug']);
$activeCat = (string) ($post['category_slug'] ?? '');
$two = $twoSidebars ?? true; // admin: two sidebars (default) or one (right only)
@endphp
@partial('subheader', [
'type' => 'post',
'title' => $post['title'],
'eyebrow' => t_raw('blog.eyebrow_from_kitchen'),
'crumbs' => [
['label' => t_raw('common.home'), 'url' => route('home')],
['label' => t_raw('footer.blog'), 'url' => route('blog')],
['label' => str_excerpt((string) $post['title'], 6)],
],
])
@if ($two)
@endif
@php // Title shown in the subheader h1; keep one visible title — the in-article heading is for assistive tech only.
@endphp
{{ $post['title'] }}
@php // Author + date meta mirrors the archive card foot for one consistent look, plus the category badge.
@endphp