/**
 * Archetype: bullets — title + bullet points (the everyday slide).
 *
 * Slots:
 *   - title    (optional)
 *   - subtitle (optional one-liner under the title)
 *   - items    (required) array of strings or { text, ordered, bullet }
 *
 * Bullet glyphs come from pptxgenjs's built-in bullet renderer; agent
 * doesn't have to think about it. Spacing between items is controlled
 * by the active spacing preset.
 */
import { applyChrome, placeBullets, placeText } from './_helpers.js';

export const id = 'bullets';
export const slots = ['title', 'subtitle', 'items'];

export default function render(slide, resolved, content, _pptx, ctx) {
  applyChrome(slide, resolved, { bgOverride: content.background, seed: 31, ctx });

  const { header, body } = resolved.spacing;

  placeText(slide, resolved, 'title', content.title, {
    x: header.x, y: header.y, w: header.w, h: 0.7,
  }, { color: resolved.palette.text, align: 'left' });

  if (content.subtitle) {
    placeText(slide, resolved, 'subtitle', content.subtitle, {
      x: header.x, y: header.y + 0.7, w: header.w, h: 0.5,
    }, { color: resolved.palette.subtle, align: 'left' });
  }

  placeBullets(slide, resolved, content.items, body);
}
