<?php
$pageTitle='Underground FX Radio Jockeys'; include 'includes/header.php';
$djs = is_file(__DIR__.'/data/djs.json') ? json_decode((string)file_get_contents(__DIR__.'/data/djs.json'), true) : [];
if (!is_array($djs)) $djs = [];
function dj_asset(string $path, string $fallback='img/djs'): string { $path=trim($path); if($path==='') return ''; if(preg_match('#^(https?:)?//#i',$path)) return $path; $path=ltrim(str_replace('\\','/',$path),'/'); if(strpos($path,'/')===false) $path=trim($fallback,'/').'/'.$path; return '/'.$path; }
?>
<section class="container-fluid container-xxl fx-page-hero"><div class="fx-section-card"><div class="fx-section-kicker">Roster wall</div><h1>Real Underground FX radio-jockey profiles</h1><p>This page keeps your actual DJ data while giving it a cleaner filterable flagship wall. No generic filler. No toy layout.</p><div class="fx-search-bar mt-4"><i class="bi bi-search"></i><input id="djSearch" type="text" placeholder="Search DJs by name, show or bio"></div></div></section>
<section class="container-fluid container-xxl fx-section-block"><div class="row g-4" id="djRosterGrid"><?php foreach($djs as $dj): $img=dj_asset((string)($dj['image'] ?? '')); $search=strtolower(trim((string)($dj['name'] ?? '') . ' ' . (string)($dj['show'] ?? '') . ' ' . (string)($dj['bio'] ?? ''))); ?><div class="col-md-6 col-xl-4 dj-card-item" data-search="<?= htmlspecialchars($search, ENT_QUOTES, 'UTF-8') ?>"><article class="fx-dj-profile h-100"><?php if($img!==''): ?><img src="<?= htmlspecialchars($img, ENT_QUOTES, 'UTF-8') ?>" alt="<?= htmlspecialchars((string)($dj['name'] ?? 'DJ'), ENT_QUOTES, 'UTF-8') ?>"><?php endif; ?><div class="p-4"><div class="fx-chip-row mb-3"><span class="fx-chip">Underground FX</span><span class="fx-chip">Radio Jockey</span></div><h3><?= htmlspecialchars((string)($dj['name'] ?? 'Underground FX DJ'), ENT_QUOTES, 'UTF-8') ?></h3><?php if(!empty($dj['show'])): ?><h4><?= htmlspecialchars((string)$dj['show'], ENT_QUOTES, 'UTF-8') ?></h4><?php endif; ?><p><?= nl2br(htmlspecialchars((string)($dj['bio'] ?? 'Live radio-jockey profile.'), ENT_QUOTES, 'UTF-8')) ?></p></div></article></div><?php endforeach; ?></div></section>
<?php include 'includes/footer.php'; ?>