name: Daily Entry
extends@: default

form:
  fields:
    tabs:
      type: tabs
      active: 1
      fields:
        content:
          type: tab
          title: Entry

          fields:
            header.title:
              type: text
              label: Title
              validate:
                required: true

            header.date:
              type: datetime
              label: Date
              format: 'Y-m-d H:i'
              validate:
                required: true

            content:
              type: markdown
              label: Content
              validate:
                required: true

            header.hero_image:
              type: text
              label: 'Hero Image Filename'
              help: 'Filename of the main photo for this entry (e.g. photo.jpg). Upload photos via the Media tab.'

        location:
          type: tab
          title: Location

          fields:
            header.location_city:
              type: text
              label: City
              placeholder: 'e.g. Kyoto'

            header.location_country:
              type: text
              label: Country
              placeholder: 'e.g. Japan'

            header.lat:
              type: number
              label: Latitude
              help: 'GPS latitude (for map)'
              placeholder: '48.8566'
              step: any

            header.lng:
              type: number
              label: Longitude
              help: 'GPS longitude (for map)'
              placeholder: '2.3522'
              step: any

        weather:
          type: tab
          title: Weather

          fields:
            header.weather_temp_c:
              type: number
              label: 'Temperature (°C)'
              help: 'Auto-filled from post form. Edit if needed.'
              step: 1

            header.weather_desc:
              type: select
              label: 'Weather Condition'
              options:
                Sunny: '☀️ Sunny'
                'Partly cloudy': '⛅ Partly cloudy'
                Cloudy: '☁️ Cloudy'
                Foggy: '🌫️ Foggy'
                Drizzle: '🌦️ Drizzle'
                Rain: '🌧️ Rain'
                Snow: '❄️ Snow'
                Thunderstorm: '⛈️ Thunderstorm'

        publishing:
          type: tab
          title: Publishing

          fields:
            header.published:
              type: toggle
              label: Published
              highlight: 1
              default: 1
              options:
                1: 'Yes'
                0: 'No'
              validate:
                type: bool

            header.publish_date:
              type: datetime
              label: 'Publish Date'
              help: 'Schedule future publication (leave blank to publish immediately)'
              format: 'Y-m-d H:i'

            header.unpublish_date:
              type: datetime
              label: 'Unpublish Date'
              help: 'Automatically unpublish at this date/time'
              format: 'Y-m-d H:i'
