<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/** TALENT LISTING — Expects: $talent, $categories, $counts, $active_cat. */
?>
<section class="page-hero">
	<div class="container">
		<div class="page-hero-inner" data-reveal>
			<div class="breadcrumb"><a href="<?= base_url() ?>">Home</a> / <span>Talent</span></div>
			<span class="eyebrow">The Roster</span>
			<h1>The faces of <span class="serif-italic text-iris">tomorrow</span></h1>
			<p>A curated network of models, influencers, creatives and stylists ready for your next campaign.</p>
		</div>
	</div>
</section>

<section class="section">
	<div class="container">
		<div class="filter-bar" data-filter-bar="#talent-grid" data-reveal>
			<button class="filter-chip <?= $active_cat === 'all' ? 'active' : '' ?>" data-filter="all">All Talent</button>
			<?php foreach ($categories as $slug => $label): if (empty($counts[$slug])) continue; ?>
				<button class="filter-chip <?= $active_cat === $slug ? 'active' : '' ?>" data-filter="<?= $slug ?>">
					<?= html_escape($label) ?> <span style="opacity:.6;">(<?= $counts[$slug] ?>)</span>
				</button>
			<?php endforeach; ?>
		</div>

		<?php if ($talent): ?>
			<div class="card-grid cols-4" id="talent-grid">
				<?php foreach ($talent as $i => $t): ?>
					<a href="<?= base_url('talent/view/'.$t['slug']) ?>" class="talent-card" data-category="<?= $t['category'] ?>" data-reveal data-delay="<?= ($i % 4) + 1 ?>">
						<div class="talent-media">
							<img src="<?= upload_url($t['photo'], 'img/talent-fallback.jpg') ?>" alt="<?= html_escape($t['name']) ?>" loading="lazy">
						</div>
						<div class="talent-overlay">
							<span class="talent-cat"><?= html_escape($categories[$t['category']] ?? $t['category']) ?></span>
							<h3><?= html_escape($t['name']) ?></h3>
							<p><?= html_escape($t['tagline']) ?></p>
						</div>
					</a>
				<?php endforeach; ?>
			</div>
		<?php else: ?>
			<?= empty_state('Talent profiles will appear here soon.') ?>
		<?php endif; ?>

		<!-- JOIN CTA -->
		<div class="cta-band" data-reveal style="margin-top:56px;">
			<span class="eyebrow" style="justify-content:center;">Are You Talent?</span>
			<h2>Join the Bloom Iris <span class="serif-italic text-iris">network</span></h2>
			<p>We're always discovering new faces. Submit your application and become part of the Bloom Iris universe.</p>
			<div class="hero-ctas"><a href="<?= base_url('apply/talent') ?>" class="btn btn-light btn-lg">Apply Now</a></div>
		</div>
	</div>
</section>
