{{-- ============================================================ DETAIL NEWS GAPKINDO — Elegant Article Page Struktur: 1. Banner header (navy + checkerboard, compact) 2. Hero section: title + meta (date, source) 3. Featured image (large, hero-style) 4. Article body (readable typography, max-width) 5. Article footer: print, share, info card 6. CTA back to news list + home ============================================================ --}} @extends('guest.layouts.master') @section('title', $dataNews->title . ' | GAPKINDO') @push('styles') @endpush @section('content') @php $publishDate = $dataNews->created_at ? \Carbon\Carbon::parse($dataNews->created_at)->locale('id')->isoFormat('D MMMM Y') : '-'; $relativeDate = $dataNews->created_at ? \Carbon\Carbon::parse($dataNews->created_at)->diffForHumans() : ''; // Split content into paragraphs for proper book-style typography $content = trim($dataNews->content ?? ''); $paragraphs = preg_split('/\n\s*\n/', $content); if (count($paragraphs) === 1 && strpos($content, "\n") !== false) { // Fallback: split single newlines if no double newlines exist $paragraphs = preg_split('/\n+/', $content); } $paragraphs = array_filter(array_map('trim', $paragraphs)); // Reading time estimation (~200 words per minute for Indonesian) $wordCount = str_word_count(strip_tags($content)); $readingTime = max(1, ceil($wordCount / 200)); @endphp
{{-- ===================================================== 1. MINI BANNER — Breadcrumb-style ===================================================== --}}
Beranda / Berita / Detail
{{-- ===================================================== 2. HERO CONTENT — Title + Meta ===================================================== --}}
Artikel Berita

{{ $dataNews->title }}

{{ $publishDate }} @if(!empty($dataNews->source)) Sumber: {{ $dataNews->source }} @endif
{{-- ===================================================== 3. FEATURED IMAGE ===================================================== --}} @if(!empty($dataNews->image))
{{ $dataNews->title }}
@endif {{-- ===================================================== 4. ARTICLE BODY — Magazine/Book Style ===================================================== --}}
{{-- Reading Info Bar --}}
{{ $readingTime }} menit baca {{ number_format($wordCount) }} kata
{{-- Book-style page --}}
— Artikel —
@foreach($paragraphs as $para)

{!! nl2br(e($para)) !!}

@endforeach
{{-- ===================================================== 5. ARTICLE FOOTER — Detail Card + Actions ===================================================== --}} {{-- ===================================================== 6. CTA BACK ===================================================== --}}
@endsection @push('scripts') @endpush