---
import '@fontsource/plus-jakarta-sans/400.css';
import '@fontsource/plus-jakarta-sans/600.css';
import '@fontsource/plus-jakarta-sans/700.css';
import '@fontsource/plus-jakarta-sans/800.css';
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '../styles/global.css';
import { VersionWatcher } from '../components/VersionWatcher';

interface Props {
  title: string;
  description?: string;
  ogImage?: string;
}

const {
  title,
  description = 'Platformă de transparență achiziții publice România. 17 surse publice agregate, 4M firme, 47K datornici T1 2026 live.',
  ogImage,
} = Astro.props;

const ogImageAbsolute = ogImage
  ? (ogImage.startsWith('http') ? ogImage : `https://vreau.digital${ogImage}`)
  : 'https://vreau.digital/og-default.png';
---

<!doctype html>
<html lang="ro">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="generator" content={Astro.generator} />

    <title>{title}</title>
    <meta name="description" content={description} />

    <meta property="og:title" content={title} />
    <meta property="og:description" content={description} />
    <meta property="og:type" content="website" />
    <meta property="og:locale" content="ro_RO" />
    <meta property="og:site_name" content="vreau.digital" />
    <meta property="og:image" content={ogImageAbsolute} />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:image" content={ogImageAbsolute} />
    <meta name="twitter:title" content={title} />
    <meta name="twitter:description" content={description} />

    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <meta name="theme-color" content="#1E3A5F" />
  </head>
  <body class="min-h-screen bg-page text-neutral-900 font-body">
    <slot />
    <VersionWatcher client:idle />
  </body>
</html>
