// Section Dividers
// Full-page title pages separating note compartments

#import "document.typ": theme-mode
#import "theme.typ": palettes

#let section-divider(title, palette-key) = {
  let colors = palettes.at(theme-mode).at(palette-key)

  page(
    fill: colors.outer,
    margin: 0pt,
    height: auto,
    {
      block(
        width: 100%,
        inset: (x: 0pt, y: 80pt),
        {
          align(center, {
            // Top decorative line
            line(length: 40%, stroke: 1.5pt + colors.stroke)
            v(24pt)

            // Section title
            text(
              size: 42pt,
              weight: "bold",
              fill: colors.accent,
              tracking: 8pt,
              title,
            )

            v(24pt)
            // Bottom decorative line
            line(length: 40%, stroke: 1.5pt + colors.stroke)
          })
        }
      )
    }
  )
}
