---
// ChapterLayout — the shared chapter-page shell. TopBar at the top, a
// `<main>` slot for page content, SiteFooter at the bottom.
//
// Pages include this instead of BaseLayout for the four chapter routes
// (/models/, /agents/, /skills/, /summary/). /rules/ uses a different shell
// (task 14). /full-guide/ has its own.
//
// The chapters.css stylesheet is the shared layer. It carries the
// chapter-palette tokens, the hero/grid/practice legacy classes, and the
// responsive contract that audit-ui.mjs asserts.

import BaseLayout from './BaseLayout.astro';
import TopBar from '../components/blocks/TopBar.astro';
import SiteFooter from '../components/blocks/SiteFooter.astro';
import chaptersStylesheet from '../../legacy/styles/chapters.css?url';

interface Props {
  title: string;
  description: string;
  lang?: string;
}

const { title, description, lang = 'en' } = Astro.props;
---

<BaseLayout title={title} description={description} lang={lang}>
  <link slot="styles" rel="stylesheet" href={chaptersStylesheet} />
  <TopBar id="top">
    <slot name="top-previous" slot="previous" />
    <slot name="top-center" slot="center" />
    <slot name="top-next" slot="next" />
  </TopBar>
  <main>
    <slot />
  </main>
  <SiteFooter>
    <slot name="footer-links" slot="links" />
    <slot name="footer-text" />
  </SiteFooter>
</BaseLayout>
