<?php include 'includes/header.php'; $items=file_exists(__DIR__.'/data/news.json')?json_decode(file_get_contents(__DIR__.'/data/news.json'),true):[]; if(!is_array($items))$items=[]; ?>
<div class="container content-box mt-5"><div class="text-center mb-5"><h1>Station News</h1><p class="subtext">Latest updates from Home Time Radio</p></div><?php foreach(array_reverse($items) as $item): ?><div class="bg-light p-4 rounded mb-4"><h3><?= htmlspecialchars($item['title']??'News Update') ?></h3><?php if(!empty($item['timestamp'])): ?><div style="opacity:.75;" class="mb-2"><?= htmlspecialchars($item['timestamp']) ?></div><?php endif; ?><p><?= nl2br(htmlspecialchars($item['body'] ?? $item['content'] ?? '')) ?></p></div><?php endforeach; ?><?php if(empty($items)): ?><div class="bg-light p-4 rounded">No news posted yet.</div><?php endif; ?></div><?php include 'includes/footer.php'; ?>
