# Decap CMS configuration for S&K Construction.
#
# AUTHENTICATION (production): GitHub backend. The public website is
# hosted on IONOS, but this CMS is deployed as its own, separate site on
# Netlify — https://cms.sandkconstruction.co.uk — which is what runs
# Decap's OAuth handshake; IONOS never needs to. Both this config.yml and
# index.html are published there (Netlify's publish directory for that
# project is `public/admin` itself, which is why config.yml resolves at
# the site root, /config.yml, not /admin/config.yml — see the
# `cms-config-url` link in index.html). Saving in this CMS still commits
# to the sandkconstruction/sk-construction-website GitHub repo on `main`;
# only where the editor UI and the OAuth handshake run has moved to
# Netlify. `site_domain` is deliberately omitted: Decap defaults to the
# CMS page's own hostname, cms.sandkconstruction.co.uk, which is already
# the Netlify site carrying the configured GitHub OAuth Client ID/Secret,
# so no override is needed. `base_url` is also omitted, so the GitHub
# backend uses Decap's default Netlify OAuth endpoint. We are not using
# Git Gateway. See README "Decap CMS" for the full architecture and for
# why editorial_workflow is deliberately not enabled — CMS saves commit
# directly to `main`. Editors need GitHub write access to
# sandkconstruction/sk-construction-website to authenticate.
#
# `local_backend: true` lets a developer run `npx decap-server` locally and
# edit content against the real filesystem without any auth configured —
# this is unaffected by the production backend above.

backend:
  name: github
  repo: sandkconstruction/sk-construction-website
  branch: main

local_backend: true

media_folder: "public/uploads"
public_folder: "/uploads"

# UPLOAD SIZE GUARD — applied per image field, not globally.
#
# Files in public/uploads bypass Astro's image pipeline entirely and ship at
# whatever size they were uploaded; the default media library does no
# optimisation. Acceptance testing put a 1.59MB PNG on a project where the
# image it replaced was 62KB.
#
# Checked against the loaded decap-cms@^3.0.0 bundle rather than assumed:
#   - `max_file_size` is compared directly against the browser File.size, so
#     the unit is BYTES; the rejection message reports floor(bytes / 1000),
#     so 1000000 reads to the editor as "1000 kB".
#   - A TOP-LEVEL `media_library:` block is NOT usable here. Its config schema
#     is {name, config} with `name` REQUIRED, and `name` selects an external
#     provider (uploadcare/cloudinary). Setting it without a name makes Decap
#     refuse to load with "media_library must have required property name".
#     The per-field form below is accepted and is what actually applies.
#   - Decap's default media library has no option for restricting file TYPES,
#     so format guidance lives in the field hints instead.


