import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import "react-phone-number-input/style.css";

import IntroLoader from "@/components/shared/IntroLoader";
import Navbar from "@/components/layout/Navbar";
import Footer from "@/components/layout/Footer";
import WhatsAppButton from "@/components/shared/WhatsAppButton";
import MapButton from "@/components/shared/MapButton";
import ScrollToTop from "@/components/shared/ScrollToTop";
import WebsiteTrafficTracker from "@/components/analytics/WebsiteTrafficTracker";

const cormorant = localFont({
  src: [
    {
      path: "../public/fonts/cormorant-garamond-v21-latin-regular.woff2",
      weight: "400",
      style: "normal",
    },
    {
      path: "../public/fonts/cormorant-garamond-v21-latin-italic.woff2",
      weight: "400",
      style: "italic",
    },
    {
      path: "../public/fonts/cormorant-garamond-v21-latin-500.woff2",
      weight: "500",
      style: "normal",
    },
  ],
  variable: "--font-cormorant",
});

const jost = localFont({
  src: [
    {
      path: "../public/fonts/jost-v20-latin-300.woff2",
      weight: "300",
      style: "normal",
    },
    {
      path: "../public/fonts/jost-v20-latin-regular.woff2",
      weight: "400",
      style: "normal",
    },
    {
      path: "../public/fonts/jost-v20-latin-500.woff2",
      weight: "500",
      style: "normal",
    },
  ],
  variable: "--font-jost",
});

const BASE_URL = "https://www.thegrandheritageresorts.com";

export const metadata: Metadata = {
  metadataBase: new URL(BASE_URL),
  title: "Pune's Best Luxury Resort | The Grand Heritage Resorts",
  description:
    "Discover The Grand Heritage Resorts serving Pune with destination weddings, corporate events, social celebrations, resort stays, lawns, banquets and pools.",
  keywords: [
    "Best Resort in Pune",
    "destination wedding resort near Pune",
    "wedding venue Pune Nagar Highway",
    "corporate event resort Pune",
    "heritage resort near Pune",
    "group stay near Pune",
  ],
  authors: [
    { name: "The Grand Heritage Resorts Content Team" },
  ],
  publisher: "The Grand Heritage Resorts",
  robots: {
    index: true,
    follow: true,
    "max-image-preview": "large",
    "max-snippet": -1,
    "max-video-preview": -1,
  },
  alternates: {
    canonical: BASE_URL,
  },
  openGraph: {
    title: "Pune's Best Luxury Resort | The Grand Heritage Resorts",
    description: "Discover The Grand Heritage Resorts serving Pune with destination weddings, corporate events, social celebrations, resort stays, lawns, banquets and pools.",
    url: BASE_URL,
    siteName: "The Grand Heritage Resorts",
    images: [
      {
        url: "https://pub-b0bc1a7c71a54576bbf43595e30e6188.r2.dev/images/hero/best-luxury-resort-stay-near-pune.jpg",
        width: 1200,
        height: 630,
        alt: "The Grand Heritage Resorts - Luxury Wedding & Event Venue in Pune",
      },
    ],
    locale: "en_IN",
    type: "website",
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" className={`${cormorant.variable} ${jost.variable} scroll-smooth`}>
      <body className="bg-ivory text-espresso font-sans font-light selection:bg-gold selection:text-midnight overflow-x-hidden">
        <IntroLoader />

        <WebsiteTrafficTracker />
        
        <a
          href="#main-content"
          title="Main Content"
          className="sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[2000] focus:bg-gold focus:text-midnight focus:px-4 focus:py-2"
        >
          Skip to content
        </a>
        <Navbar />
        <main id="main-content" className="min-h-screen">
          {children}
        </main>
        <Footer />
        <WhatsAppButton />
        <MapButton />
        <ScrollToTop />
      </body>
    </html>
  );
}
