import type { Metadata, Viewport } from "next";
import type { ReactNode } from "react";
import { siteUrl, studio } from "@/lib/content";
import "./globals.css";

export const metadata: Metadata = {
  metadataBase: new URL(siteUrl),
  title: {
    default:
      "Florian Gross Design Studio — Product & Interior Design in Barcelona",
    template: "%s | Florian Gross Design Studio",
  },
  description:
    "Florian Gross is a Barcelona-based product and interior designer. Creator of the award-winning Konnex modular shelving system for Müller Möbelwerkstätten, plus adaptive lighting and retail interiors. Buy Konnex worldwide.",
  keywords: [
    "Florian Gross",
    "Florian Gross Design Studio",
    "product design Barcelona",
    "interior design Barcelona",
    "Konnex shelving system",
    "Konnex shelf",
    "modular shelving system",
    "interlocking shelf cubes",
    "flexible shelf system",
    "Müller Möbelwerkstätten",
    "Andamio shelf",
    "Kobe lamp",
    "Balca lamp",
    "Cap lamp",
    "industrial designer Spain",
    "lighting designer Barcelona",
    "retail interior design",
    "German Design Award",
    "Interior Innovation Award",
    "Roche Bobois Design Award",
    "A' Design Award",
  ],
  authors: [{ name: "Florian Gross", url: siteUrl }],
  creator: "Florian Gross",
  publisher: "Florian Gross Design Studio",
  applicationName: "Florian Gross Design Studio",
  category: "design",
  alternates: {
    canonical: "/",
    languages: { "en-US": "/" },
  },
  openGraph: {
    type: "website",
    locale: "en_US",
    url: siteUrl,
    siteName: "Florian Gross Design Studio",
    title: "Florian Gross Design Studio — Product & Interior Design in Barcelona",
    description:
      "Award-winning modular shelving, adaptive lighting and interiors from Barcelona. Home of the Konnex slot-in shelving system — available worldwide.",
    images: [
      {
        url: "/images/projects/Konnex/Konnex-1.jpg",
        width: 2160,
        height: 1280,
        alt: "Konnex modular shelving system by Florian Gross",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Florian Gross Design Studio — Product & Interior Design",
    description:
      "Award-winning modular shelving, adaptive lighting and interiors from Barcelona. Buy the Konnex system worldwide.",
    images: ["/images/projects/Konnex/Konnex-1.jpg"],
    creator: "@floriangrossdesign",
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      "max-image-preview": "large",
      "max-snippet": -1,
      "max-video-preview": -1,
    },
  },
  icons: {
    icon: [
      {
        url:
          "data:image/svg+xml," +
          encodeURIComponent(
            `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" fill="#ffffff"/><g fill="none" stroke="#0a0a0a" stroke-width="4"><rect x="10" y="10" width="19" height="19"/><rect x="35" y="10" width="19" height="19"/><rect x="10" y="35" width="19" height="19"/><rect x="35" y="35" width="19" height="19"/></g></svg>`,
          ),
        type: "image/svg+xml",
      },
    ],
    apple: [{ url: "/images/projects/Konnex/Konnex-1.jpg" }],
  },
  other: {
    "geo.region": "ES-CT",
    "geo.placename": "Barcelona",
  },
};

export const viewport: Viewport = {
  themeColor: "#ffffff",
  width: "device-width",
  initialScale: 1,
  maximumScale: 5,
};

const jsonLd = {
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "ProfessionalService",
      "@id": `${siteUrl}/#studio`,
      name: "Florian Gross Design Studio",
      alternateName: "Florian Gross Design",
      description:
        "Product and interior design studio in Barcelona specialising in modular shelving systems, adaptive lighting and retail interiors.",
      url: siteUrl,
      email: studio.email,
      telephone: "+34 634 331 873",
      foundingDate: "2011",
      founder: { "@type": "Person", name: "Florian Gross" },
      image: `${siteUrl}/images/projects/Konnex/Konnex-1.jpg`,
      priceRange: "$$",
      address: {
        "@type": "PostalAddress",
        addressLocality: "Barcelona",
        addressCountry: "ES",
      },
      areaServed: "Worldwide",
      sameAs: [studio.instagram, studio.linkedin, studio.facebook],
      knowsAbout: [
        "Product design",
        "Industrial design",
        "Furniture design",
        "Lighting design",
        "Interior design",
        "Modular shelving systems",
      ],
    },
    {
      "@type": "Person",
      "@id": `${siteUrl}/#florian-gross`,
      name: "Florian Gross",
      jobTitle: "Product & Interior Designer",
      url: siteUrl,
      email: studio.email,
      worksFor: { "@id": `${siteUrl}/#studio` },
      address: {
        "@type": "PostalAddress",
        addressLocality: "Barcelona",
        addressCountry: "ES",
      },
      sameAs: [studio.instagram, studio.linkedin, studio.facebook],
      award: [
        "A' Design Award 2016 Silver",
        "Light + Building 2016 Young Design Winner",
        "Roche Bobois Design Award 2015 Winner",
        "Ex-t Design Contest 2013 Winner",
        "Designpreis der Bundesrepublik Deutschland 2012 Silver",
        "Tendence Talents 2012 Winner",
        "German Design Award 2012 Nominee",
        "Good Design 2011 Chicago",
        "Interior Innovation Award 2011 Best of Best",
        "Blickfang NEXT 2010 Winner",
        "Ambiente Talents 2010 Winner",
      ],
    },
    {
      "@type": "Product",
      "@id": `${siteUrl}/#konnex`,
      name: "Konnex Modular Shelving System",
      description:
        "KONNEX is an innovative slot-in shelving system. A basic set of three interlocking 6 mm high-pressure laminate cubes can be arranged into a shelf unit and extended endlessly by slotting the comb-like slits into the side walls of another cube.",
      image: `${siteUrl}/images/projects/Konnex/Konnex-1.jpg`,
      url: `${siteUrl}/#konnex`,
      brand: { "@type": "Brand", name: "Florian Gross Design Studio" },
      designer: { "@id": `${siteUrl}/#florian-gross` },
      manufacturer: {
        "@type": "Organization",
        name: "Müller Möbelwerkstätten",
        url: "https://www.muellermoebel.de/en/",
      },
      category: "Furniture > Shelving",
      offers: {
        "@type": "Offer",
        url: "https://www.muellermoebel.de/en/KONNEX-Set/KX200-312",
        availability: "https://schema.org/InStock",
        priceCurrency: "EUR",
        areaServed: "Worldwide",
        eligibleRegion: "Worldwide",
      },
      award: [
        "Designpreis der Bundesrepublik Deutschland 2012 Silver",
        "Interior Innovation Award 2011 Best of Best",
        "Good Design 2011 Chicago",
      ],
    },
  ],
};

export default function RootLayout({ children }: { children: ReactNode }) {
  return (
    <html lang="en">
      <head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
      </head>
      <body className="bg-white text-ink antialiased">{children}</body>
    </html>
  );
}