collections:
  # Deliberately front-loaded with the four fields a project actually
  # needs: title, category, cover photo, photographs. Everything below
  # "Optional extras" can be skipped entirely — a member of S&K staff
  # should be able to publish a finished job from their phone with photos
  # and a title. The long-form case-study fields are kept at the bottom,
  # all optional, for the rare project that genuinely warrants them.
  - name: "projects"
    label: "Our Work (Projects)"
    label_singular: "Project"
    folder: "src/content/projects"
    create: true
    slug: "{{slug}}"
    extension: "md"
    format: "frontmatter"
    summary: "{{order}} · {{title}} — {{category}}"
    sortable_fields: ["order", "title", "category"]
    fields:
      - { label: "Project title", name: "title", widget: "string" }
      - label: "Category"
        name: "category"
        widget: "select"
        default: "residential"
        options:
          - { label: "Residential", value: "residential" }
          - { label: "Commercial", value: "commercial" }
      - { label: "Cover photograph", name: "heroImage", widget: "image", media_library: { config: { max_file_size: 1000000 } }, hint: "The main photograph used on project cards and shown first when the project is opened. Use a JPG or WebP saved for the web. Very large photos straight from a phone or camera will be rejected." }
      - { label: "Cover photograph description", name: "heroImageAlt", widget: "string", hint: "Describe the cover photograph for accessibility. Update this whenever you change the cover photograph." }
      - label: "Additional photographs"
        name: "gallery"
        widget: "list"
        required: false
        hint: "Add any other photographs you want shown in the project gallery. Drag them into the order you want them to appear. Do not repeat the cover photograph here — it is always shown first automatically."
        fields:
          - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } }, hint: "Use a JPG or WebP saved for the web. Very large photos straight from a phone or camera will be rejected." }
          - { label: "Description of this photograph", name: "alt", widget: "string", required: false, hint: "Describes this one photograph, for accessibility." }

      # ---------- Optional extras ----------
      - { label: "Location", name: "location", widget: "string", required: false, hint: "Optional, e.g. Sevenoaks." }
      - { label: "Short caption", name: "summary", widget: "text", required: false, hint: "Optional — a line or two about the job. Not required to publish." }
      - { label: "Show in Recent Work on homepage", name: "featured", widget: "boolean", default: false, required: false, hint: "Turn this on to include this project in the Recent Work section of the homepage. Up to three are shown there, in Position order." }
      - { label: "Position", name: "order", widget: "number", required: false, hint: "Controls where this project appears relative to other projects. Lower numbers appear first. Leave blank to place the project at the end. This applies across the whole site — Our Work, the homepage Recent Work section, and the Residential and Commercial pages." }
      # NOTE: completionDate, projectType, scopeOfWorks, challenge, outcome,
      # testimonialId, seoTitle, metaDescription, socialImage and the markdown
      # body are deliberately NOT exposed here. A usage audit found none of
      # them reaches the site — there is no per-project route, so the SEO
      # fields have no page to describe — and no project file currently
      # contains any of them. They remain in the Astro schema, so any entry
      # that ever carries one still parses; they are simply not shown to an
      # editor, because a field that does nothing is worse than no field.

  # Slug: reviews have no `title` or `path` field, which are the only two
  # names Decap looks for when resolving {{slug}}. Without `identifier_field`
  # it fell back to stringifying the entry's Immutable Map, producing files
  # like `map-featured-false-name-tester-quote-brilliant-service-all-round.md`.
  # Naming `name` as the identifier fixes both the filename and the readable
  # label Decap shows in relation pickers (the About page review chooser).
  # Existing files are matched by path, so none of them are renamed.
  - name: "reviews"
    label: "Reviews"
    folder: "src/content/reviews"
    create: true
    identifier_field: "name"
    slug: "{{name}}"
    extension: "md"
    format: "frontmatter"
    summary: "{{name}}"
    fields:
      - { label: "Customer / client name", name: "name", widget: "string", hint: "Shown under the quote. This also names the file, so keep it short." }
      - { label: "Testimonial", name: "quote", widget: "text", hint: "The full testimonial, exactly as the customer gave it." }
      - label: "Audience"
        name: "audience"
        widget: "select"
        required: false
        hint: "Shown in the attribution as 'Residential client' or 'Commercial client'."
        options:
          - { label: "Residential", value: "residential" }
          - { label: "Commercial", value: "commercial" }
      - { label: "Show on homepage", name: "featured", widget: "boolean", default: false, hint: "Turn this on to include this review in the homepage testimonial carousel. This does not affect the About page, which has its own list — see Pages -> About -> Client feedback." }
      - { label: "Shorter version for the homepage", name: "homepageExcerpt", widget: "text", required: false, hint: "Optional. Used in the homepage carousel, where space is tight. Leave blank and the full testimonial above is shown there instead." }
      - { label: "Shorter version for the About page", name: "aboutExcerpt", widget: "text", required: false, hint: "Optional. Used on the About page, where two quotes sit side by side and need to balance. Leave blank and the homepage version is used, or the full testimonial if that is blank too." }
      # Internal provenance, never shown on the website. Kept as a hidden
      # field rather than removed so that saving an existing review does not
      # silently drop it — 04-zoe.md carries `source: letter`, and Decap
      # writes back only the fields declared here.
      - { label: "Source", name: "source", widget: "hidden" }

  # Same identifier fix as reviews: accreditations have no `title`/`path`
  # field either, so the first entry created through Decap would have hit the
  # identical stringified-Map filename. Existing files keep their names.
  - name: "accreditations"
    label: "Accreditations"
    folder: "src/content/accreditations"
    create: true
    identifier_field: "name"
    slug: "{{name}}"
    extension: "md"
    format: "frontmatter"
    summary: "{{order}} · {{name}}"
    sortable_fields: ["order", "name"]
    fields:
      - { label: "Name", name: "name", widget: "string", hint: "Also used as the logo's description for screen readers, so write it as the scheme is normally named." }
      - { label: "Logo", name: "logo", widget: "image", media_library: { config: { max_file_size: 1000000 } }, required: false, hint: "The normal logo, shown on the About page's light background. Use a PNG or SVG with a transparent background where possible." }
      - { label: "Logo for dark backgrounds", name: "logoOnDark", widget: "image", media_library: { config: { max_file_size: 1000000 } }, required: false, hint: "A version that stays readable on the dark navy footer — usually the white or reversed-out artwork. If you leave this blank the normal logo above is used instead, so only skip it if that logo already shows up clearly against dark navy." }
      - { label: "Sort order", name: "order", widget: "number", required: false, hint: "Lower numbers come first, on the About page and in the footer. Leave blank and this accreditation goes to the end." }
      - { label: "Visible on site", name: "visible", widget: "boolean", default: false, hint: "Leave off until this accreditation is verified and approved for display. Nothing appears on the website until this is switched on." }

  # Page content, grouped into the editorial sections an editor actually
  # thinks in (Hero, What we cover, Enquiry, SEO…) rather than one long
  # flat list. The grouping is for the /admin form only — it changes
  # nothing about how the pages render.
  #
  # Several copy fields accept canonical-value tokens so a business fact is
  # never typed twice. Those fields carry the token hint below.
  - name: "pages"
    label: "Pages"
    files:
      # ---------------- About ----------------
      - name: "about"
        label: "About Page"
        file: "src/content/pages/about.md"
        fields:
          - { label: "Page name", name: "title", widget: "string", hint: "Internal name for this page, and the fallback browser-tab title." }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false, hint: "Shown in the browser tab and in Google results." }
              - { label: "Meta description", name: "description", widget: "text", required: false, hint: "The grey summary line under the title in Google results." }
          - label: "Hero"
            name: "hero"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Main heading", name: "heading", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Introduction", name: "intro", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } } }
              - { label: "Photograph description", name: "imageAlt", widget: "string", hint: "A short description of the photo, for screen readers." }
          - label: "Who we are"
            name: "who"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } } }
              - { label: "Photograph description", name: "imageAlt", widget: "string" }
          - label: "Client feedback"
            name: "clientFeedback"
            widget: "object"
            hint: "The wording of the quotes lives in the Reviews collection — only the choice of which ones to show is made here."
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
              - label: "Reviews shown on this page"
                name: "reviews"
                widget: "list"
                required: false
                hint: "Pick which reviews appear here, in the order they should read. The layout is built for TWO — any beyond the first two are ignored, and the section is hidden if none are chosen. Each review's wording is edited in the Reviews collection, where an 'About Page Excerpt' can be set if a quote needs shortening for this layout."
                field: { label: "Review", name: "review", widget: "relation", collection: "reviews", search_fields: ["name", "quote"], value_field: "{{slug}}", display_fields: ["name"] }
          - label: "Accreditations & training"
            name: "accreditations"
            widget: "object"
            hint: "The logos come from the Accreditations collection. Only the wording around them is edited here."
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Supporting text", name: "text", widget: "text" }
              - { label: "Training courses", name: "training", widget: "list", required: false, hint: "Staff safety training, shown as a plain list of names. Drag to reorder." }
          - label: "Closing call to action"
            name: "cta"
            widget: "object"
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
          - { label: "Body copy", name: "body", widget: "markdown", hint: "The main paragraphs in the 'Who we are' section." }

      # ---------------- Residential ----------------
      - name: "residential"
        label: "Residential Page"
        file: "src/content/pages/residential.md"
        fields:
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - label: "Hero"
            name: "hero"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Main heading", name: "heading", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Introduction", name: "intro", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Button text", name: "ctaLabel", widget: "string" }
              - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } } }
              - { label: "Photograph description", name: "imageAlt", widget: "string" }
          - label: "What we cover"
            name: "capabilities"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } } }
              - { label: "Photograph description", name: "imageAlt", widget: "string" }
              - label: "Types of work"
                name: "items"
                widget: "list"
                required: true
                min: 1
                hint: "Drag to reorder. At least one is required — this section is nothing but this list, so an empty one would leave a heading over blank space."
                fields:
                  - { label: "Title", name: "title", widget: "string" }
                  - { label: "Description", name: "text", widget: "text" }
              - { label: "Small label above the trades list", name: "tradesEyebrow", widget: "string" }
              - { label: "Trades list", name: "trades", widget: "list", required: true, min: 1, hint: "Shown as one run of text separated by dots. Drag to reorder. At least one is required — the 'Also covering' band exists only to show these." }
          - label: "Working with S&K"
            name: "approach"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
              - label: "Reassurance points"
                name: "facts"
                widget: "list"
                required: false
                hint: "Optional. The strip also shows the years-established and service-area figures, which are worked out automatically, so it still reads correctly with none of these."
                fields:
                  - { label: "Title", name: "title", widget: "string" }
                  - { label: "Text", name: "text", widget: "text" }
              - { label: "Years-established sentence", name: "establishedFactText", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details. The years figure above this sentence is worked out automatically." }
              - { label: "Service-area point — title", name: "serviceAreaFactTitle", widget: "string", hint: "The text beneath comes straight from Business Details -> Service area summary." }
          - label: "Recent work"
            name: "proof"
            widget: "object"
            hint: "The project name and description shown here come from the Projects collection. The two comparison photographs below belong to this page."
            fields:
              - { label: "Link text", name: "linkLabel", widget: "string" }
              - { label: "Label used when the project has no location", name: "fallbackEyebrow", widget: "string" }
              - label: "Before & After"
                name: "beforeAfter"
                widget: "object"
                hint: "Choose the two photographs used in the before-and-after comparison on this page. Both are needed — if either is missing, the comparison is hidden."
                fields:
                  - { label: "Before photograph", name: "before", widget: "image", required: false, media_library: { config: { max_file_size: 1000000 } }, hint: "The 'before' photograph. Use a JPG or WebP saved for the web, under 1MB." }
                  - { label: "Before image description (for accessibility)", name: "beforeAlt", widget: "string", required: false, hint: "Briefly describe what is shown in the photograph. This helps screen-reader users." }
                  - { label: "After photograph", name: "after", widget: "image", required: false, media_library: { config: { max_file_size: 1000000 } }, hint: "The 'after' photograph, taken from the same position where possible." }
                  - { label: "After image description (for accessibility)", name: "afterAlt", widget: "string", required: false, hint: "Briefly describe what is shown in the photograph. This helps screen-reader users." }
                  - { label: "Caption", name: "caption", widget: "string", required: false, hint: "A short line shown under the two photographs, e.g. 'Kitchen'. The words 'before and after' are added automatically." }
          - label: "Enquiry section"
            name: "enquiry"
            widget: "object"
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Text", name: "text", widget: "text" }
              - { label: "Coverage line", name: "coverageText", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Coverage link text", name: "coverageLinkLabel", widget: "string" }
          - { label: "Body copy", name: "body", widget: "markdown", hint: "The paragraphs in the 'Working with S&K' section." }

      # ---------------- Commercial ----------------
      - name: "commercial"
        label: "Commercial & Property Management Page"
        file: "src/content/pages/commercial.md"
        fields:
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - label: "Hero"
            name: "hero"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Main heading", name: "heading", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Introduction", name: "intro", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Button text", name: "ctaLabel", widget: "string" }
              - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } } }
              - { label: "Photograph description", name: "imageAlt", widget: "string" }
          - label: "Proposition"
            name: "proposition"
            widget: "object"
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
          - label: "What we cover"
            name: "capabilities"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Photograph", name: "image", widget: "image", media_library: { config: { max_file_size: 1000000 } } }
              - { label: "Photograph description", name: "imageAlt", widget: "string" }
              - { label: "Photograph caption", name: "caption", widget: "text" }
              - label: "Types of work"
                name: "items"
                widget: "list"
                required: true
                min: 1
                hint: "Numbered automatically in the order shown. Drag to reorder. At least one is required — this list is the section, and the heading above it counts them."
                fields:
                  - { label: "Title", name: "title", widget: "string" }
                  - { label: "Description", name: "text", widget: "text" }
          - label: "The coordination is the job"
            name: "coordination"
            widget: "object"
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "First paragraph", name: "text1", widget: "text" }
              - { label: "Second paragraph", name: "text2", widget: "text" }
              - { label: "Trades list", name: "trades", widget: "list", required: true, min: 1, hint: "Drag to reorder. At least one is required — this list is one whole column of this section." }
          - label: "Selected work"
            name: "work"
            widget: "object"
            hint: "The projects shown here come from the Projects collection."
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Link text", name: "linkLabel", widget: "string" }
          - label: "Enquiry section"
            name: "enquiry"
            widget: "object"
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Text", name: "text", widget: "text" }
              - { label: "Coverage line", name: "coverageText", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Coverage link text", name: "coverageLinkLabel", widget: "string" }
          - { label: "Body copy", name: "body", widget: "markdown", hint: "The paragraphs under the proposition heading." }

      # ---------------- Our Work ----------------
      - name: "our-work"
        label: "Our Work Page"
        file: "src/content/pages/our-work.md"
        fields:
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - label: "Introduction"
            name: "intro"
            widget: "object"
            hint: "The grid of projects below this comes from the Projects collection."
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
          - label: "If there are no projects yet"
            name: "emptyState"
            widget: "object"
            hint: "Only shown if every project is removed. Normally invisible."
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "Message", name: "message", widget: "text" }
          - label: "Closing call to action"
            name: "cta"
            widget: "object"
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
          - { label: "Body copy", name: "body", widget: "markdown", hint: "The intro paragraph under the heading." }

      # ---------------- Contact ----------------
      - name: "contact"
        label: "Contact Page"
        file: "src/content/pages/contact.md"
        fields:
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - label: "Introduction"
            name: "intro"
            widget: "object"
            fields:
              - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
              - { label: "Heading", name: "heading", widget: "string" }
          - label: "Coverage"
            name: "coverage"
            widget: "object"
            hint: "The phone number, email and office address on this page all come from Business Details."
            fields:
              - { label: "Heading", name: "heading", widget: "string" }
              - { label: "First paragraph", name: "text1", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
              - { label: "Second paragraph", name: "text2", widget: "text" }
              - { label: "Third paragraph", name: "text3", widget: "text" }
          - { label: "Body copy", name: "body", widget: "markdown", hint: "The intro paragraph beside the heading." }

  # Small noindex pages in the enquiry flow. Plain fields, no rich text.
  - name: "utility-pages"
    label: "Utility Pages"
    files:
      - name: "thank-you"
        label: "Thank You Page"
        file: "src/content/pages/thank-you.md"
        fields: &utility_fields
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - { label: "Small label above the heading", name: "eyebrow", widget: "string" }
          - { label: "Heading", name: "heading", widget: "string" }
          - { label: "Message", name: "lead", widget: "text" }
          - { label: "First button text", name: "primaryCtaLabel", widget: "string" }
          - { label: "Second button text", name: "secondaryCtaLabel", widget: "string" }
      - name: "404"
        label: "Page Not Found (404)"
        file: "src/content/pages/404.md"
        fields: *utility_fields

  # Legal copy. Rich text, because these pages use sub-headings and lists.
  - name: "legal-pages"
    label: "Legal Pages"
    files:
      - name: "privacy-policy"
        label: "Privacy Policy"
        file: "src/content/pages/privacy-policy.md"
        fields:
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - { label: "Heading", name: "heading", widget: "string" }
          - { label: "Intro line", name: "lead", widget: "text" }
          - { label: "Policy text", name: "body", widget: "markdown", hint: "IMPORTANT: this is a legal document. It must be rewritten if analytics, advertising or cookie tracking is ever added to the website." }
          - { label: "Contact section heading", name: "contactHeading", widget: "string", hint: "The email address beneath it comes from Business Details." }
      - name: "cookies"
        label: "Cookie Policy"
        file: "src/content/pages/cookies.md"
        fields:
          - { label: "Page name", name: "title", widget: "string" }
          - label: "Search engines (SEO)"
            name: "seo"
            widget: "object"
            collapsed: true
            fields:
              - { label: "SEO title", name: "title", widget: "string", required: false }
              - { label: "Meta description", name: "description", widget: "text", required: false }
          - { label: "Heading", name: "heading", widget: "string" }
          - { label: "Intro line", name: "lead", widget: "text" }
          - { label: "Policy text", name: "body", widget: "markdown", hint: "IMPORTANT: this page states that the website sets no cookies and runs no analytics. It must be rewritten in the same change that adds any tracking." }

  # Homepage, grouped into the sections as they appear down the page.
  # The projects in "Recent work" and the photographs in "Before & after"
  # come from the Projects collection — only the wording is edited here.
  - name: "homepage"
    label: "Homepage"
    files:
      - name: "homepage"
        label: "Homepage Content"
        file: "src/content/homepage/homepage.yaml"
        fields:
          - { label: "Hero — Headline", name: "heading", widget: "string", hint: "Full headline text." }
          - { label: "Hero — Highlighted word/phrase", name: "headingAccent", widget: "string", required: false, hint: "Must exactly match a substring of the headline above — that portion renders in the accent colour." }
          - { label: "Hero — Intro", name: "intro", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
          - { label: "Hero — Primary CTA Label", name: "heroPrimaryCtaLabel", widget: "string" }
          - { label: "Hero — Secondary CTA Label", name: "heroSecondaryCtaLabel", widget: "string" }
          - { label: "Hero — Photograph", name: "heroImage", widget: "image", media_library: { config: { max_file_size: 1000000 } }, hint: "Use a JPG or WebP saved for the web, under 1MB. Photos straight from a phone or camera are usually far too large and will be rejected." }
          - { label: "Hero — Photograph description", name: "heroImageAlt", widget: "string", hint: "A short description of the photo, for screen readers." }

          - { label: "Pathway — Residential Title", name: "pathwayResidentialTitle", widget: "string" }
          - { label: "Pathway — Residential Text", name: "pathwayResidentialText", widget: "text" }
          - { label: "Pathway — Residential Capabilities", name: "pathwayResidentialCapabilities", widget: "list", required: false, hint: "Short capability list shown under the Residential pathway. Separate from the fuller list on the Residential page — editing one does not change the other." }
          - { label: "Pathway — Residential Photograph", name: "pathwayResidentialImage", widget: "image", media_library: { config: { max_file_size: 1000000 } }, hint: "Use a JPG or WebP saved for the web, under 1MB. Photos straight from a phone or camera are usually far too large and will be rejected." }
          - { label: "Pathway — Residential Photograph description", name: "pathwayResidentialImageAlt", widget: "string" }
          - { label: "Pathway — Residential Link Text", name: "pathwayResidentialLinkLabel", widget: "string" }
          - { label: "Pathway — Commercial Title", name: "pathwayCommercialTitle", widget: "string" }
          - { label: "Pathway — Commercial Text", name: "pathwayCommercialText", widget: "text" }
          - { label: "Pathway — Commercial Capabilities", name: "pathwayCommercialCapabilities", widget: "list", required: false, hint: "Short capability list shown under the Commercial pathway. Separate from the fuller list on the Commercial page — editing one does not change the other." }
          - { label: "Pathway — Commercial Photograph", name: "pathwayCommercialImage", widget: "image", media_library: { config: { max_file_size: 1000000 } }, hint: "Use a JPG or WebP saved for the web, under 1MB. Photos straight from a phone or camera are usually far too large and will be rejected." }
          - { label: "Pathway — Commercial Photograph description", name: "pathwayCommercialImageAlt", widget: "string" }
          - { label: "Pathway — Commercial Link Text", name: "pathwayCommercialLinkLabel", widget: "string" }

          - { label: "Breadth — Heading", name: "breadthHeading", widget: "string" }
          - { label: "Breadth — Text", name: "breadthText", widget: "text" }
          - { label: "Breadth — Trades list", name: "breadthTrades", widget: "string", hint: "Separate items with ' · ' exactly as they should display." }

          - { label: "Recent work — Heading", name: "recentWorkHeading", widget: "string", hint: "The projects below come from Our Work (Projects) — tick 'Show on homepage' on a project to feature it." }
          - { label: "Recent work — Link Text", name: "recentWorkLinkLabel", widget: "string" }

          - { label: "Before & After — Heading", name: "beforeAfterHeading", widget: "string" }
          - label: "Before & After"
            name: "beforeAfter"
            widget: "object"
            hint: "Choose the two photographs used in the before-and-after comparison on this page. Both are needed — if either is missing, the comparison is hidden."
            fields:
              - { label: "Before photograph", name: "before", widget: "image", required: false, media_library: { config: { max_file_size: 1000000 } }, hint: "The 'before' photograph. Use a JPG or WebP saved for the web, under 1MB." }
              - { label: "Before image description (for accessibility)", name: "beforeAlt", widget: "string", required: false, hint: "Briefly describe what is shown in the photograph. This helps screen-reader users." }
              - { label: "After photograph", name: "after", widget: "image", required: false, media_library: { config: { max_file_size: 1000000 } }, hint: "The 'after' photograph, taken from the same position where possible." }
              - { label: "After image description (for accessibility)", name: "afterAlt", widget: "string", required: false, hint: "Briefly describe what is shown in the photograph. This helps screen-reader users." }
              - { label: "Caption", name: "caption", widget: "string", required: false, hint: "A short line shown beside the heading — usually the job and where it was, e.g. 'Residential Refurbishment, Biggin Hill'." }

          - { label: "Areas — Small label", name: "areasEyebrow", widget: "string" }
          - { label: "Areas — Heading", name: "areasHeading", widget: "string", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
          - { label: "Areas — Supporting text", name: "areasText", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
          - { label: "Areas — Link Text", name: "areasLinkLabel", widget: "string" }
          - { label: "Areas — Map image", name: "areasImage", widget: "image", media_library: { config: { max_file_size: 1000000 } }, hint: "Use a JPG or WebP saved for the web, under 1MB. Photos straight from a phone or camera are usually far too large and will be rejected." }
          - { label: "Areas — Map image description", name: "areasImageAlt", widget: "string" }

          - { label: "Coverage — Heading", name: "coverageHeading", widget: "string" }
          - { label: "Coverage — Text 1", name: "coverageText1", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }
          - { label: "Coverage — Text 2", name: "coverageText2", widget: "text", hint: "TOKENS: You can use {businessName}, {serviceArea}, {baseLocation} and {establishedYear} — the website fills these in from Business Details." }

  # One record, one source of truth for reusable company facts. Staff-facing
  # name is "Business Details" rather than a technical label. Keep it small:
  # this is not a site control panel, and page copy does not belong here.
  - name: "settings"
    label: "Business Details"
    files:
      - name: "site"
        label: "Business Details"
        file: "src/content/settings/site.yaml"
        fields:
          # ---------- Contact details ----------
          - { label: "Company name", name: "businessName", widget: "string" }
          - { label: "Phone number", name: "phone", widget: "string", required: false, hint: "Digits only, no spaces — e.g. 01959572689. The website formats it for display (01959 572689) and builds the click-to-call link automatically." }
          - { label: "Email address", name: "enquiryEmail", widget: "string", required: false, hint: "The public contact address shown on the site. This does NOT change where enquiry form submissions are delivered." }
          - { label: "Business address", name: "addressLine", widget: "string", required: false }

          # ---------- Company details ----------
          - label: "Company established"
            name: "established"
            widget: "object"
            hint: "When S&K started trading. The website works out the number of years automatically and keeps it correct every year — never type a years figure anywhere."
            fields:
              - { label: "Month", name: "month", widget: "number", value_type: "int", min: 1, max: 12, required: false, hint: "1 = January, 12 = December." }
              - { label: "Year", name: "year", widget: "number", value_type: "int", required: false }
          - { label: "Company registration number", name: "companyRegistration", widget: "string", required: false }

          # ---------- Business statistics ----------
          - label: "Business statistics"
            name: "statistics"
            widget: "object"
            hint: "Leave blank until the real figure is confirmed. Never estimate — a blank statistic is always better than a guessed one. Enter the value only; the website supplies the wording."
            fields:
              - { label: "Projects completed", name: "projectsCompleted", widget: "string", required: false, hint: "The figure only, e.g. 500+" }
              - { label: "Public liability cover", name: "publicLiabilityCover", widget: "string", required: false, hint: "The figure only, e.g. £10m" }

          # ---------- Website defaults ----------
          - { label: "Service area summary", name: "serviceAreaSummary", widget: "string", required: false, hint: "The broad region S&K works across. Used on the homepage, Residential, Commercial and Contact." }
          - { label: "Based in", name: "baseLocation", widget: "string", required: false, hint: "Short form, e.g. Biggin Hill, Kent." }
          - { label: "Primary button text", name: "primaryCtaText", widget: "string", default: "Request a Quote" }
          - { label: "Default SEO title", name: "defaultSeoTitle", widget: "string", required: false }
          - { label: "Default meta description", name: "defaultMetaDescription", widget: "text", required: false }
          # Social links are not exposed: nothing on the website renders them,
          # so an editor filling them in would see no result. The schema keeps
          # `socialUrls` (defaulting to {}), so the site still builds if the
          # keys disappear from site.yaml on a future save. Re-expose this and
          # wire it into the footer if S&K wants social channels at launch.
