import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Lato } from "next/font/google";
import "./globals.css";
import { ServiceWrapper } from "@/components/ServiceWrapper";
import Tag from "@/tag/Tag";
import { getVisualEditScript } from "@/utils/visual-edit-script";

const halant = Halant({
  variable: "--font-halant",
  subsets: ["latin"],
  weight: ["300", "400", "500", "600", "700"],
});

const inter = Inter({
  variable: "--font-inter",
  subsets: ["latin"],
});

const lato = Lato({
  variable: "--font-lato",
  subsets: ["latin"],
  weight: ["100", "300", "400", "700", "900"],
});

export const metadata: Metadata = {
  title: "Learninglee | Transforming Education in Jammu & Kashmir",
  description: "Learninglee empowers underserved children through grassroots education programs. Donate, volunteer, or partner to support our mission for educational equity and generational change.",
  keywords: "NGO education Jammu Kashmir, child education programs, educational charity, literacy programs, child safety, education impact",
  metadataBase: new URL("https://learninglee.org"),
  alternates: {
    canonical: "https://learninglee.org",
  },
  openGraph: {
    title: "Learninglee | Every Child Deserves to Learn",
    description: "Join our movement to transform education and create lasting impact in Jammu & Kashmir communities.",
    url: "https://learninglee.org",
    siteName: "Learninglee",
    type: "website",
    images: [
      {
        url: "http://img.b2bpic.net/free-photo/teacher-helping-her-pupil-with-her-homework_329181-10526.jpg",
        alt: "Learninglee educational programs transforming lives",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Learninglee | Every Child Deserves to Learn",
    description: "Transforming education in Jammu & Kashmir through grassroots, community-led programs.",
    images: ["http://img.b2bpic.net/free-photo/teacher-helping-her-pupil-with-her-homework_329181-10526.jpg"],
  },
  robots: {
    index: true,
    follow: true,
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" suppressHydrationWarning>
      <ServiceWrapper>
        <body
          className={`${halant.variable} ${inter.variable} ${lato.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}