{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Blog Post CMS Schema",
  "type": "object",
  "required": ["slug", "title", "tldr", "author", "publishedAt", "sections"],
  "properties": {
    "slug": { "type": "string", "pattern": "^[a-z0-9-]+$" },
    "title": { "type": "string", "minLength": 10, "maxLength": 120 },
    "tldr": { "type": "string", "minLength": 50, "maxLength": 400 },
    "author": {
      "type": "object",
      "required": ["name"],
      "properties": {
        "name": { "type": "string" },
        "role": { "type": "string" },
        "avatarUrl": { "type": "string" }
      }
    },
    "publishedAt": { "type": "string", "format": "date" },
    "updatedAt": { "type": "string", "format": "date" },
    "tags": { "type": "array", "items": { "type": "string" } },
    "heroImage": { "type": "string" },
    "sections": {
      "type": "array",
      "minItems": 3,
      "items": {
        "type": "object",
        "required": ["h2", "body"],
        "properties": {
          "h2": { "type": "string" },
          "body": { "type": "string" },
          "visual": { "type": "string" }
        }
      }
    },
    "takeaways": {
      "type": "array",
      "minItems": 3,
      "maxItems": 5,
      "items": { "type": "string" }
    },
    "faq": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["question", "answer"],
        "properties": {
          "question": { "type": "string" },
          "answer": { "type": "string" }
        }
      }
    },
    "related": { "type": "array", "items": { "type": "string" } }
  }
}
