# ---------------------------------------------------------------------------
# Decap CMS configuration — visual admin panel at /admin
#
# Backend: GitHub (free, Git-based). Every save is a commit; editorial
# workflow turns drafts into pull requests, so nothing goes live until it's
# merged into `main` — which then triggers a Cloudflare Pages rebuild.
#
# ⚠️ Set `repo:` below to your own GitHub "owner/repository" before use.
# ---------------------------------------------------------------------------

backend:
  name: github
  repo: foodieshe/wanderlust-foundation-04c7e94d # <-- owner/repo
  branch: main
  # OAuth handled by the free Cloudflare Pages Functions in /functions/api.
  base_url: https://foodieshe.pages.dev
  auth_endpoint: /api/auth

# Draft → In review → Ready (GitHub pull requests under the hood).
publish_mode: editorial_workflow

# Local development: run `npx decap-server` and open /admin with no login.
local_backend: true

media_folder: public/images/uploads
public_folder: /images/uploads

site_url: /
display_url: /
logo_url: /favicon.ico

slug:
  encoding: ascii
  clean_accents: true

collections:
  # ------------------------------------------------------------ Destinations
  - name: countries
    label: Countries
    label_singular: Country
    folder: content/countries
    create: true
    identifier_field: slug
    slug: "{{slug}}"
    summary: "{{name}} — {{region}}"
    preview_path: destinations/{{slug}}
    fields:
      - { name: name, label: Country name, widget: string }
      - {
          name: slug,
          label: Slug,
          widget: string,
          hint: "URL segment, lowercase with dashes. e.g. nepal → /destinations/nepal",
        }
      - { name: region, label: Region, widget: string, hint: "e.g. South Asia" }
      - { name: heroImage, label: Hero image, widget: image, media_library: { config: { multiple: false } } }
      - { name: summary, label: Summary, widget: markdown, hint: "1–2 sentences shown on cards and at the top of the page." }
      - { name: bestTimeToVisit, label: Best time to visit, widget: string, required: false }
      - { name: currency, label: Currency, widget: string, required: false }
      - { name: language, label: Language, widget: string, required: false }
      - { name: visaNotes, label: Visa notes, widget: text, required: false }
      - { name: seoTitle, label: SEO title, widget: string, required: false, hint: "Under 60 characters, include the country name." }
      - {
          name: seoDescription,
          label: SEO description,
          widget: text,
          required: false,
          hint: "Keep this under 160 characters for best Google display.",
        }
      - { name: ogImage, label: Social share image, widget: image, required: false, hint: "1200×630 works best." }

  - name: cities
    label: Cities
    label_singular: City
    folder: content/cities
    create: true
    identifier_field: slug
    slug: "{{slug}}"
    summary: "{{name}}"
    fields:
      - { name: name, label: City name, widget: string }
      - { name: slug, label: Slug, widget: string }
      - {
          name: country,
          label: Country,
          widget: relation,
          collection: countries,
          search_fields: [name],
          value_field: slug,
          display_fields: [name],
          hint: "Pick the parent country — this builds the /destinations/country/city URL.",
        }
      - { name: heroImage, label: Hero image, widget: image }
      - { name: summary, label: Summary, widget: markdown }
      - {
          name: neighborhoods,
          label: Neighborhoods,
          widget: list,
          required: false,
          fields:
            [
              { name: name, label: Name, widget: string },
              { name: description, label: Description, widget: text, required: false },
            ],
        }
      - { name: seoTitle, label: SEO title, widget: string, required: false }
      - { name: seoDescription, label: SEO description, widget: text, required: false, hint: "Under 160 characters." }
      - { name: ogImage, label: Social share image, widget: image, required: false }

  # ---------------------------------------------------------------- Content
  - name: guides
    label: Travel guides
    label_singular: Travel guide
    folder: content/guides
    create: true
    identifier_field: slug
    slug: "{{slug}}"
    preview_path: guides/{{slug}}
    fields:
      - { name: title, label: Title, widget: string }
      - { name: slug, label: Slug, widget: string }
      - {
          name: category,
          label: Category,
          widget: select,
          options: [food, culture, transport, safety, budget, general],
        }
      - { name: country, label: Country, widget: relation, collection: countries, search_fields: [name], value_field: slug, display_fields: [name], required: false }
      - { name: city, label: City, widget: relation, collection: cities, search_fields: [name], value_field: slug, display_fields: [name], required: false }
      - { name: heroImage, label: Hero image, widget: image }
      - { name: excerpt, label: Excerpt, widget: text, hint: "One skimmable sentence for cards and search results." }
      - { name: body, label: Body, widget: markdown, hint: "Write like a document — formatting toolbar included." }
      - {
          name: faqs,
          label: FAQs,
          widget: list,
          required: false,
          fields:
            [
              { name: question, label: Question, widget: string },
              { name: answer, label: Answer, widget: text },
            ],
        }
      - { name: tags, label: Tags, widget: list, required: false }
      - { name: publishedAt, label: Published date, widget: datetime, format: "YYYY-MM-DD" }
      - { name: updatedAt, label: Updated date, widget: datetime, format: "YYYY-MM-DD", required: false }
      - { name: seoTitle, label: SEO title, widget: string, required: false }
      - { name: seoDescription, label: SEO description, widget: text, required: false, hint: "Under 160 characters." }

  - name: itineraries
    label: Itineraries
    label_singular: Itinerary
    folder: content/itineraries
    create: true
    identifier_field: slug
    slug: "{{slug}}"
    preview_path: itineraries/{{slug}}
    fields:
      - { name: title, label: Title, widget: string }
      - { name: slug, label: Slug, widget: string }
      - { name: country, label: Country, widget: relation, collection: countries, search_fields: [name], value_field: slug, display_fields: [name], required: false }
      - { name: city, label: City, widget: relation, collection: cities, search_fields: [name], value_field: slug, display_fields: [name], required: false }
      - { name: heroImage, label: Hero image, widget: image }
      - { name: tripLength, label: Trip length, widget: string, hint: "e.g. 3 days" }
      - { name: budgetLevel, label: Budget level, widget: select, options: [budget, mid-range, luxury] }
      - { name: excerpt, label: Overview, widget: markdown }
      - {
          name: days,
          label: Day by day,
          widget: list,
          fields:
            [
              { name: day, label: Day number, widget: number, value_type: int },
              { name: title, label: Day title, widget: string },
              { name: activities, label: Activities, widget: markdown },
              { name: meals, label: Meals, widget: text, required: false },
              { name: stay, label: Where to stay, widget: string, required: false },
            ],
        }
      - {
          name: faqs,
          label: FAQs,
          widget: list,
          required: false,
          fields:
            [
              { name: question, label: Question, widget: string },
              { name: answer, label: Answer, widget: text },
            ],
        }
      - { name: publishedAt, label: Published date, widget: datetime, format: "YYYY-MM-DD" }
      - { name: seoTitle, label: SEO title, widget: string, required: false }
      - { name: seoDescription, label: SEO description, widget: text, required: false, hint: "Under 160 characters." }

  - name: blog
    label: Blog posts
    label_singular: Blog post
    folder: content/blog
    create: true
    identifier_field: slug
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    preview_path: blog/{{slug}}
    fields:
      - { name: title, label: Title, widget: string }
      - { name: slug, label: Slug, widget: string }
      - { name: category, label: Category, widget: select, options: [food, culture, transport, safety, budget, general] }
      - { name: heroImage, label: Hero image, widget: image }
      - { name: excerpt, label: Excerpt, widget: text, required: false }
      - { name: body, label: Body, widget: markdown }
      - { name: tags, label: Tags, widget: list, required: false }
      - { name: publishedAt, label: Published date, widget: datetime, format: "YYYY-MM-DD" }
      - { name: seoDescription, label: SEO description, widget: text, required: false, hint: "Under 160 characters." }

  - name: faqs
    label: FAQs
    label_singular: FAQ
    folder: content/faqs
    create: true
    slug: "{{slug}}"
    summary: "{{question}}"
    fields:
      - { name: question, label: Question, widget: string }
      - { name: answer, label: Answer, widget: text }
      - {
          name: relatedTo,
          label: Related to,
          widget: string,
          required: false,
          hint: "Slug of the country, city, guide or itinerary this FAQ belongs to. Leave blank for site-wide FAQs.",
        }

  # ----------------------------------------------------------------- Places
  - name: restaurants
    label: Restaurants
    label_singular: Restaurant
    folder: content/restaurants
    create: true
    slug: "{{slug}}"
    summary: "{{name}}"
    fields:
      - { name: name, label: Name, widget: string }
      - { name: slug, label: Slug, widget: string }
      - { name: city, label: City, widget: relation, collection: cities, search_fields: [name], value_field: slug, display_fields: [name] }
      - { name: cuisine, label: Cuisine, widget: string }
      - { name: priceRange, label: Price range, widget: select, options: ["$", "$$", "$$$", "$$$$"] }
      - { name: lat, label: Latitude, widget: number, value_type: float }
      - { name: lng, label: Longitude, widget: number, value_type: float }
      - { name: address, label: Address, widget: string, required: false }
      - { name: photo, label: Photo, widget: image }
      - { name: description, label: Short description, widget: text }

  - name: hotels
    label: Hotels
    label_singular: Hotel
    folder: content/hotels
    create: true
    slug: "{{slug}}"
    summary: "{{name}}"
    fields:
      - { name: name, label: Name, widget: string }
      - { name: slug, label: Slug, widget: string }
      - { name: city, label: City, widget: relation, collection: cities, search_fields: [name], value_field: slug, display_fields: [name] }
      - { name: rating, label: Star rating, widget: number, value_type: int, min: 1, max: 5 }
      - { name: priceRange, label: Price range, widget: select, options: ["$", "$$", "$$$", "$$$$"] }
      - { name: lat, label: Latitude, widget: number, value_type: float }
      - { name: lng, label: Longitude, widget: number, value_type: float }
      - { name: address, label: Address, widget: string, required: false }
      - { name: photo, label: Photo, widget: image }
      - { name: description, label: Short description, widget: text }

  # ------------------------------------------------------------------ Media
  - name: videos
    label: Videos
    label_singular: Video
    folder: content/videos
    create: true
    slug: "{{slug}}"
    summary: "{{title}}"
    fields:
      - { name: title, label: Title, widget: string }
      - { name: id, label: Slug / id, widget: string, hint: "Lowercase, dashed. Used as the queue and URL key." }
      - { name: platform, label: Platform, widget: select, options: [youtube, instagram, tiktok, vimeo] }
      - { name: videoId, label: Video ID or URL, widget: string, hint: "YouTube video id, Instagram reel shortcode, or TikTok id." }
      - { name: thumbnail, label: Thumbnail, widget: image }
      - {
          name: categories,
          label: Categories,
          widget: select,
          multiple: true,
          options: [destinations, food, hotels, drone, behind-the-scenes, shorts],
        }
      - { name: destination, label: Related destination, widget: relation, collection: countries, search_fields: [name], value_field: slug, display_fields: [name], required: false }
      - { name: orientation, label: Aspect ratio, widget: select, options: [horizontal, vertical] }
      - { name: duration, label: Duration, widget: string, required: false, hint: "e.g. 12:04" }
      - { name: description, label: Description, widget: text, required: false }
      - { name: uploadDate, label: Upload date, widget: datetime, format: "YYYY-MM-DD" }
      - { name: featured, label: Feature on the video hub, widget: boolean, default: false }

  # -------------------------------------------------------------- Portfolio
  - name: campaigns
    label: Campaigns
    label_singular: Campaign
    folder: content/campaigns
    create: true
    identifier_field: slug
    slug: "{{slug}}"
    summary: "{{brand}} — {{title}}"
    preview_path: portfolio/{{slug}}
    fields:
      - { name: brand, label: Brand name, widget: string }
      - { name: title, label: Campaign title, widget: string }
      - { name: slug, label: Slug, widget: string }
      - {
          name: type,
          label: Campaign type,
          widget: select,
          options: ["Hotel Campaign", "Food Campaign", "Destination Campaign", "Drone / Cinematic"],
        }
      - { name: year, label: Year, widget: string }
      - { name: location, label: Location, widget: string }
      - { name: heroImage, label: Hero image, widget: image }
      - { name: excerpt, label: One-line summary, widget: text }
      - { name: deliverables, label: Deliverables, widget: list }
      - {
          name: metrics,
          label: Metrics,
          widget: list,
          fields:
            [
              { name: label, label: Label, widget: string, hint: "e.g. Total reach, Engagement rate" },
              { name: value, label: Value, widget: string, hint: "e.g. 4.9M" },
            ],
        }
      - {
          name: video,
          label: Campaign video,
          widget: object,
          required: false,
          fields:
            [
              { name: youtubeId, label: YouTube ID, widget: string },
              { name: title, label: Video title, widget: string },
              { name: thumbnail, label: Thumbnail, widget: image },
            ],
        }
      - {
          name: testimonial,
          label: Testimonial,
          widget: object,
          fields:
            [
              { name: quote, label: Quote, widget: text },
              { name: name, label: Author name, widget: string },
              { name: title, label: Author title, widget: string },
              { name: organization, label: Organization, widget: string },
              { name: avatar, label: Author photo, widget: image, required: false },
            ],
        }
      - {
          name: gallery,
          label: Gallery,
          widget: list,
          required: false,
          fields:
            [
              { name: src, label: Image, widget: image },
              { name: alt, label: Alt text, widget: string, hint: "Describe the image for screen readers." },
              { name: caption, label: Caption, widget: string, required: false },
            ],
        }
      - { name: publishedAt, label: Published date, widget: datetime, format: "YYYY-MM-DD", required: false }

  # --------------------------------------------------------------- Settings
  - name: settings
    label: Settings
    files:
      - name: media_kit
        label: Media kit stats
        file: content/settings/media-kit.json
        description: "Feeds the /media-kit page and the downloadable PDF."
        fields:
          - {
              name: headlineMetrics,
              label: Headline metrics,
              widget: list,
              fields: [{ name: value, label: Value, widget: string }, { name: label, label: Label, widget: string }],
            }
          - {
              name: platforms,
              label: Platform follower counts,
              widget: list,
              fields:
                [
                  { name: platform, label: Platform, widget: select, options: [instagram, youtube, tiktok, newsletter] },
                  { name: label, label: Label, widget: string },
                  { name: handle, label: Handle, widget: string },
                  { name: url, label: URL, widget: string },
                  { name: followers, label: Followers, widget: string },
                  { name: detail, label: Detail, widget: string },
                ],
            }
          - {
              name: audienceAge,
              label: Audience age,
              widget: list,
              fields: [{ name: label, label: Bracket, widget: string }, { name: value, label: Percent, widget: number, value_type: int }],
            }
          - {
              name: audienceGender,
              label: Audience gender,
              widget: list,
              fields: [{ name: label, label: Label, widget: string }, { name: value, label: Percent, widget: number, value_type: int }],
            }
          - {
              name: audienceCountries,
              label: Audience countries,
              widget: list,
              fields: [{ name: label, label: Country, widget: string }, { name: value, label: Percent, widget: number, value_type: int }],
            }
          - {
              name: contentPillars,
              label: Content pillars,
              widget: list,
              fields: [{ name: label, label: Pillar, widget: string }, { name: value, label: Percent, widget: number, value_type: int }],
            }
          - { name: countriesReached, label: Countries reached, widget: list }

      - name: site
        label: Site settings
        file: content/settings/site.json
        fields:
          - { name: siteTitle, label: Site title, widget: string }
          - { name: defaultSeoDescription, label: Default SEO description, widget: text, hint: "Under 160 characters." }
          - { name: contactEmail, label: Contact email, widget: string }
          - {
              name: social,
              label: Social links,
              widget: list,
              fields: [{ name: label, label: Label, widget: string }, { name: url, label: URL, widget: string }],
            }
          - {
              name: navigation,
              label: Navigation labels,
              widget: list,
              fields: [{ name: label, label: Label, widget: string }, { name: to, label: Path, widget: string }],
            }
