@php
            $items = \App\Models\Backend\ContentDownload::where('download_status', 'ACTIVE')->where('download_language', $lang)->whereIn('download_category', ['REPORT', 'POLICY', 'MANUAL'])->orderBy('download_date', 'desc')->get();
            $categories = \App\Models\Backend\Ref::where('cat', 'DOWNLOAD_CAT')->orderBy('sort')->pluck('descr', 'code');
            @endphp
            @if($items->count())
            <section class="penerbitan-section">
                <div class="container">
                    <div class="penerbitan-header">
                        <span class="penerbitan-badge">Penerbitan</span>
                        <h1 class="penerbitan-title">Penerbitan</h1>
                        <p class="penerbitan-subtitle">Koleksi laporan, dasar dan manual rasmi.</p>
                    </div>
                    <div class="penerbitan-list">
                        @foreach($items as $item)
                        <div class="penerbitan-item">
                            <div class="penerbitan-icon">
                                <i class="fas fa-file-alt"></i>
                            </div>
                            <div class="penerbitan-info">
                                <span class="penerbitan-item-title">{{ $item->download_title }}</span>
                                <span class="penerbitan-item-cat">{{ $categories[$item->download_category] ?? $item->download_category }}</span>
                                @if($item->download_source)<span class="penerbitan-source">{{ $item->download_source }}</span>@endif
                            </div>
                            @if($item->download_file)
                            <a href="{{ image_url($item->download_file) }}" class="penerbitan-btn" download><i class="fas fa-download"></i> Muat Turun</a>
                            @else
                            <span class="penerbitan-btn disabled"><i class="fas fa-clock"></i> Segera</span>
                            @endif
                        </div>
                        @endforeach
                    </div>
                </div>
            </section>
            <style>
            .penerbitan-section { padding: 60px 0 80px; background: var(--gray-50); min-height: 60vh; }
            .penerbitan-header { text-align: center; margin-bottom: 50px; }
            .penerbitan-badge { display: inline-block; background: var(--accent-light); color: var(--accent); padding: 6px 16px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin-bottom: 16px; }
            .penerbitan-title { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin: 0 0 12px; }
            .penerbitan-subtitle { color: var(--gray-400); font-size: 1rem; margin: 0; }
            .penerbitan-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
            .penerbitan-item { display: flex; align-items: center; gap: 16px; background: var(--white); padding: 18px 22px; border-radius: 12px; border: 1px solid var(--gray-200); transition: box-shadow 0.2s, border-color 0.2s; }
            .penerbitan-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
            .penerbitan-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--primary); border-radius: 10px; font-size: 1.2rem; flex-shrink: 0; }
            .penerbitan-info { flex: 1; min-width: 0; }
            .penerbitan-item-title { display: block; font-size: 0.9rem; font-weight: 500; color: var(--gray-800); margin-bottom: 2px; }
            .penerbitan-item-cat { font-size: 0.78rem; color: var(--gray-400); }
            .penerbitan-source { display: block; font-size: 0.78rem; color: var(--gray-400); margin-top: 2px; }
            .penerbitan-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; background: var(--primary); color: white; border-radius: 8px; font-size: 0.8rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background 0.2s; }
            .penerbitan-btn:hover { background: var(--primary-light); }
            .penerbitan-btn.disabled { background: var(--gray-200); color: var(--gray-400); cursor: default; pointer-events: none; }
            .penerbitan-btn i { font-size: 0.75rem; }
            @media (max-width: 768px) {
                .penerbitan-section { padding: 30px 0 50px; }
                .penerbitan-title { font-size: 1.4rem; }
                .penerbitan-item { flex-direction: column; align-items: stretch; gap: 12px; }
                .penerbitan-btn { justify-content: center; }
            }
            </style>
            @else
            <section style="padding:80px 0;text-align:center;background:var(--gray-50);min-height:50vh;"><div class="container"><i class="fas fa-book-open" style="font-size:3rem;color:var(--gray-300);margin-bottom:20px;"></i><h2 style="color:var(--gray-500);font-weight:500;font-size:1.2rem;">Tiada Penerbitan</h2><p style="color:var(--gray-400);margin:10px 0 30px;">Tiada penerbitan buat masa ini.</p><a href="/{{ $siteSlug }}" style="display:inline-flex;align-items:center;gap:8px;padding:12px 24px;background:var(--primary);color:white;border-radius:10px;text-decoration:none;font-size:0.85rem;"><i class="fas fa-arrow-left"></i> Kembali</a></div></section>
            @endif
            