<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * Public footer — closes <main>, renders footer, WhatsApp float, scripts.
 * Expects: $footer_services, $footer_partners (from Public_Controller::render).
 */
$services = isset($footer_services) ? $footer_services : array();
$socials  = array(
	'instagram' => array(setting('instagram'), 'instagram'),
	'facebook'  => array(setting('facebook'), 'sparkle'),
	'tiktok'    => array(setting('tiktok'), 'play'),
	'youtube'   => array(setting('youtube'), 'play'),
);
?>
</main>

<!-- ============ CONTACT CTA BAND ============ -->
<section class="section section--tight">
	<div class="container">
		<div class="cta-band" data-reveal>
			<span class="eyebrow" style="justify-content:center;">Let's Create Together</span>
			<h2>Ready to build something <span class="serif-italic text-iris">unforgettable?</span></h2>
			<p>Whether you're a brand seeking a creative partner or talent ready for the spotlight — Bloom Iris is your stage.</p>
			<div class="hero-ctas">
				<a href="<?= base_url('contact') ?>" class="btn btn-light btn-lg">Start a Project</a>
				<a href="<?= base_url('apply/talent') ?>" class="btn btn-outline-light btn-lg">Join the Talent Network</a>
			</div>
		</div>
	</div>
</section>

<!-- ============ FOOTER ============ -->
<footer class="site-footer">
	<div class="container">
		<div class="footer-top">
			<div class="footer-brand">
				<a href="<?= base_url() ?>" class="brand-logo">
					<span class="brand-mark">b</span>
					<span class="brand-text">
						<span class="brand-name"><?= html_escape(setting('site_name', 'Bloom Iris')) ?></span>
						<span class="brand-tag">Creative Agency</span>
					</span>
				</a>
				<p><?= html_escape(setting('footer_text', 'A creative universe of talent, campaigns and unforgettable experiences.')) ?></p>
				<div class="footer-socials">
					<?php foreach ($socials as $key => $s): if (empty($s[0])) continue; ?>
						<a href="<?= html_escape($s[0]) ?>" target="_blank" rel="noopener" aria-label="<?= $key ?>">
							<?= bloom_icon($s[1], 19) ?>
						</a>
					<?php endforeach; ?>
				</div>
			</div>

			<div class="footer-col">
				<h4>Explore</h4>
				<ul>
					<li><a href="<?= base_url('about') ?>">About Us</a></li>
					<li><a href="<?= base_url('portfolio') ?>">Portfolio</a></li>
					<li><a href="<?= base_url('talent') ?>">Talent Roster</a></li>
					<li><a href="<?= base_url('events') ?>">Events</a></li>
					<li><a href="<?= base_url('blog') ?>">The Journal</a></li>
				</ul>
			</div>

			<div class="footer-col">
				<h4>Services</h4>
				<ul>
					<?php foreach (array_slice($services, 0, 5) as $svc): ?>
						<li><a href="<?= base_url('services/view/'.$svc['slug']) ?>"><?= html_escape($svc['title']) ?></a></li>
					<?php endforeach; ?>
					<?php if (empty($services)): ?>
						<li><a href="<?= base_url('services') ?>">Our Services</a></li>
					<?php endif; ?>
				</ul>
			</div>

			<div class="footer-col footer-news">
				<h4>Stay in the Loop</h4>
				<p>Campaign drops, talent calls and creative insights — straight to your inbox.</p>
				<form class="news-form" data-newsletter action="<?= base_url('newsletter/subscribe') ?>" method="post">
					<?= form_hidden($this->security->get_csrf_token_name(), $this->security->get_csrf_hash()) ?>
					<input type="email" name="email" placeholder="Your email address" required>
					<button type="submit" aria-label="Subscribe"><?= bloom_icon('arrow', 20) ?></button>
				</form>
				<p style="margin-top:18px;font-size:.86rem;">
					<?= bloom_icon('mail', 15) ?> <?= html_escape(setting('email', 'hello@bloomiris.com')) ?><br>
					<?= bloom_icon('phone', 15) ?> <?= html_escape(setting('phone', '')) ?>
				</p>
			</div>
		</div>

		<div class="footer-bottom">
			<span>&copy; <?= date('Y') ?> <?= html_escape(setting('site_name', 'Bloom Iris Agency')) ?>. All rights reserved.</span>
			<span>Designed &amp; developed by <a href="mailto:asorkuenu@gmail.com">Savior Gbogbo Asorkuenu</a></span>
		</div>
	</div>
</footer>

<!-- ============ WHATSAPP FLOAT ============ -->
<a href="<?= whatsapp_link() ?>" class="wa-float" target="_blank" rel="noopener" aria-label="Chat on WhatsApp">
	<?= bloom_icon('whatsapp', 30) ?>
</a>

<script src="<?= asset_url('js/bloom.js') ?>"></script>
<?php if ($ga = setting('google_analytics')): ?>
	<?= $ga ?>
<?php endif; ?>
</body>
</html>
