import type { Metadata } from "next";
import "./globals.css";

const siteUrl = "https://kouzoudesk.com";

export const metadata: Metadata = {
  metadataBase: new URL(siteUrl),
  title: "KouzouDesk｜木造構造計算・構造図作成の外部パートナー",
  description:
    "木造住宅の許容応力度計算から基礎検討・構造図作成まで相談できる、設計事務所・工務店・住宅会社様向けの木造構造計算・構造図作成サービスです。",
  alternates: {
    canonical: "/",
  },
  openGraph: {
    type: "website",
    locale: "ja_JP",
    url: "/",
    siteName: "KouzouDesk",
    title: "KouzouDesk｜木造構造計算・構造図作成の外部パートナー",
    description:
      "木造住宅の許容応力度計算から基礎検討・構造図作成まで相談できる、設計事務所・工務店・住宅会社様向けの専門サービスです。",
    images: [
      {
        url: "/assets/hero-timber-frame.webp",
        width: 1672,
        height: 941,
        alt: "木造軸組住宅の構造フレームを表したKouzouDeskの技術イラスト",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "KouzouDesk｜木造構造計算・構造図作成の外部パートナー",
    description:
      "木造住宅の許容応力度計算から基礎検討・構造図作成まで相談できる専門サービスです。",
    images: ["/assets/hero-timber-frame.webp"],
  },
  icons: {
    icon: [{ url: "/favicon.svg", type: "image/svg+xml" }],
  },
  verification: {
    google: "SaqX_flPgvinxtBowa5fmieVVa4q0UeMpbk81MtgeAc",
  },
};

const structuredData = {
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": `${siteUrl}/#organization`,
      name: "KouzouDesk",
      url: `${siteUrl}/`,
      logo: `${siteUrl}/favicon.svg`,
      email: "info@kouzoudesk.com",
      description:
        "設計事務所・工務店・住宅会社向けの木造構造計算・構造図作成サービス",
    },
    {
      "@type": "WebSite",
      "@id": `${siteUrl}/#website`,
      url: `${siteUrl}/`,
      name: "KouzouDesk",
      description:
        "木造住宅の許容応力度計算、基礎検討、構造図作成を扱う外部構造パートナー",
      inLanguage: "ja",
      publisher: { "@id": `${siteUrl}/#organization` },
    },
  ],
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="ja">
      <body>
        {children}
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(structuredData) }}
        />
      </body>
    </html>
  );
}
