import type { Metadata } from "next";
import { SiteFooter } from "../SiteFooter";
import { Sidebar } from "./Sidebar";

export const metadata: Metadata = {
  metadataBase: new URL("https://docs.opencovenant.org"),
  title: {
    default: "Documentation — Covenant",
    template: "%s — Covenant docs",
  },
  description:
    "Reference, concepts, and operational guides for Covenant — the open, agent-native operating layer.",
  alternates: { canonical: "/" },
};

export default function DocsLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <div className="min-h-[100dvh] bg-[#030303] text-neutral-200">
      <div className="mx-auto flex w-full max-w-[1400px]">
        <Sidebar />

        <main className="min-w-0 flex-1 px-6 py-12 md:px-12 md:py-16 lg:px-20">
          <article className="prose-docs mx-auto w-full max-w-[760px]">
            {children}
          </article>

          <SiteFooter className="mx-auto mt-24 max-w-[760px] border-t border-neutral-800/80 pt-6" />
        </main>
      </div>
    </div>
  );
}
