{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openpresentation.org/schema/opf-theme/v1",
  "title": "Theme",
  "description": "Schema for theme records in the pptx.gallery library. Each theme is a small, named bundle that pairs a color scheme, a font scheme, a default theme-controlled background, and a slide size. Themes are referenced from OPF documents via design.theme or design.theme.id; the engine resolves the reference against catalogs.themes (inline) → catalogs.themes.source → the default catalog at https://www.pptx.gallery/themes. Inline overrides on design.colorScheme / design.fontScheme / design.background / design.dimensions take precedence over a resolved theme.",
  "type": "object",
  "required": [
    "$schema",
    "id",
    "name"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://openpresentation.org/schema/opf-theme/v1",
      "description": "Identifies this record as a theme in the openpresentation.org catalog."
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$",
      "description": "Stable slug used by OPF documents to reference this theme via design.theme. Lowercase kebab-case.",
      "examples": [
        "minimal",
        "classic",
        "dark",
        "bold"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable theme name shown in pickers.",
      "examples": [
        "Minimal",
        "Classic",
        "Dark",
        "Bold"
      ]
    },
    "summary": {
      "type": "string",
      "description": "One-sentence positioning of the theme — when to reach for it.",
      "examples": [
        "A clean, minimalist theme for professional, straightforward presentations.",
        "A rich dark-mode theme with bold contrast and modern style."
      ]
    },
    "description": {
      "type": "string",
      "description": "Longer prose describing what the theme looks and feels like and the kinds of decks it suits.",
      "examples": [
        "A clean, minimalistic theme with a focus on simplicity and readability. Ideal for professional, straightforward presentations."
      ]
    },
    "colorScheme": {
      "type": "string",
      "description": "Catalog reference to the theme's default color scheme — resolved against catalogs.colorSchemes the same way design.colorScheme or design.colorScheme.id is. Accepts a bare id, HTTPS URL, or 'pkg:' reference.",
      "examples": [
        "cool-horizon",
        "boost",
        "burnt-orange"
      ]
    },
    "fontScheme": {
      "type": "string",
      "description": "Catalog reference to the theme's default font scheme — resolved against catalogs.fontSchemes the same way design.fontScheme or design.fontScheme.id is. Accepts a bare id, HTTPS URL, or 'pkg:' reference.",
      "examples": [
        "aptos",
        "tenorite",
        "seaford",
        "impact"
      ]
    },
    "background": {
      "$ref": "#/$defs/ThemeBackground"
    },
    "dimensions": {
      "type": "string",
      "enum": ["16:9", "4:3", "16:10", "letter", "a4", "widescreen", "standard"],
      "description": "Default slide size for this theme. Accepts the same preset values as design.dimensions.preset.",
      "examples": [
        "16:9",
        "4:3",
        "16:10",
        "letter",
        "a4",
        "widescreen",
        "standard"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Free-form labels for filtering and search.",
      "examples": [
        [
          "minimal",
          "professional"
        ],
        [
          "bold",
          "high-impact"
        ]
      ]
    },
    "preview": {
      "type": "object",
      "description": "Visual previews of the record, used by picker UIs and inline rendering. All sub-fields are optional; engines fall back gracefully when previews aren't available.",
      "properties": {
        "src": {
          "type": "string",
          "format": "uri",
          "description": "Main preview image (PNG/JPG). Used as the primary visual in picker UIs and previews of the record.",
          "examples": [
            "https://www.pptx.gallery/themes/minimal.png"
          ]
        },
        "thumbnailSrc": {
          "type": "string",
          "format": "uri",
          "description": "Smaller thumbnail preview suited to dense grid views.",
          "examples": [
            "https://www.pptx.gallery/themes/minimal.thumbnail.png"
          ]
        },
        "vectorSrc": {
          "type": "string",
          "format": "uri",
          "description": "SVG / vector preview for crisp scaling at any size.",
          "examples": [
            "https://www.pptx.gallery/themes/minimal.svg"
          ]
        }
      }
    }
  },
  "$defs": {
    "ThemeBackgroundSlot": {
      "type": "string",
      "description": "PowerPoint theme-controlled slide background slot from the active color scheme. These are slots, not assumptions about actual colors: light1 is usually white and dark1 is usually black by convention, but the color scheme controls the real values.",
      "enum": [
        "light1",
        "light2",
        "dark1",
        "dark2"
      ]
    },
    "ThemeBackground": {
      "type": "object",
      "description": "Theme-controlled PowerPoint slide background. The slot is resolved through the active color scheme and remains theme-aware.",
      "required": [
        "type",
        "slot"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "theme",
          "description": "Theme-controlled background fill."
        },
        "slot": {
          "$ref": "#/$defs/ThemeBackgroundSlot"
        }
      }
    }
  }
}
