{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quailpages.com/schema/qp.theme-style.schema.json",
  "title": "Quail Pages Theme Style Configuration",
  "description": "Optional package metadata for a QP theme. When this file exists, id is its stable transport identity and must match the canonical directory ID. Discovery still derives from the directory and required style.css; resources and owner CSS derive from the package.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Stable theme package identity. Validation requires an exact match with the canonical containing directory ID; it is not used for discovery or resolution."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Optional human-facing theme name. The theme directory name is the fallback."
    },
    "fontPreloads": {
      "type": "array",
      "uniqueItems": true,
      "description": "Theme-relative font files that should be preloaded. File location and media type are derived from the package and extension.",
      "items": {
        "type": "string",
        "pattern": "^fonts/(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[^?#]+\\.(?:woff2?|ttf|otf)$"
      }
    }
  }
}
