@extends('layouts.master')

@section('page-title', $podcast->name)

@section('meta_description', 'Selected artwork for the ' . $podcast->name . ' podcast on the No Agenda Art Generator')

@section('page-top')
<section class="inner-page-banner bg-2 bg-image">
    <div class="container">
        <div class="inner text-center">
            <h1 class="title">{{ $podcast->name }}</h1>
            <nav class="mt-4">
                <ol class="breadcrumb justify-content-center">
                    <li class="breadcrumb-item"><a href="/">Home</a></li>
                    <li class="breadcrumb-item"><a href="/podcasts">Podcasts</a></li>
                    <li class="breadcrumb-item active">Podcast</li>
                </ol>
            </nav>
        </div>
    </div>
</section>
@endsection

@section('page-content')
<section class="pt-120 pb-90 masonary-wrapper-activation">
    <div class="container">
        <div class="row">
            {{ $episodes->links() }}
        </div>
    </div>
    <div class="container">
        <div class="grid-filter-wrapper masonry-list">
            <div class="resizer"></div>
            @foreach ($episodes as $episode)
                <div class="grid-item podcast--{{ $episode->podcast->slug }}">
                    <div class="explore-style-one flex-stretch">
                        <div class="thumb">
                            <a href="/podcast/{{ $episode->podcast->slug }}/episode/{{ $episode->slug }}"
                                data-bs-toggle="tooltip"
                                data-bs-placement="top"
                                title="View This Episode">
                                <img src="{{ config('app.static_asset_url')
                                    . '/thumbnails/'
                                    . $episode->artwork->filename ?? '#'}}"
                                    alt="{{ $episode->title }},  {{ $episode->podcast->name }} Episode {{ number_format($episode->episode_number + 0) }}">
                            </a>
                        </div>
                        <div class="content">
                            <div class="header d-flex-between pt-4 pb-1">
                                <h3 class="title"><a href="/podcast/{{ $episode->podcast->slug }}/episode/{{ $episode->slug }}">"{{  $episode->title }}"</a></h3>
                            </div>
                            <div class="product-owner py-0 pb-2 d-flex-between">
                                <h4>{{ $episode->podcast->name }}</h4>
                            </div>
                            <div class="product-owner py-0 d-flex-between">
                                <span class="bid-owner">Episode {{ number_format($episode->episode_number + 0) }}</span>
                            </div>
                            <div class="product-owner py-0 pb-4 d-flex-between">
                                <span class="bid-owner"><em>{{ $episode->episode_date->format('D, M j') }}<sup>{{ $episode->episode_date->format('S') }}</sup>{{ $episode->episode_date->format(', Y') }}</em></span>
                            </div>
                            <div class="action-wrapper py-1 mt-4 d-flex-between">
                                <span class="bid-owner">Artwork By<br><strong><a
                                    href="/artist/{{ $episode->artwork->artist->slug }}">{{ $episode->artwork->artist->name ?? 'Unknown' }}</a></strong></span>
                                <span class="profile-share d-flex-center"><a href="/artist/{{ $episode->artwork->artist->slug }}"
                                    class="avatar" data-bs-toggle="tooltip"
                                    data-bs-placement="top"
                                    title="{{ $episode->artwork->artist->name }}">
                                        <img class="avatar_img" src="{{ $episode->artwork->artist->avatar() }}"
                                            alt="{{ $episode->artwork->artist->name }}"></a>
                                </span>
                            </div>
                            <div class="action-wrapper py-1 mb-1 d-flex-between">
                                <span class="bid-owner">{{ number_format($episode->approvedArtworks->count()) }} Artworks Submitted</span>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
    <div class="container">
        <div class="row">
            {{ $episodes->links() }}
        </div>
    </div>
</section>
@endsection
