<?php
$pageTitle = $pageTitle ?? $ugfx['site_name'];
$currentPage = $currentPage ?? basename($_SERVER['PHP_SELF'] ?? 'index.php');
$bootstrapCss = ugfx_vendor_asset('assets/vendor/bootstrap/css/bootstrap.min.css', 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css');
$bootstrapIconsCss = ugfx_vendor_asset('assets/vendor/bootstrap-icons/font/bootstrap-icons.css', 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css');
$seo = ugfx_page_seo($currentPage, $pageTitle);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= htmlspecialchars($seo['title']) ?></title>
    <meta name="description" content="<?= htmlspecialchars($seo['description']) ?>">
    <meta name="robots" content="<?= htmlspecialchars($seo['robots']) ?>">
    <meta name="author" content="<?= htmlspecialchars($ugfx['site_name']) ?>">
    <meta name="theme-color" content="<?= htmlspecialchars($seo['theme_color']) ?>">
    <link rel="canonical" href="<?= htmlspecialchars($seo['canonical']) ?>">
    <link rel="icon" type="image/png" href="<?= htmlspecialchars($seo['image']) ?>">
    <link rel="apple-touch-icon" href="<?= htmlspecialchars($seo['image']) ?>">
    <link rel="manifest" href="<?= htmlspecialchars(ugfx_absolute_url('site.webmanifest')) ?>">
    <meta property="og:site_name" content="<?= htmlspecialchars($seo['site_name']) ?>">
    <meta property="og:title" content="<?= htmlspecialchars($seo['title']) ?>">
    <meta property="og:description" content="<?= htmlspecialchars($seo['description']) ?>">
    <meta property="og:type" content="<?= htmlspecialchars($seo['type']) ?>">
    <meta property="og:url" content="<?= htmlspecialchars($seo['canonical']) ?>">
    <meta property="og:image" content="<?= htmlspecialchars($seo['image']) ?>">
    <meta property="og:image:secure_url" content="<?= htmlspecialchars($seo['image_secure']) ?>">
    <meta property="og:image:type" content="<?= htmlspecialchars($seo['image_type']) ?>">
    <meta property="og:image:width" content="<?= (int)$seo['image_width'] ?>">
    <meta property="og:image:height" content="<?= (int)$seo['image_height'] ?>">
    <meta property="og:image:alt" content="<?= htmlspecialchars($seo['image_alt']) ?>">
    <meta property="og:locale" content="<?= htmlspecialchars($seo['locale']) ?>">
    <meta property="article:section" content="<?= htmlspecialchars($seo['section']) ?>">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="<?= htmlspecialchars($seo['title']) ?>">
    <meta name="twitter:description" content="<?= htmlspecialchars($seo['description']) ?>">
    <meta name="twitter:url" content="<?= htmlspecialchars($seo['canonical']) ?>">
    <meta name="twitter:image" content="<?= htmlspecialchars($seo['image']) ?>">
    <meta name="twitter:image:alt" content="<?= htmlspecialchars($seo['image_alt']) ?>">
    <?php if (!empty($seo['twitter_site'])): ?>
    <meta name="twitter:site" content="<?= htmlspecialchars($seo['twitter_site']) ?>">
    <?php endif; ?>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Orbitron:wght@500;700;800&display=swap" rel="stylesheet">
    <link href="<?= htmlspecialchars($bootstrapCss) ?>" rel="stylesheet">
    <link href="<?= htmlspecialchars($bootstrapIconsCss) ?>" rel="stylesheet">
    <link rel="stylesheet" href="<?= ugfx_asset('css/theme.css') ?>">
    <link rel="stylesheet" href="<?= ugfx_asset('css/responsive.css') ?>">
    <script type="application/ld+json"><?= ugfx_seo_json_ld($seo) ?></script>
</head>
<?php $bodyPageClass = "ugfx-page-" . preg_replace("/[^a-z0-9]+/i", "-", strtolower(pathinfo($currentPage, PATHINFO_FILENAME))); ?>
<body class="ugfx-body <?= htmlspecialchars($bodyPageClass) ?>">
<div class="ugfx-site-shell">
<?php include __DIR__ . '/navbar.php'; ?>
<main>
