{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://daarion.city/schemas/present/SlideSpec.v1.schema.json",
  "title": "SlideSpec v1",
  "type": "object",
  "required": ["meta", "slides"],
  "properties": {
    "meta": {
      "type": "object",
      "required": ["title", "brand_id", "theme_version", "language"],
      "properties": {
        "title": { "type": "string" },
        "subtitle": { "type": "string" },
        "author": { "type": "string" },
        "language": { "type": "string", "enum": ["uk", "en"] },
        "brand_id": { "type": "string" },
        "theme_version": { "type": "string", "description": "immutable version tag, e.g. v1.0.0 or hash" },
        "format": { "type": "string", "enum": ["16:9", "4:3"], "default": "16:9" }
      },
      "additionalProperties": false
    },
    "slides": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["type", "title"],
        "properties": {
          "type": {
            "type": "string",
            "enum": ["title", "section", "bullets", "image", "table", "chart", "closing", "appendix"]
          },
          "title": { "type": "string" },
          "subtitle": { "type": "string" },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["kind"],
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": ["paragraph", "bullets", "kpis", "quote", "image", "table", "chart"]
                },
                "text": { "type": "string" },
                "items": { "type": "array", "items": { "type": "string" } },
                "kpis": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": ["label", "value"],
                    "properties": {
                      "label": { "type": "string" },
                      "value": { "type": "string" },
                      "note": { "type": "string" }
                    }
                  }
                },
                "image": {
                  "type": "object",
                  "properties": {
                    "ref": { "type": "string", "description": "S3 key or URL" },
                    "caption": { "type": "string" },
                    "slot": { "type": "string", "description": "e.g. hero, left, right" }
                  },
                  "additionalProperties": false
                },
                "table": {
                  "type": "object",
                  "required": ["headers", "rows"],
                  "properties": {
                    "headers": { "type": "array", "items": { "type": "string" } },
                    "rows": {
                      "type": "array",
                      "items": { "type": "array", "items": { "type": "string" } }
                    }
                  },
                  "additionalProperties": false
                },
                "chart": {
                  "type": "object",
                  "required": ["chart_type", "series"],
                  "properties": {
                    "chart_type": { "type": "string", "enum": ["bar", "line", "pie"] },
                    "categories": { "type": "array", "items": { "type": "string" } },
                    "series": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["name", "data"],
                        "properties": {
                          "name": { "type": "string" },
                          "data": { "type": "array", "items": { "type": "number" } }
                        }
                      }
                    },
                    "note": { "type": "string" }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "speaker_notes": { "type": "string" }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
