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



export const metadata: Metadata = {
  title: 'CRE Construction | Premium NZ Residential & Commercial Builder',
  description: 'CRE Construction delivers high-quality residential renovations, extensions, and commercial builds across New Zealand. Trustworthy craftsmanship, clear communication, and reliable project delivery.',
  keywords: ["CRE Construction, New Zealand builder, residential construction, commercial construction, home renovations, extensions, building services, premium quality, trustworthy builder, free quote"],
  openGraph: {
    "title": "CRE Construction | Premium NZ Residential & Commercial Builder",
    "description": "CRE Construction delivers high-quality residential renovations, extensions, and commercial builds across New Zealand. Trustworthy craftsmanship, clear communication, and reliable project delivery.",
    "url": "https://www.creconstruction.co.nz",
    "siteName": "CRE Construction",
    "images": [
      {
        "url": "http://img.b2bpic.net/free-photo/modern-cliffside-home-with-ocean-view-sunset_23-2152016391.jpg",
        "alt": "Luxury modern home under construction in New Zealand"
      }
    ],
    "type": "website"
  },
  twitter: {
    "card": "summary_large_image",
    "title": "CRE Construction | Premium NZ Residential & Commercial Builder",
    "description": "CRE Construction delivers high-quality residential renovations, extensions, and commercial builds across New Zealand. Trustworthy craftsmanship, clear communication, and reliable project delivery.",
    "images": [
      "http://img.b2bpic.net/free-photo/modern-cliffside-home-with-ocean-view-sunset_23-2152016391.jpg"
    ]
  },
  robots: {
    "index": true,
    "follow": true
  },
};

const libreBaskerville = Libre_Baskerville({
  variable: "--font-libre-baskerville",
  subsets: ["latin"],
  weight: ["400", "700"]
});
const dmSans = DM_Sans({
  variable: "--font-dm-sans",
  subsets: ["latin"]
});

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