<?php
$cmsRoot = defined('CMS_ROOT') ? CMS_ROOT : dirname(__DIR__, 4);
$siteTitle = defined('CMS_SITE_TITLE') ? CMS_SITE_TITLE : 'Satta Matka';
$themeData = $GLOBALS['theme_data'] ?? [];
$metaTitle = trim((string) ($themeData['meta_title'] ?? ''));
$metaDescription = trim((string) ($themeData['meta_description'] ?? ''));
$pageTitle = $metaTitle !== '' ? $metaTitle : $siteTitle;
$pageDescription = $metaDescription !== '' ? $metaDescription : 'Get todays Satta Matka live updates and Kalyan Matka results. Learn about the Satta Matka, matka guessing, satta matta matka, sattamatka and history on sattamatkalive.org.';
$canonicalUrl = function_exists('theme_canonical_url') ? theme_canonical_url() : 'https://sattamatkalive.org/';
$schemaMarkup = function_exists('theme_schema_markup') ? theme_schema_markup() : '';
$dynamicMenu = function_exists('cms_render_menu') ? cms_render_menu() : '';
include $cmsRoot . "/includes/db.php";
include $cmsRoot . "/includes/minify.php";
?>
<!DOCTYPE html>
<html lang="en-US" prefix="og: https://ogp.me/ns#">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- SEO Meta Tags for Indian Matka & Indian Satta Guide -->
  <title><?php echo htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?></title>
  <meta name="description" content="<?php echo htmlspecialchars($pageDescription, ENT_QUOTES, 'UTF-8'); ?>">
<meta name="keywords" content="">
<!-- Open Graph Tags -->
<meta property="og:title" content="<?php echo htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?>">
<meta property="og:description" content="<?php echo htmlspecialchars($pageDescription, ENT_QUOTES, 'UTF-8'); ?>">
<meta property="og:type" content="website">
<meta property="og:url" content="<?php echo htmlspecialchars($canonicalUrl, ENT_QUOTES, 'UTF-8'); ?>">
<!--<meta property="og:image" content="http://sattamatkalive.org/images/matka-thumbnail.jpg">-->
<meta property="og:site_name" content="SattaMatkaLive">
<!-- ✅ Canonical URL -->
<link rel="canonical" href="<?php echo htmlspecialchars($canonicalUrl, ENT_QUOTES, 'UTF-8'); ?>" />
<meta name="robots" content="index, follow" />
<?php include "_meta.php"; ?> 
 
<?php if ($schemaMarkup !== ''): ?>
<script type="application/ld+json">
<?php echo $schemaMarkup; ?>
</script>
<?php endif; ?>
<?php include "css.php"; ?>   
<?php if (function_exists('wp_head')) { wp_head(); } ?>
</head>
<body>
<?php if ($dynamicMenu !== ''): ?>
<div style="background:#111;color:#fff;padding:12px 16px;text-align:center;">
  <style>.cms-menu ul{list-style:none;margin:0;padding:0;display:flex;gap:14px;justify-content:center;flex-wrap:wrap}.cms-menu a{color:#fff;text-decoration:none;font-weight:600}</style>
  <?php echo $dynamicMenu; ?>
</div>
<?php endif; ?>
<div class="top-bar">
  <a href="https://sattamatkalive.org/" title="Satta matka"><h1>Satta Matka Live</h1></a>
</div>