{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "EventCrafter Timeline Data",
  "description": "Schema for defining timeline events for EventCrafter.",
  "type": "object",
  "properties": {
    "settings": {
      "type": "object",
      "properties": {
        "layout": { "type": "string", "enum": ["vertical", "horizontal", "roadmap"], "default": "vertical" },
        "theme": { "type": "string", "default": "light" },
        "date_format": { "type": "string", "default": "Y-m-d" },
        "animate": { "type": "boolean", "default": true }
      }
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["date", "title"],
        "properties": {
          "id": { "type": "string" },
          "date": { "type": "string", "description": "ISO 8601 date (YYYY-MM-DD) or Year" },
          "end_date": { "type": "string" },
          "title": { "type": "string" },
          "description": { "type": "string" },
          "category": { "type": "string" },
          "icon": { "type": "string", "description": "Dashicon class or generic icon name" },
          "color": { "type": "string", "description": "Hex code for event accent" },
          "link": {
            "type": "object",
            "properties": {
              "url": { "type": "string" },
              "text": { "type": "string", "default": "Read More" },
              "target": { "type": "string", "default": "_self" }
            }
          },
          "media": {
            "type": "object",
            "properties": {
              "type": { "type": "string", "enum": ["image", "video", "youtube"] },
              "url": { "type": "string" },
              "caption": { "type": "string" }
            }
          }
        }
      }
    }
  }
}
