---
const { title, description, lang, themeOverride } = Astro.props;
import { ViewTransitions } from 'astro:transitions';
import Navbar from "../components/Navbar.astro";
import "../style/index.css";
import { useTranslations } from '../i18n/utils';
//import "../style/globals.css";

const t = useTranslations(lang)
---

<!doctype html>
<html lang={lang} data-theme={themeOverride ? themeOverride : "theme_auto"} class="overflow-hidden">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="description" content={description} />
        <meta name="author" content="Cyril Šebek" />
        <meta name="generator" content={Astro.generator} />
        <link rel="shortcut icon" href={t("favicon")}>
        <link rel="shortcut icon" href={t("favicon")} type="image/x-icon">
        <title>{title}</title>
        <ViewTransitions />
    </head>
    <body class="bg-bkg" >
        <script transition:persist is:raw is:inline>
            document.addEventListener('astro:after-swap', () => {document.documentElement.setAttribute("data-theme", localStorage.getItem("data-theme") || document.documentElement.getAttribute("data-theme"));});
        </script>
        <Navbar />
        <div class="bg-bkg h-dvh overflow-y-scroll snap-mandatory snap-y scroll-smooth " transition:animate="fade" style="scrollbar-width: thin;">
            <slot />
        </div>
    </body>
</html>
