import type { Metadata } from "next";
import { bricolage, archivo, splineMono, kufi } from "@/lib/fonts";
import "./globals.css";

export const metadata: Metadata = {
  metadataBase: new URL("https://vira.sa"),
  title: {
    default: "Vira.sa Technology — We Build Your Digital World",
    template: "%s — Vira.sa Technology",
  },
  description:
    "Vira.sa Technology is a Saudi technology house headquartered in Makkah with branches in Jeddah, Riyadh, and Dammam — enterprise software, sovereign cloud & managed hosting, cybersecurity, and data & AI for organizations building on Vision 2030.",
  alternates: { canonical: "/" },
  icons: {
    icon: [{ url: "/img/favicon.svg", type: "image/svg+xml" }, { url: "/favicon.ico" }],
    apple: "/img/apple-touch-icon.png",
  },
  openGraph: {
    type: "website",
    url: "https://vira.sa/",
    siteName: "Vira.sa Technology",
    title: "Vira.sa Technology — We Build Your Digital World",
    description:
      "Enterprise software, sovereign cloud & hosting, cybersecurity, and data & AI — engineered in the Kingdom, for the Kingdom.",
    images: [{ url: "/img/og.png", width: 1200, height: 630 }],
  },
  twitter: { card: "summary_large_image" },
};

const orgJsonLd = {
  "@context": "https://schema.org",
  "@type": "Organization",
  name: "Vira Information Technology Co.",
  alternateName: "فيرا لتقنية المعلومات",
  url: "https://vira.sa",
  logo: "https://vira.sa/img/apple-touch-icon.png",
  slogan: "We Build Your Digital World",
  email: "hello@vira.sa",
  telephone: "+966920004512",
  address: {
    "@type": "PostalAddress",
    streetAddress: "King Abdul Aziz Road, Al Aziziyah",
    addressLocality: "Makkah",
    postalCode: "24243",
    addressCountry: "SA",
  },
  location: [
    { "@type": "Place", name: "Head Office — Makkah" },
    { "@type": "Place", name: "Branch — Jeddah" },
    { "@type": "Place", name: "Branch — Riyadh" },
    { "@type": "Place", name: "Branch — Dammam" },
  ],
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html
      lang="en"
      className={`${bricolage.variable} ${archivo.variable} ${splineMono.variable} ${kufi.variable}`}
    >
      <body>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(orgJsonLd) }}
        />
        {children}
      </body>
    </html>
  );
}
