# Decap CMS configuration for the CBGL site.
#
# LOCAL EDITING (now): `local_backend: true` lets the CMS read/write these
# files directly on your Mac while `npx decap-server` is running. See README.
#
# HOSTED EDITING (later): once the site is on GitHub + Netlify, fill in `repo`
# below and set up the GitHub login — then editors use yoursite.com/admin and
# saves auto-commit + redeploy. Nothing else in this file needs to change.

backend:
  name: github
  repo: your-github-user/cbgl-web # TODO: set to "owner/repo" when you deploy
  branch: main

# Enables the local editing workflow via `npx decap-server`.
local_backend: true

# Commit straight to the branch (no review/PR step) — simplest for a small team.
publish_mode: simple

# Uploaded images land in public/images and are referenced as /images/<file>.
media_folder: "public/images"
public_folder: "/images"

collections:
  # ─────────────────────────────────────────────────────────────
  # BRANDS  (src/data/brands.json → { "brands": [ … ] })
  # ─────────────────────────────────────────────────────────────
  - name: "brands"
    label: "Brands"
    files:
      - name: "brands"
        label: "All brands"
        file: "src/data/brands.json"
        description: "Add, remove, reorder, and edit every brand and its detail page."
        fields:
          - label: "Brands"
            name: "brands"
            label_singular: "Brand"
            widget: "list"
            summary: "{{fields.name}}"
            fields:
              - { label: "Slug (URL + image name — don't change on existing brands)", name: "slug", widget: "string", pattern: ['^[a-z0-9-]+$', "lowercase letters, numbers and dashes only"] }
              - { label: "Name", name: "name", widget: "string" }
              - { label: "Category (e.g. Nail · Clean beauty)", name: "category", widget: "string" }
              - { label: "Accent colour", name: "accent", widget: "color", enableAlpha: false }
              - { label: "Wordmark logo", name: "logo", widget: "image", required: false, hint: "SVG/PNG shown at the top of the brand page." }
              - { label: "Brand website (homepage URL)", name: "website", widget: "string", required: false, hint: "e.g. https://shop.kurebazaar.com — linked from the brand page." }
              - { label: "Tagline (italic line)", name: "tagline", widget: "string" }
              - { label: "Detail-page tagline (optional — overrides Tagline on the brand page only)", name: "detailTagline", widget: "string", required: false }
              - { label: "Short description (cards & rows)", name: "description", widget: "text" }
              - { label: "Meta line (e.g. Paris · Est. 2012 · …)", name: "meta", widget: "string" }
              - { label: "Availability label", name: "availability", widget: "string", hint: "e.g. Order on Faire / Direct via CBGL" }
              - { label: "Availability type", name: "availabilityType", widget: "select", options: ["faire", "direct"] }
              - { label: "Show an 'Order on Faire' button", name: "onFaire", widget: "boolean", default: false }
              - { label: "Faire storefront URL (this brand's own Faire page)", name: "faireUrl", widget: "string", required: false }
              - { label: "Hero description (top of brand page)", name: "heroDescription", widget: "text" }
              - { label: "Availability note (small line under buttons)", name: "availabilityNote", widget: "string", required: false }
              - label: "Stats (the 4-number band)"
                name: "stats"
                widget: "list"
                fields:
                  - { label: "Value", name: "value", widget: "string" }
                  - { label: "Label", name: "label", widget: "string" }
              - label: "Why retailers care"
                name: "whyRetailers"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "Products (Bestsellers / Collections / The line)"
                name: "products"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items (up to 4 — image is set by filename, see IMAGE-SLOTS.md)"
                    name: "items"
                    widget: "list"
                    max: 4
                    summary: "{{fields.name}}"
                    fields:
                      - { label: "Name", name: "name", widget: "string" }
                      - { label: "Blurb", name: "blurb", widget: "string", required: false }
                      - { label: "Tag (e.g. New, Bestseller)", name: "tag", widget: "string", required: false }
                      - { label: "Price", name: "price", widget: "string", required: false }
                      - { label: "PDP link (product page URL on the brand's site)", name: "url", widget: "string", required: false, hint: "Paste the product page URL to make the card clickable." }
              - label: "Press quotes (leave empty for none)"
                name: "press"
                widget: "list"
                required: false
                fields:
                  - { label: "Outlet", name: "outlet", widget: "string" }
                  - { label: "Quote", name: "quote", widget: "text" }
                  - { label: "Year", name: "year", widget: "string" }
              - { label: "Stocked by (US retailer keys — see Site settings)", name: "stockedBy", widget: "list", required: false, hint: "e.g. bloomingdales, printemps" }
              - { label: "International stockist keys", name: "intlStockists", widget: "list", required: false }
              - { label: "Text-only stockists (no logo, e.g. Merz Apothecary)", name: "stockistsText", widget: "list", required: false }
              - label: "Closing CTA banner"
                name: "cta"
                widget: "object"
                fields:
                  - { label: "Heading", name: "heading", widget: "string" }
                  - { label: "Body", name: "body", widget: "text" }

  # ─────────────────────────────────────────────────────────────
  # EVENTS  (src/data/events.json → { "events": [ … ] })
  # ─────────────────────────────────────────────────────────────
  - name: "events"
    label: "Events"
    files:
      - name: "events"
        label: "All events"
        file: "src/data/events.json"
        description: "The 'Meet us in person' list. Sorted automatically by date."
        fields:
          - label: "Events"
            name: "events"
            label_singular: "Event"
            widget: "list"
            summary: "{{fields.name}} — {{fields.date}}"
            fields:
              - { label: "Name", name: "name", widget: "string" }
              - { label: "Date (shown as written)", name: "date", widget: "string" }
              - { label: "Sort date (YYYY-MM-DD)", name: "isoDate", widget: "string", hint: "Only used to order events, soonest first." }
              - { label: "Location", name: "location", widget: "string" }
              - { label: "Link (full https://… or /contact)", name: "link", widget: "string" }

  # ─────────────────────────────────────────────────────────────
  # SITE SETTINGS  (src/data/site.json)
  # (The retailer-logo map is kept intact; edit it in the file — it rarely
  #  changes and its keys are referenced by each brand's "stockedBy".)
  # ─────────────────────────────────────────────────────────────
  - name: "site"
    label: "Site settings"
    files:
      - name: "site"
        label: "General"
        file: "src/data/site.json"
        description: "Contact details, nav labels, footer, socials."
        fields:
          - { label: "Brand name", name: "brandName", widget: "string" }
          - { label: "Tagline", name: "tagline", widget: "string" }
          - { label: "Footer blurb", name: "blurb", widget: "text" }
          - { label: "Contact email", name: "contactEmail", widget: "string" }
          - label: "Company"
            name: "company"
            widget: "object"
            fields:
              - { label: "Legal name", name: "legalName", widget: "string" }
              - { label: "Address lines", name: "address", widget: "list" }
          - label: "Social links"
            name: "social"
            widget: "list"
            summary: "{{fields.label}}"
            fields:
              - { label: "Label", name: "label", widget: "string" }
              - { label: "URL", name: "href", widget: "string" }
          - label: "Navigation"
            name: "nav"
            widget: "list"
            summary: "{{fields.label}}"
            fields:
              - { label: "Label", name: "label", widget: "string" }
              - { label: "Link", name: "href", widget: "string" }
          - { label: "Home logo strip (retailer keys)", name: "homeRetailers", widget: "list", hint: "Which retailer keys show in the home 'carried by' strip." }
          - label: "Retailer logos"
            name: "retailers"
            widget: "list"
            collapsed: true
            summary: "{{fields.name}}"
            fields:
              - { label: "Key (used in a brand's 'stocked by')", name: "key", widget: "string" }
              - { label: "Name", name: "name", widget: "string" }
              - { label: "Logo", name: "logo", widget: "image" }
              - { label: "Max height (px)", name: "maxHeight", widget: "number", value_type: "int", default: 26 }

  # ─────────────────────────────────────────────────────────────
  # PAGE COPY  (src/data/pages.json)
  # One entry for the whole file (all six pages as collapsible sections),
  # so saving never drops the other pages' content.
  # ─────────────────────────────────────────────────────────────
  - name: "pages"
    label: "Page copy"
    files:
      - name: "pages"
        label: "All page copy"
        file: "src/data/pages.json"
        description: "Headings and paragraphs for each page. Expand a section to edit it."
        fields:
          - label: "Home page"
            name: "home"
            widget: "object"
            collapsed: true
            fields:
              - label: "Hero"
                name: "hero"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Headline", name: "headline", widget: "text" }
              - label: "Stats band"
                name: "stats"
                widget: "list"
                fields:
                  - { label: "Value", name: "value", widget: "string" }
                  - { label: "Label", name: "label", widget: "string" }
              - label: "How we work"
                name: "howWeWork"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "Dual CTA cards"
                name: "dualCta"
                widget: "object"
                fields:
                  - label: "Retailers card"
                    name: "retailers"
                    widget: "object"
                    fields:
                      - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Points", name: "points", widget: "list" }
                      - label: "Button"
                        name: "cta"
                        widget: "object"
                        fields:
                          - { label: "Label", name: "label", widget: "string" }
                          - { label: "Link", name: "href", widget: "string" }
                  - label: "Brands card"
                    name: "brands"
                    widget: "object"
                    fields:
                      - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Points", name: "points", widget: "list" }
                      - label: "Button"
                        name: "cta"
                        widget: "object"
                        fields:
                          - { label: "Label", name: "label", widget: "string" }
                          - { label: "Link", name: "href", widget: "string" }
              - label: "Founder quote"
                name: "founderQuote"
                widget: "object"
                fields:
                  - { label: "Quote", name: "quote", widget: "text" }
                  - { label: "Name", name: "name", widget: "string" }
                  - { label: "Role", name: "role", widget: "string" }

          - label: "Brands page"
            name: "brands"
            widget: "object"
            collapsed: true
            fields:
              - { label: "Eyebrow", name: "eyebrow", widget: "string" }
              - { label: "Headline", name: "headline", widget: "string" }
              - { label: "Italic tail (must match end of headline)", name: "headlineEm", widget: "string" }
              - { label: "Intro", name: "intro", widget: "text" }
              - label: "Closing CTA"
                name: "cta"
                widget: "object"
                fields:
                  - { label: "Heading", name: "heading", widget: "string" }
                  - { label: "Body", name: "body", widget: "text" }

          - label: "For Retailers page"
            name: "forRetailers"
            widget: "object"
            collapsed: true
            fields:
              - label: "Hero"
                name: "hero"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Headline", name: "headline", widget: "string" }
                  - { label: "Italic tail", name: "headlineEm", widget: "string" }
                  - { label: "Intro", name: "intro", widget: "text" }
                  - { label: "Note line", name: "note", widget: "string" }
              - label: "Why carry"
                name: "whyCarry"
                widget: "object"
                fields:
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "Press"
                name: "press"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Outlet", name: "outlet", widget: "string" }
                      - { label: "Quote", name: "quote", widget: "text" }
                      - { label: "Meta (brand · year)", name: "meta", widget: "string" }
              - label: "How to order"
                name: "howToOrder"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Cards"
                    name: "cards"
                    widget: "list"
                    fields:
                      - { label: "Kicker", name: "kicker", widget: "string" }
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
                      - label: "Button"
                        name: "cta"
                        widget: "object"
                        fields:
                          - { label: "Label", name: "label", widget: "string" }
                          - { label: "Type", name: "type", widget: "select", options: ["faire", "contact"] }
              - label: "Final CTA"
                name: "finalCta"
                widget: "object"
                fields:
                  - { label: "Heading", name: "heading", widget: "string" }
                  - { label: "Body", name: "body", widget: "text" }

          - label: "For Brands page"
            name: "forBrands"
            widget: "object"
            collapsed: true
            fields:
              - label: "Hero"
                name: "hero"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Headline", name: "headline", widget: "string" }
                  - { label: "Italic tail", name: "headlineEm", widget: "string" }
                  - { label: "Intro", name: "intro", widget: "text" }
                  - label: "Highlights"
                    name: "highlights"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "What we offer"
                name: "offer"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "Who we work with"
                name: "criteria"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Criteria items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
                  - label: "Checker card"
                    name: "checker"
                    widget: "object"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
                      - { label: "Points", name: "points", widget: "list" }
                      - { label: "CTA label", name: "cta", widget: "string" }
              - label: "Company you'd keep"
                name: "companyKeep"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
              - label: "Closing CTA"
                name: "cta"
                widget: "object"
                fields:
                  - { label: "Heading", name: "heading", widget: "string" }
                  - { label: "Body", name: "body", widget: "text" }

          - label: "About page"
            name: "about"
            widget: "object"
            collapsed: true
            fields:
              - label: "Hero"
                name: "hero"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Headline", name: "headline", widget: "string" }
                  - { label: "Italic word", name: "headlineEm", widget: "string" }
                  - { label: "Intro", name: "intro", widget: "text" }
              - label: "Founder"
                name: "founder"
                widget: "object"
                fields:
                  - { label: "Name", name: "name", widget: "string" }
                  - { label: "Role", name: "role", widget: "string" }
                  - { label: "Location", name: "location", widget: "string" }
                  - { label: "Pull quote", name: "quote", widget: "text" }
                  - { label: "Attribution", name: "attribution", widget: "string" }
                  - { label: "Lead paragraph", name: "lead", widget: "text" }
                  - { label: "Body paragraphs", name: "paragraphs", widget: "list", field: { label: "Paragraph", name: "p", widget: "text" } }
              - label: "What we do"
                name: "whatWeDo"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "Approach"
                name: "approach"
                widget: "object"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - label: "Items"
                    name: "items"
                    widget: "list"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Body", name: "body", widget: "text" }
              - label: "Connect cards"
                name: "connect"
                widget: "list"
                fields:
                  - { label: "Eyebrow", name: "eyebrow", widget: "string" }
                  - { label: "Title", name: "title", widget: "string" }
                  - { label: "Body", name: "body", widget: "text" }
                  - { label: "CTA label", name: "cta", widget: "string" }
              - label: "Careers"
                name: "careers"
                widget: "object"
                fields:
                  - { label: "Title", name: "title", widget: "string" }
                  - { label: "Body", name: "body", widget: "string" }
                  - label: "Open roles (leave empty for 'no openings')"
                    name: "roles"
                    widget: "list"
                    required: false
                    summary: "{{fields.title}}"
                    fields:
                      - { label: "Title", name: "title", widget: "string" }
                      - { label: "Type", name: "type", widget: "string" }
                      - { label: "Location", name: "location", widget: "string" }
                      - { label: "Description", name: "description", widget: "text" }

          - label: "Contact page"
            name: "contact"
            widget: "object"
            collapsed: true
            fields:
              - { label: "Eyebrow", name: "eyebrow", widget: "string" }
              - { label: "Headline", name: "headline", widget: "string" }
              - { label: "Intro", name: "intro", widget: "text" }
              - { label: "Interest options", name: "interests", widget: "list" }
