{{--
    Tag stories page — /stories/tag/{tag}
    Uses ContentLayout.
--}}
@extends('layouts.nova.content-layout')

@php
    $hero_title = '#' . $storyTag->name;
    $hero_description = 'Stories tagged with "' . $storyTag->name . '".';
@endphp

@section('page-content')

<div class="space-y-8">
    <div class="rounded-xl border border-gray-700 bg-gray-800/60 p-6">
        <h2 class="text-xl font-semibold tracking-tight text-white">Tagged Stories</h2>
        <p class="mt-2 text-sm text-gray-300">Browsing stories tagged with <span class="text-sky-300">#{{ $storyTag->name }}</span>.</p>
    </div>

    @if($stories->isNotEmpty())
        <div class="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3">
            @foreach($stories as $story)
                <x-story-card :story="$story" />
            @endforeach
        </div>

        <div class="mt-8">{{ $stories->links() }}</div>
    @else
        <div class="rounded-xl border border-gray-700 bg-gray-800/50 px-8 py-16 text-center text-sm text-gray-300">
            No stories found for this tag.
        </div>
    @endif
</div>

@endsection
