import type { Metadata } from 'next';
import { Inter, Newsreader } from 'next/font/google';
import { Analytics } from '../src/components/Analytics';
import { Footer } from '../src/components/Footer';
import { Header } from '../src/components/Header';
import { InteractiveElements } from '../src/components/InteractiveElements';
import './globals.css';

const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });
const newsreader = Newsreader({
  subsets: ['latin'],
  variable: '--font-newsreader',
  style: 'italic',
  display: 'swap',
});

export const metadata: Metadata = {
  title: {
    default: 'Marc Mintel',
    template: '%s | Marc Mintel',
  },
  description: "Technical problem solver's blog - practical insights and learning notes",
  metadataBase: new URL('https://mintel.me'),
  icons: {
    icon: '/favicon.svg',
  },
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className={`${inter.variable} ${newsreader.variable}`}>
      <head>
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
      </head>
      <body className="min-h-screen bg-white">
        <Header />
        <main>
          {children}
        </main>
        <Footer />
        <InteractiveElements />
        <Analytics />
      </body>
    </html>
  );
}
