<?php
// Načtení konfigurace (pokud ještě není načteno)
if (!defined('WEB_ROOT')) {
    require_once __DIR__ . '/../includes/config.php';
}
?>
<!DOCTYPE html>
<html lang="cs" data-theme="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $pageTitle ?? 'EndeavourOS CZ' ?></title>
    <link href="https://endeavouros.cz/assets/img/icons.png" rel="shortcut icon"/>
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://endeavouros.cz/index.php" />
    <meta property="og:title" content="EndeavourOS 🇨🇿" />
    <meta
      property="og:description"
      content="EndeavourOS CZ Komunita. Vytvořeno s láskou k Linuxu ❤️."
    />
    <meta
      property="og:image"
      content="<?= WEB_ROOT ?>/assets/img/EndeavourOS-logo.webp"
    />
        <meta name="twitter:card" content="summary_large_image" />
    <meta
      name="twitter:title"
      content="EndeavourOS 🇨🇿"
    />
    <meta
      name="twitter:description"
      content="EndeavourOS CZ Komunita. Vytvořeno s láskou k Linuxu ❤️."
    />
    <meta
      name="twitter:image"
      content="<?= WEB_ROOT ?>/assets/img/EndeavourOS-logo.webp"
    />
    <script defer src="https://analytics.oscloud.cz/script.js" data-website-id="2ccb6c76-451a-44e2-bae5-7b8b3cab0fd4"></script>


    
    <!-- Fonty -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
    
    <!-- Prism.js pro syntax highlight -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />
    
    <!-- VLASTNÍ CSS (UPRAVENÁ CESTA) -->
    <link href="<?= PATH_CSS ?>" rel="stylesheet">
    
    <!-- Meta -->
    <meta name="description" content="<?= $pageDesc ?? 'EndeavourOS česká komunita' ?>">
</head>
<body>

    <!-- Header -->
    <header class="site-header">
        <div class="container header-content">
            <a href="<?= WEB_ROOT ?>/index.php" class="logo">
                <img src="<?= WEB_ROOT ?>/assets/img/EndeavourOS-logo.webp" alt="EndeavourOS Logo" class="logo-img">
                <!-- <span class="logo-text">EndeavourOS <span class="badge">CZ</span></span> -->
                                <span class="logo-text"> <span class="badge">CZ</span></span>

            </a>
            
            <nav class="main-nav">
                <ul>
                    <li><a href="<?= WEB_ROOT ?>/index.php">Domů</a></li>
                    <li><a href="<?= WEB_ROOT ?>/endeavouros.php">EndeavourOS</a></li>
                    <li><a href="<?= WEB_ROOT ?>/rozcestnik.php">Články</a></li>
                   <!-- <li><a href="<?= WEB_ROOT ?>/index.php#articles">Články</a></li> -->
                    <li><a href="https://forum.arch-linux.cz/" target="_blank">Fórum</a></li>
                    <li><a href="<?= WEB_ROOT ?>/o-nas.php">O nás</a></li>
                </ul>
            </nav>

            <div class="header-actions">
                <div class="search-box">
                    <input type="text" id="searchInput" placeholder="Hledat v článcích...">
                    <div id="searchResults" class="search-dropdown"></div>
                </div>
                <button id="themeToggle" class="icon-btn" aria-label="Přepnout téma">
                    <i class="fas fa-moon"></i>
                </button>
            </div>
        </div>
    </header>

    <main class="container main-content">
        <?= $content ?>
    </main>

    <footer class="site-footer">
        <div class="container">
            <p>&copy; 2026 EndeavourOS CZ Komunita. Vytvořeno s láskou k Linuxu ❤️.</p>
        </div>
    </footer>

    <!-- Scripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-php.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/7.0.0/fuse.min.js"></script>
    <!-- VLASTNÍ JS (UPRAVENÁ CESTA) -->
    <script src="<?= PATH_JS ?>"></script>
</body>
</html>