<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * SEO / OpenGraph meta block. Expects $meta array from the controller.
 */
$m = isset($meta) ? $meta : array();
$title = isset($m['title']) ? $m['title'] : 'Bloom Iris Agency';
$desc  = isset($m['description']) ? $m['description'] : '';
$img   = isset($m['image']) ? $m['image'] : base_url('assets/img/og-default.jpg');
$url   = isset($m['url']) ? $m['url'] : current_url();
$kw    = isset($m['keywords']) ? $m['keywords'] : '';
?>
<title><?= html_escape($title) ?></title>
<meta name="description" content="<?= html_escape($desc) ?>">
<?php if ($kw): ?><meta name="keywords" content="<?= html_escape($kw) ?>"><?php endif; ?>
<link rel="canonical" href="<?= html_escape($url) ?>">

<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Bloom Iris Agency">
<meta property="og:title" content="<?= html_escape($title) ?>">
<meta property="og:description" content="<?= html_escape($desc) ?>">
<meta property="og:image" content="<?= html_escape($img) ?>">
<meta property="og:url" content="<?= html_escape($url) ?>">

<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?= html_escape($title) ?>">
<meta name="twitter:description" content="<?= html_escape($desc) ?>">
<meta name="twitter:image" content="<?= html_escape($img) ?>">

<!-- JSON-LD -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Bloom Iris Agency",
  "url": "<?= base_url() ?>",
  "description": "<?= html_escape(setting('meta_description', '')) ?>",
  "sameAs": [
    "<?= setting('instagram', '') ?>",
    "<?= setting('facebook', '') ?>",
    "<?= setting('tiktok', '') ?>"
  ]
}
</script>
