import type { Locale } from "@/lib/i18n";

/** A block of legal copy. Paragraph text and list items are plain strings;
 *  email addresses and https URLs inside them are auto-linked at render time. */
export type LegalBlock =
  | { type: "p"; text: string }
  | { type: "subheading"; text: string }
  | { type: "list"; items: string[] };

export interface LegalSection {
  /** Stable anchor id for deep-linking (e.g. #google-user-data). */
  id: string;
  heading: string;
  blocks: LegalBlock[];
}

export interface LegalDocument {
  title: string;
  /** ISO date (YYYY-MM-DD) of the last substantive change. */
  updated: string;
  intro: string;
  sections: LegalSection[];
}

export type LocalizedLegal = Record<Locale, LegalDocument>;
