<?php

// Load library
require_once ( get_parent_theme_file_path() . '/inc/kirki/kirki.php' );

// Update paths
if ( ! function_exists( 'motivate_theme_kirki_update_url' ) ) {
    function motivate_theme_kirki_update_url( $config ) {
        $config['url_path'] = get_template_directory_uri() . '/inc/kirki/';
        return $config;
    }
}
add_filter( 'kirki/config', 'motivate_theme_kirki_update_url', 999 );

// Translating Kirki strings
add_filter( 'kirki/my_config/l10n', function( $l10n ) {

  $l10n['background-color']      = esc_attr__( 'Background Color', 'motivate' );
  $l10n['background-image']      = esc_attr__( 'Background Image', 'motivate' );
  $l10n['no-repeat']             = esc_attr__( 'No Repeat', 'motivate' );
  $l10n['repeat-all']            = esc_attr__( 'Repeat All', 'motivate' );
  $l10n['repeat-x']              = esc_attr__( 'Repeat Horizontally', 'motivate' );
  $l10n['repeat-y']              = esc_attr__( 'Repeat Vertically', 'motivate' );
  $l10n['inherit']               = esc_attr__( 'Inherit', 'motivate' );
  $l10n['background-repeat']     = esc_attr__( 'Background Repeat', 'motivate' );
  $l10n['cover']                 = esc_attr__( 'Cover', 'motivate' );
  $l10n['contain']               = esc_attr__( 'Contain', 'motivate' );
  $l10n['background-size']       = esc_attr__( 'Background Size', 'motivate' );
  $l10n['fixed']                 = esc_attr__( 'Fixed', 'motivate' );
  $l10n['scroll']                = esc_attr__( 'Scroll', 'motivate' );
  $l10n['background-attachment'] = esc_attr__( 'Background Attachment', 'motivate' );
  $l10n['left-top']              = esc_attr__( 'Left Top', 'motivate' );
  $l10n['left-center']           = esc_attr__( 'Left Center', 'motivate' );
  $l10n['left-bottom']           = esc_attr__( 'Left Bottom', 'motivate' );
  $l10n['right-top']             = esc_attr__( 'Right Top', 'motivate' );
  $l10n['right-center']          = esc_attr__( 'Right Center', 'motivate' );
  $l10n['right-bottom']          = esc_attr__( 'Right Bottom', 'motivate' );
  $l10n['center-top']            = esc_attr__( 'Center Top', 'motivate' );
  $l10n['center-center']         = esc_attr__( 'Center Center', 'motivate' );
  $l10n['center-bottom']         = esc_attr__( 'Center Bottom', 'motivate' );
  $l10n['background-position']   = esc_attr__( 'Background Position', 'motivate' );
  $l10n['background-opacity']    = esc_attr__( 'Background Opacity', 'motivate' );
  $l10n['on']                    = esc_attr__( 'ON', 'motivate' );
  $l10n['off']                   = esc_attr__( 'OFF', 'motivate' );
  $l10n['all']                   = esc_attr__( 'All', 'motivate' );
  $l10n['cyrillic']              = esc_attr__( 'Cyrillic', 'motivate' );
  $l10n['cyrillic-ext']          = esc_attr__( 'Cyrillic Extended', 'motivate' );
  $l10n['devanagari']            = esc_attr__( 'Devanagari', 'motivate' );
  $l10n['greek']                 = esc_attr__( 'Greek', 'motivate' );
  $l10n['greek-ext']             = esc_attr__( 'Greek Extended', 'motivate' );
  $l10n['khmer']                 = esc_attr__( 'Khmer', 'motivate' );
  $l10n['latin']                 = esc_attr__( 'Latin', 'motivate' );
  $l10n['latin-ext']             = esc_attr__( 'Latin Extended', 'motivate' );
  $l10n['vietnamese']            = esc_attr__( 'Vietnamese', 'motivate' );
  $l10n['hebrew']                = esc_attr__( 'Hebrew', 'motivate' );
  $l10n['arabic']                = esc_attr__( 'Arabic', 'motivate' );
  $l10n['bengali']               = esc_attr__( 'Bengali', 'motivate' );
  $l10n['gujarati']              = esc_attr__( 'Gujarati', 'motivate' );
  $l10n['tamil']                 = esc_attr__( 'Tamil', 'motivate' );
  $l10n['telugu']                = esc_attr__( 'Telugu', 'motivate' );
  $l10n['thai']                  = esc_attr__( 'Thai', 'motivate' );
  $l10n['serif']                 = _x( 'Serif', 'font style', 'motivate' );
  $l10n['sans-serif']            = _x( 'Sans Serif', 'font style', 'motivate' );
  $l10n['monospace']             = _x( 'Monospace', 'font style', 'motivate' );
  $l10n['font-family']           = esc_attr__( 'Font Family', 'motivate' );
  $l10n['font-size']             = esc_attr__( 'Font Size', 'motivate' );
  $l10n['font-weight']           = esc_attr__( 'Font Weight', 'motivate' );
  $l10n['line-height']           = esc_attr__( 'Line Height', 'motivate' );
  $l10n['font-style']            = esc_attr__( 'Font Style', 'motivate' );
  $l10n['letter-spacing']        = esc_attr__( 'Letter Spacing', 'motivate' );
  $l10n['top']                   = esc_attr__( 'Top', 'motivate' );
  $l10n['bottom']                = esc_attr__( 'Bottom', 'motivate' );
  $l10n['left']                  = esc_attr__( 'Left', 'motivate' );
  $l10n['right']                 = esc_attr__( 'Right', 'motivate' );
  $l10n['color']                 = esc_attr__( 'Color', 'motivate' );
  $l10n['add-image']             = esc_attr__( 'Add Image', 'motivate' );
  $l10n['change-image']          = esc_attr__( 'Change Image', 'motivate' );
  $l10n['remove']                = esc_attr__( 'Remove', 'motivate' );
  $l10n['no-image-selected']     = esc_attr__( 'No Image Selected', 'motivate' );
  $l10n['select-font-family']    = esc_attr__( 'Select a font-family', 'motivate' );
  $l10n['variant']               = esc_attr__( 'Variant', 'motivate' );
  $l10n['subsets']               = esc_attr__( 'Subset', 'motivate' );
  $l10n['size']                  = esc_attr__( 'Size', 'motivate' );
  $l10n['height']                = esc_attr__( 'Height', 'motivate' );
  $l10n['spacing']               = esc_attr__( 'Spacing', 'motivate' );
  $l10n['ultra-light']           = esc_attr__( 'Ultra-Light 100', 'motivate' );
  $l10n['ultra-light-italic']    = esc_attr__( 'Ultra-Light 100 Italic', 'motivate' );
  $l10n['light']                 = esc_attr__( 'Light 200', 'motivate' );
  $l10n['light-italic']          = esc_attr__( 'Light 200 Italic', 'motivate' );
  $l10n['book']                  = esc_attr__( 'Book 300', 'motivate' );
  $l10n['book-italic']           = esc_attr__( 'Book 300 Italic', 'motivate' );
  $l10n['regular']               = esc_attr__( 'Normal 400', 'motivate' );
  $l10n['italic']                = esc_attr__( 'Normal 400 Italic', 'motivate' );
  $l10n['medium']                = esc_attr__( 'Medium 500', 'motivate' );
  $l10n['medium-italic']         = esc_attr__( 'Medium 500 Italic', 'motivate' );
  $l10n['semi-bold']             = esc_attr__( 'Semi-Bold 600', 'motivate' );
  $l10n['semi-bold-italic']      = esc_attr__( 'Semi-Bold 600 Italic', 'motivate' );
  $l10n['bold']                  = esc_attr__( 'Bold 700', 'motivate' );
  $l10n['bold-italic']           = esc_attr__( 'Bold 700 Italic', 'motivate' );
  $l10n['extra-bold']            = esc_attr__( 'Extra-Bold 800', 'motivate' );
  $l10n['extra-bold-italic']     = esc_attr__( 'Extra-Bold 800 Italic', 'motivate' );
  $l10n['ultra-bold']            = esc_attr__( 'Ultra-Bold 900', 'motivate' );
  $l10n['ultra-bold-italic']     = esc_attr__( 'Ultra-Bold 900 Italic', 'motivate' );
  $l10n['invalid-value']         = esc_attr__( 'Invalid Value', 'motivate' );

  return $l10n;

} );

// Load of font variants
if ( class_exists( 'Kirki_Fonts_Google' ) ) {
    Kirki_Fonts_Google::$force_load_all_variants = true;
}

// Style library
function motivate_theme_kirki_styling( $config ) {
  return wp_parse_args( array(
    'disable_loader'   => true,
  ), $config );
}
add_filter( 'kirki/config', 'motivate_theme_kirki_styling' );

if ( class_exists( 'Kirki' ) ) {

  /**
  * inheritable configuration
  */
  Kirki::add_config( 'at_theme', array(
    'capability'    => 'edit_theme_options',
    'option_type'   => 'theme_mod',
  ) );

  /** 
  * Panel: Theme
  */
  Kirki::add_panel( 'at_panel__main', array(
      'priority'    => 10,
      'title'       => esc_attr__( 'Theme', 'motivate' ),
      'description' => esc_attr__( 'Customize your theme here', 'motivate' ),
  ) );


  /** 
  * Section: Styling
  */
  Kirki::add_section( 'at_sec__styling', array(
    'title'         => esc_attr__( 'Styling', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__colormain',
    'label'       => esc_html__( 'Main Color', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '#66B7AF',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'choices'     => array(
      'alpha' => false,
    ),
    'output'      => array(
      array(
        'element'  => '.site-header, .at-about .at-about__blockbutton, .at-post .at-post__readmore:hover, .at-ctalist__blockbutton, .at-bloglist .at-blog__blockbutton , .at-lead .mc4wp-form input[type="submit"], .at-post.sticky .at-blog__post, .at-socialfooter, .at-optin, .at-ctalist2, .at-ctalist .at-ctalist__block .at-ctalist__content h4, .at-relatedposts .at-relatedposts__post, .at-commentform__submit input[type="submit"]',
        'property' => 'background',
      ),
      array(
        'element'  => '.at-testimonial .at-testimonial__content::before, .at-post .at-post__readmore, .at-top-footer .site-footer-widgets a:hover, .site-footer-widgets .at-socialwidget svg:hover, .at-testimonial2 .at-testimonial2__content::before, .at-post .at-post__title, .at-post .at-post__title a, .at-bloglist .at-bloglist__post .at-bloglist__posttitle, .at-bloglist .at-bloglist__post .at-bloglist__posttitle a, .at-postnav .at-postnav__links a, .posts-navigation .nav-previous a, .posts-navigation .nav-next a, .at-content-small .at-blog__post .at-blog__posttitle, .at-content-style2 .at-blog__post .at-blog__posttitle a',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-hero .at-hero__content, .at-post .at-post__readmore, .at-lead .mc4wp-form input[type="submit"], .at-postnav .at-postnav__links a, .posts-navigation .nav-previous a, .posts-navigation .nav-next a, .at-commentform__submit input[type="submit"]',
        'property' => 'border-color',
      ),
      array(
        'element'  => '.site-footer-widgets .at-socialwidget svg:hover path',
        'property' => 'fill',
      ),

    ),
    'js_vars'     => array(
      array(
        'element'  => '.site-header, .at-about .at-about__blockbutton, .at-post .at-post__readmore:hover, .at-ctalist__blockbutton, .at-bloglist .at-blog__blockbutton , .at-lead .mc4wp-form input[type="submit"], .at-post.sticky .at-blog__post, .at-socialfooter, .at-optin, .at-ctalist2, .at-ctalist .at-ctalist__block .at-ctalist__content h4, .at-relatedposts .at-relatedposts__post, .at-commentform__submit input[type="submit"]',
        'function' => 'style',
        'property' => 'background',
      ),
      array(
        'element'  => '.at-testimonial .at-testimonial__content::before, .at-post .at-post__readmore, .at-top-footer .site-footer-widgets a:hover, .site-footer-widgets .at-socialwidget svg:hover, .at-testimonial2 .at-testimonial2__content::before, .at-post .at-post__title, .at-post .at-post__title a, .at-bloglist .at-bloglist__post .at-bloglist__posttitle, .at-bloglist .at-bloglist__post .at-bloglist__posttitle a, .at-postnav .at-postnav__links a, .posts-navigation .nav-previous a, .posts-navigation .nav-next a, .at-content-small .at-blog__post .at-blog__posttitle, .at-content-style2 .at-blog__post .at-blog__posttitle a',
        'function' => 'style',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-hero .at-hero__content, .at-post .at-post__readmore, .at-lead .mc4wp-form input[type="submit"], .at-postnav .at-postnav__links a, .posts-navigation .nav-previous a, .posts-navigation .nav-next a, .at-commentform__submit input[type="submit"]',
        'function' => 'style',
        'property' => 'border-color',
      ),
      array(
        'element'  => '.site-footer-widgets .at-socialwidget svg:hover path',
        'function' => 'style',
        'property' => 'fill',
      ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__colorsecondary',
    'label'       => esc_html__( 'Secondary Color', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '#666099',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'choices'     => array(
      'alpha' => false,
    ),
    'output'      => array(
      array(
        'element'  => '.at-hero .at-hero__btn, .at-ctalist, .at-testimonial2,  .at-pageheader, .at-bloglist .at-bloglist-title, .at-featured, .widget .widget__title, .at-post.at-post--single, .at-commentform, .at-leadpage, .widget_calendar td, .site-header__nav > ul > li ul li a:hover, .at-testimonals, .mc4wp-form input[type="submit"], .at-ctalist2 .at-ctalist__block .at-ctalist__content h4, .at-ctalist2 .at-ctalist__blockbutton, .at-lead',
        'property' => 'background',
      ),
      array(
        'element'  => 'at-post.at-post.at-post--mini, .at-post.at-post--mini .at-post__contentwrap, .at-post.at-post--mini .at-post__contentwrap .at-post__metaf, .at-post.at-post--square, .at-post.at-post--mini, .widget, .at-testimonial .at-testimonial2-img, .at-bloglist .at-bloglist__post, .tagcloud a, .at-post__tags a, .mc4wp-form input[type="submit"]',
        'property' => 'border-color',
      ),
      array(
        'element'  => '.tagcloud a, .at-post__tags a, .at-post .at-post__meta, .at-post .at-post__meta a, .at-bloglist .at-post__meta, .at-post--square .at-socialshare a, .at-post--mini .at-socialshare a, .at-bloglist__post .at-socialshare a, .at-content-style2 .sticky .at-blog__post .at-blog__posttitle a, .at-post.sticky .at-post__title a',
        'property' => 'color',
      ),

      array(
        'element'  => '.at-post--square .at-socialshare a svg path, .at-post--mini .at-socialshare a svg path, .at-bloglist__post .at-socialshare a svg path',
        'property' => 'fill',
      ),
      
    ),
    'js_vars'     => array(
      array(
        'element'  => '.at-hero .at-hero__btn, .at-ctalist, .at-testimonial2,  .at-pageheader, .at-bloglist .at-bloglist-title, .at-featured, .widget .widget__title, .at-post.at-post--single, .at-commentform, .at-leadpage, .widget_calendar td, .site-header__nav > ul > li ul li a:hover, .at-testimonals, .mc4wp-form input[type="submit"], .at-ctalist2 .at-ctalist__block .at-ctalist__content h4, .at-ctalist2 .at-ctalist__blockbutton, .at-lead',
        'function' => 'style',
        'property' => 'background',
      ),
      array(
        'element'  => '.at-post.at-post--mini .at-post__contentwrap, .at-post.at-post--square, .at-post.at-post--mini .at-post__contentwrap .at-post__metaf, .at-post.at-post--mini, .widget, .at-testimonial .at-testimonial2-img, .at-bloglist .at-bloglist__post, .tagcloud a, .at-post__tags a, .mc4wp-form input[type="submit"]',
        'function' => 'style',
        'property' => 'border-color',
      ),
      array(
        'element'  => '.tagcloud a, .at-post__tags a, .at-post .at-post__meta, .at-post .at-post__meta a, .at-bloglist .at-post__meta, .at-post--square .at-socialshare a, .at-post--mini .at-socialshare a, .at-bloglist__post .at-socialshare a, .at-content-style2 .sticky .at-blog__post .at-blog__posttitle a, .at-post.sticky .at-post__title a',
        'function' => 'style',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-post--square .at-socialshare a svg path, .at-post--mini .at-socialshare a svg path, .at-bloglist__post .at-socialshare a svg path',
        'function' => 'style',
        'property' => 'fill',
      ),
    ),
  ) );



  // Setting: Link Color
  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__linkcolor',
    'label'       => esc_attr__( 'Link Color', 'motivate' ),
    'description' => esc_attr__( 'Set the link color.', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '#66B7AF',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => 'a',
        'property' => 'color',
      ),
    ),
    'js_vars'     => array(
      array(
        'element'  => 'a',
        'function' => 'style',
        'property' => 'color',
      ),
    ),
  ) );

  // Setting: Link Color:Hover
  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__linkcolorhover',
    'label'       => esc_attr__( 'Link Color:hover', 'motivate' ),
    'description' => esc_attr__( 'Set the link on hover color', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '#52938D',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => 'a:hover',
        'property' => 'color',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => 'a:hover',
        'function' => 'style',
        'property' => 'color',
      ),
    ),
  ) );


  // Setting: Site Width
  Kirki::add_field( 'at_theme', array(
      'type'        => 'slider',
      'settings'    => 'at_setting__sitewidth',
      'label'       => esc_html__( 'Site Width', 'motivate' ),
      'description' => esc_html__( 'Modify the width of your site', 'motivate' ),
      'section'     => 'at_sec__styling',
      'default'     => '1100',
      'priority'    => 10,
      'choices'     => array(
          'min'  => 980,
          'max'  => 1400,
          'step' => 10
      ),
      'transport'   => 'postMessage',
      'js_vars'     => array(
        array(
        'element'  => '.at-container, .nav-header__menuwrapper',
        'function' => 'css',
        'property' => 'max-width',
        'units' => 'px',
      ),
      array(
        'element'  => '.at-sitecontainer--boxed',
        'function' => 'css',
        'property' => 'max-width',
        'units' => 'px',
      ),
    ),
    'output'      => array(
      array(
        'element'  => '.at-container, .nav-header__menuwrapper',
        'property' => 'max-width',
        'units' => 'px',
      ),
      array(
        'element'  => '.at-sitecontainer--boxed',
        'property' => 'max-width',
        'units' => 'px',
      ),
    ),
  ) );




  // Setting: Site Layout
  Kirki::add_field( 'at_theme', array(
    'type'        => 'radio-image',
    'settings'    => 'at_setting__sitelayout',
    'label'       => esc_attr__( 'Theme Layout', 'motivate' ),
    'description' => esc_attr__( 'Select the layout for the theme. Boxed or Wide.', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => 'wide',
    'priority'    => 10,
    'choices'     => array(
      'boxed'   => get_template_directory_uri() . '/img/admin/layout-boxed.png',
      'wide' => get_template_directory_uri() . '/img/admin/layout-wide.png',
    ),
  ) );

  // Setting: Boxed Box Shadow
  Kirki::add_field( 'at_theme', array(
      'type'        => 'slider',
      'settings'    => 'at_setting__siteboxshadow',
      'label'       => esc_attr__( 'Website Shadow', 'motivate' ),
      'section'     => 'at_sec__styling',
      'default'     => '1',
      'priority'    => 10,
      'choices'     => array(
          'min'  => 0,
          'max'  => 5,
          'step' => 1
      ),
      'required'  => array(
        array(
            'setting'  => 'at_setting__sitelayout',
            'operator' => '==',
            'value'    => 'boxed',
        ),
      ),
      'output'    => array (
        'element' => '.at-sitecontainer--boxed',
        'property' => 'box-shadow',
        'units' => '',
        'value_pattern' => '0 0 80px rgba(0,0,0,0.$)'
      )
  ) );

  // Setting Background Type Switcher
  Kirki::add_field( 'at_theme', array(
    'type'        => 'radio-buttonset',
    'settings'    => 'at_setting__sitebg',
    'label'       => esc_attr__( 'Background Type', 'motivate' ),
    'description' => esc_attr__( 'Select the background type', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => 'color',
    'priority'    => 10,
    'choices'     => array(
      'color'   => esc_attr__( 'Solid Color', 'motivate' ),
      'image' => esc_attr__( 'Image', 'motivate' ),
    ),
    'required'  => array(
          array(
              'setting'  => 'at_setting__sitelayout',
              'operator' => '==',
              'value'    => 'boxed',
          ),
        ),
  ) );

  // Setting: BG color
  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__sitebgcolor',
    'label'       => esc_attr__( 'Background Color', 'motivate' ),
    'description' => esc_attr__( 'Set background color', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '#e8eaeb',
    'priority'    => 10,
    'required'  => array(
            array(
                    'setting'  => 'at_setting__sitelayout',
                    'operator' => '==',
                    'value'    => 'boxed',
                ),
                array(
                    'setting'  => 'at_setting__sitebg',
                    'operator' => '==',
                    'value'    => 'color',
                ),
        ),
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => 'body',
        'property' => 'background-color',
      ),
    ),
    'js_vars'     => array(
      array(
        'element'  => 'body',
        'function' => 'css',
        'property' => 'background-color',
      ),
    ),
  ) );


  // Setting: BG Image
  Kirki::add_field( 'at_theme', array(
    'type'        => 'background',
      'settings'    => 'at_setting__sitebgimg',
      'label'     => esc_attr__( 'Background Image', 'motivate' ),
      'description'   => esc_attr__( 'Upload a background image', 'motivate' ),
      'section'     => 'at_sec__styling',
      'default'     => array(

            'image'    => '',
            'repeat'   => 'no-repeat',
            'size'     => 'cover',
            'attach'   => 'fixed',
            'position' => 'left-top',
            'opacity'  => 100
        ),
      'priority'    => 10,
      'required'  => array(
        array(
              'setting'  => 'at_setting__sitelayout',
              'operator' => '==',
              'value'    => 'boxed',
          ),
        array(
              'setting'  => 'at_setting__sitebg',
              'operator' => '==',
              'value'    => 'image',
        ),
      ),
      'output'    => array(
        array(
        'element'  => 'body',
        )
      ),
      
  ) );

    // Display Page Title
    Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__pagetitle',
    'label'       => esc_html__( 'Display Page Title', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );


  /** 
  * Section: Blog Post Options
  */
  Kirki::add_section( 'at_sec__post', array(
    'title'         => esc_attr__( 'Blog Options', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'settings'    => 'at_setting__blogsidebar',
    'section'     => 'at_sec__post',
    'type'        => 'radio-image',
    'label'       => esc_attr__( 'Blog Sidebar Position', 'motivate' ),
    'description' => esc_attr__( 'Select the sidebar position for the blog', 'motivate' ),
    'default'     => 'right',
    'priority'    => 10,
    'choices'     => array(
      'off'   => get_template_directory_uri() . '/img/admin/sidebar-off.png',
      'left' => get_template_directory_uri() . '/img/admin/sidebar-left.png',
      'right'  => get_template_directory_uri() . '/img/admin/sidebar-right.png',
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'settings'    => 'at_setting__bloglayout',
    'section'     => 'at_sec__post',
    'type'        => 'radio-buttonset',
    'label'       => esc_attr__( 'Blog Layout', 'motivate' ),
    'description' => esc_attr__( 'Select how you want your posts to look in the blog', 'motivate' ),
    'default'     => 'style2',
    'priority'    => 10,
    'choices'     => array(
      'style1'   => 'Style 1',
      'style2' => 'Style 2',
      'style3'  => 'Style 3',
      'style4'  => 'Style 4',
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__postsshare',
    'label'       => esc_html__( 'Social Share in Post', 'motivate' ),
    'description' => esc_attr__( 'Show sharing button in blog posts', 'motivate' ),
    'section'     => 'at_sec__post',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__postsshare_archive',
    'label'       => esc_html__( 'Social Share in Archive', 'motivate' ),
    'description' => esc_attr__( 'Show sharing button in the archive', 'motivate' ),
    'section'     => 'at_sec__post',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__postnav',
    'label'       => esc_html__( 'Posts Nav', 'motivate' ),
    'section'     => 'at_sec__post',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__postrelated',
    'label'       => esc_html__( 'Related Posts', 'motivate' ),
    'section'     => 'at_sec__post',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__postsb',
    'label'       => esc_html__( 'Two Sidebars', 'motivate' ),
    'description' => esc_attr__( 'Different sidebar in the blog archive and in the single post', 'motivate' ),
    'section'     => 'at_sec__post',
    'default'     => '0',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );




  /** 
  * Section: Nav
  */
  Kirki::add_section( 'at_sec__header', array(
    'title'         => esc_attr__( 'Header', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );


Kirki::add_field( 'at_theme', array(
      'type'        => 'slider',
      'settings'    => 'at_setting__logosize',
      'label'       => esc_attr__( 'Logo Size', 'motivate' ),
      'section'     => 'at_sec__header',
      'default'     => '35',
      'priority'    => 10,
      'choices'     => array(
          'min'  => 30,
          'max'  => 80,
          'step' => 5
      ),
      'output'    => array (
        'element' => '.site-header .site-header__logowrap img',
        'property' => 'height',
        'units' => 'px',
        'value_pattern' => '$'
      )
  ) );

      Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_headercolor',
    'label'       => esc_attr__( 'Header Background Color', 'motivate' ),
    'section'     => 'at_sec__header',
    'default'     => '',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.site-header, .site-header__nav > ul > li ul li',
        'property' => 'background',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.site-header, .site-header__nav > ul > li ul li',
        'function' => 'style',
        'property' => 'background',
      ),
    ),

  ) );


    Kirki::add_field( 'at_theme', array(
    'type'        => 'typography',
    'settings'    => 'at_typography_menunav',
    'label'       => esc_attr__( 'Main Navigation Typography', 'motivate' ),
    'description' => esc_attr__( 'Set the main navigation typography here', 'motivate' ),
    'section'     => 'at_sec__header',
    'default'     => array(
      'font-family'    => 'Playfair Display',
      'variant'        => '700',
      'font-size'      => '18px',
      'line-height'    => '1',
      'letter-spacing' => '0',
      'text-transform' => 'none',

    ),
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output' => array(
      array(
        'element' => '.site-header__nav ul li a, .site-header__nav > ul > li ul li a',
      ),
    ),
    'js_vars'     => array(
    array(
      'element'  => '.site-header__nav ul li a, .site-header__nav > ul > li ul li a',
    ),
  ),
  ) );

    Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_color_nav',
    'label'       => esc_attr__( 'Main Navigation Color', 'motivate' ),
    'section'     => 'at_sec__header',
    'default'     => '',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.site-header__nav .nav-header__mtoggle span, .site-header__nav .nav-header__mtoggle span::before, .site-header__nav .nav-header__mtoggle span::after',
        'property' => 'background',
      ),
      array(
        'element'  => '.site-header__nav ul li a, .site-header__nav > ul > li ul li a, .site-header__nav > ul > li.menu-item-has-children > a::after',
        'property' => 'color',
      ),
      
      array(
        'element'  => '.site-header__nav > ul > li.menu-item-has-children > a::after',
        'property' => 'border-top-color',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.site-header__nav .nav-header__mtoggle span, .site-header__nav .nav-header__mtoggle span::before, .site-header__nav .nav-header__mtoggle span::after',
        'function' => 'style',
        'property' => 'background',
      ),
      array(
        'element'  => '.site-header__nav ul li a, .site-header__nav > ul > li ul li a, .site-header__nav > ul > li.menu-item-has-children > a::after',
        'function' => 'style',
        'property' => 'color',
      ),
      array(
        'element'  => '.site-header__nav > ul > li.menu-item-has-children > a::after',
        'function' => 'style',
        'property' => 'border-top-color',
      ),
    ),

  ) );

    // Sticky Nav
    Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__stickynav',
    'label'       => esc_html__( 'Sticky Navigation', 'motivate' ),
    'section'     => 'at_sec__styling',
    'default'     => '0',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );


  /** 
  * Panel: Homepage
  */
  Kirki::add_panel( 'at_panel__homepage', array(
      'priority'    => 10,
      'title'       => esc_attr__( 'Homepage', 'motivate' ),
      'description' => esc_attr__( 'Customize your homepage here', 'motivate' ),
  ) );

  

   /** 
  * Section: Homepage - HP Order
  */
  Kirki::add_section( 'at_sec__hporder', array(
    'title'         => esc_attr__( 'Homepage Order', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'sortable',
  'settings'    => 'at_setting__hporder',
  'label'       => esc_html__( 'This is the label', 'motivate' ),
  'section'     => 'at_sec__hporder',
  'default'     => array(
    'content',
    'optin',
    'about',
    'ctablocks',
    'ctablocks2',
    'ctablocks3',
    'textblock',
    'praise',
    'blog',
    'featuredin' 
  ),
  'choices'     => array(
    'content' => esc_attr__( 'Content with Builder', 'motivate' ),
    'optin' => esc_attr__( 'Opt-In', 'motivate' ),
    'about' => esc_attr__( 'About', 'motivate' ),
    'ctablocks' => esc_attr__( 'CTA Block', 'motivate' ),
    'ctablocks2' => esc_attr__( 'CTA Block 2', 'motivate' ),
    'ctablocks3' => esc_attr__( 'CTA Block 3', 'motivate' ),
    'textblock' => esc_attr__( 'Text Block', 'motivate' ),
    'praise' => esc_attr__( 'Praise', 'motivate' ),
    'blog' => esc_attr__( 'Blog Posts', 'motivate' ),
    'featuredin' => esc_attr__( 'Featured In', 'motivate' ),
  ),
  'priority'    => 10,
  ) );

  /** 
  * Section: Homepage - Hero Section
  */
  Kirki::add_section( 'at_sec__hero', array(
    'title'         => esc_attr__( 'Homepage Hero', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  // Hero or Shortcode
  Kirki::add_field( 'at_theme', array(
    'type'        => 'radio-buttonset',
    'settings'    => 'at_setting__herotype',
    'label'       => esc_attr__( 'Hero Type', 'motivate' ),
    'description' => esc_attr__( 'Image or Slider', 'motivate' ),
    'section'     => 'at_sec__hero',
    'default'     => 'image',
    'priority'    => 10,
    'choices'     => array(
      'image'   => esc_attr__( 'Image', 'motivate' ),
      'slider' => esc_attr__( 'Slider', 'motivate' ),
    ),
    
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__heroslider',
  'label'    => esc_attr__( 'Hero Slider', 'motivate' ),
  'description' => esc_attr__( 'Insert Slider Shortcode', 'motivate' ),
  'section'  => 'at_sec__hero',
  'default'  => esc_attr__( '', 'motivate' ),
  'priority' => 10,
  'sanitize_callback' => 'wp_kses_post',
  'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'slider',
          ),
        ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'image',
  'settings'    => 'at_setting__heroimg',
  'label'       => esc_html__( 'Hero Image', 'motivate' ),
  'description' => esc_html__( 'This is the control description', 'motivate' ),
  'section'     => 'at_sec__hero',
  'default'     => get_template_directory_uri().'/img/default/hero.jpg',
  'priority'    => 10,
  'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__herotitle',
  'label'    => esc_html__( 'Hero Title', 'motivate' ),
  'section'  => 'at_sec__hero',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'typography',
    'settings'    => 'at_setting__herotitletypography',
    'label'       => esc_html__( 'Hero Title Typography', 'motivate' ),
    'section'     => 'at_sec__hero',
    'default'     => array(
      'font-family'    => 'Playfair Display',
      'variant'        => '700',
      'letter-spacing' => '0',
      'color'          => '#1a1a1a',
      'text-transform' => 'none',
      'font-size'      => '36px',
    ),
    'priority'    => 10,
    'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
    'transport'   => 'postMessage',
    'output' => array(
      array(
        'element' => '.at-hero .at-hero__title',
      ),
    ),
    'js_vars'     => array(
      array(
        'element'  => '.at-hero .at-hero__title',
      ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__herotitle2',
  'label'    => esc_html__( 'Hero Text', 'motivate' ),
  'section'  => 'at_sec__hero',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__herotitle2color',
    'label'       => esc_html__( 'Hero Text Color', 'motivate' ),
    'section'     => 'at_sec__hero',
    'default'     => '#424242',
    'priority'    => 10,
    'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
    'transport'   => 'postMessage',
    'choices'     => array(
      'alpha' => false,
    ),
    'output'      => array(
      array(
        'element'  => '.at-hero .at-hero__content .at-hero__text',
        'property' => 'color',
      ),
    ),
    'js_vars'     => array(
      array(
        'element'  => '.at-hero .at-hero__content .at-hero__text',
        'function' => 'style',
        'property' => 'color',
      ),
    ),
    ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__herobtntxt',
  'label'    => esc_html__( 'Hero Button Text', 'motivate' ),
  'section'  => 'at_sec__hero',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__herobtnlink',
  'label'    => esc_html__( 'Hero Button Link', 'motivate' ),
  'section'  => 'at_sec__hero',
  'default'  => esc_attr__( '#', 'motivate' ),
  'priority' => 10,
  'required'  => array(
          array(
              'setting'  => 'at_setting__herotype',
              'operator' => '==',
              'value'    => 'image',
          ),
        ),
  ) );



 /** 
  * Section: Homepage - About
  */
  Kirki::add_section( 'at_sec__hpabout', array(
    'title'         => esc_attr__( 'Homepage About Section', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'image',
  'settings'    => 'at_setting__aboutimg',
  'label'       => esc_html__( 'About Image', 'motivate' ),
  'description' => esc_html__( 'This is the control description', 'motivate' ),
  'section'     => 'at_sec__hpabout',
  'default'     => '',
  'priority'    => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__abouttitle',
  'label'    => esc_html__( 'About Title', 'motivate' ),
  'section'  => 'at_sec__hpabout',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  ) );


  Kirki::add_field( 'at_theme', array(
  'type'     => 'textarea',
  'settings' => 'at_setting__aboutcontent',
  'label'    => esc_html__( 'About Content', 'motivate' ),
  'section'  => 'at_sec__hpabout',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__aboutbutton',
  'label'    => esc_html__( 'Button Title', 'motivate' ),
  'section'  => 'at_sec__hpabout',
  'default'  => esc_attr__( 'More About Me', 'motivate' ),
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__abouturl',
  'label'    => esc_html__( 'Button URL', 'motivate' ),
  'section'  => 'at_sec__hpabout',
  'default'  => esc_attr__( '#', 'motivate' ),
  'priority' => 10,
  ) );



  /** 
  * Section: Homepage - HP Blocks
  */
  Kirki::add_section( 'at_sec__hpblocks', array(
    'title'         => esc_attr__( 'Homepage Blocks', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings'    => 'at_setting__hpblockstitle',
  'label'    => esc_html__( 'Block Title', 'motivate' ),
  'section'     => 'at_sec__hpblocks',
  'default'  => esc_attr__( 'YOUR NEW LIFE STARTS HERE!', 'motivate' ),
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'number',
  'settings'    => 'at_sec__hpblocks_nb',
  'label'       => esc_attr__( 'Number of blocks per row', 'motivate' ),
  'section'     => 'at_sec__hpblocks',
  'default'     => 3,
  'choices'     => array(
    'min'  => 1,
    'max'  => 4,
    'step' => 1,
  ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__hpblockszoom',
    'label'       => esc_html__( 'Zoom Hover Images', 'motivate' ),
    'section'     => 'at_sec__hpblocks',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'repeater',
  'label'       => esc_attr__( 'Homepage Block Control', 'motivate' ),
  'section'     => 'at_sec__hpblocks',
  'priority'    => 10,
  'row_label' => array(               
          'type' => 'text',
          'value' => esc_attr__('Block', 'motivate' ),
  ),
  'settings'    => 'at_setting__hpblocks',
  'default'     => array(
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block One', 'motivate' ),
      'link_url'  => '#',
    ),
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block Two', 'motivate' ),
      'link_url'  => '#',
    ),
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block Three', 'motivate' ),
      'link_url'  => '#',
    ),
  ),
  'fields' => array(
    'link_image' => array(
      'type'        => 'image',
      'label'       => esc_attr__( 'Block Image', 'motivate' ),
      'description' => esc_attr__( 'Block Image', 'motivate' ),
      'default'     => '',
    ),
    'link_text' => array(
      'type'        => 'text',
      'sanitize_callback' => 'wp_kses_post',
      'label'       => esc_attr__( 'Block Heading', 'motivate' ),
      'description' => esc_attr__( 'Block Heading', 'motivate' ),
      'default'     => '',
    ),
    'link_url' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Block URL', 'motivate' ),
      'description' => esc_attr__( 'Block URL', 'motivate' ),
      'default'     => '',
    ),
    'link_description' => array(
      'sanitize_callback' => 'wp_kses_post',
      'type'        => 'textarea',
      'label'       => esc_attr__( 'Block Text', 'motivate' ),
      'description' => esc_attr__( 'Block Text', 'motivate' ),
      'default'     => '',
    ),

    'link_button' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Block Button Text', 'motivate' ),
      'description' => esc_attr__( 'Block Button Text', 'motivate' ),
      'default'     => '',
    ),
  )
  ) );

/** 
  * Section: Homepage - HP Blocks
  */
  Kirki::add_section( 'at_sec__hpblocks2', array(
    'title'         => esc_attr__( 'Homepage Blocks 2', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );


  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings'    => 'at_setting__hpblockstitle2',
  'label'    => esc_html__( 'Block Title', 'motivate' ),
  'section'     => 'at_sec__hpblocks2',
  'default'  => esc_attr__( 'YOUR NEW LIFE STARTS HERE!', 'motivate' ),
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'number',
  'settings'    => 'at_sec__hpblocks2_nb',
  'label'       => esc_attr__( 'Number of blocks per row', 'motivate' ),
  'section'     => 'at_sec__hpblocks2',
  'default'     => 3,
  'choices'     => array(
    'min'  => 1,
    'max'  => 4,
    'step' => 1,
  ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'toggle',
    'settings'    => 'at_setting__hpblockszoom2',
    'label'       => esc_html__( 'Zoom Hover Images', 'motivate' ),
    'section'     => 'at_sec__hpblocks2',
    'default'     => '1',
    'priority'    => 10,
    'choices'     => array(
      'on'  => esc_attr__( 'Enable', 'motivate' ),
      'off' => esc_attr__( 'Disable', 'motivate' ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'repeater',
  'label'       => esc_attr__( 'Homepage Block Control', 'motivate' ),
  'section'     => 'at_sec__hpblocks2',
  'priority'    => 10,
  'row_label' => array(               
          'type' => 'text',
          'value' => esc_attr__('Block', 'motivate' ),
  ),
  'settings'    => 'at_setting__hpblocks2',
  'default'     => array(
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block One', 'motivate' ),
      'link_url'  => '#',
    ),
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block Two', 'motivate' ),
      'link_url'  => '#',
    ),
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block Three', 'motivate' ),
      'link_url'  => '#',
    ),
  ),
  'fields' => array(
    'link_image' => array(
      'type'        => 'image',
      'label'       => esc_attr__( 'Block Image', 'motivate' ),
      'description' => esc_attr__( 'Block Image', 'motivate' ),
      'default'     => '',
    ),
    'link_text' => array(
      'type'        => 'text',
      'sanitize_callback' => 'wp_kses_post',
      'label'       => esc_attr__( 'Block Heading', 'motivate' ),
      'description' => esc_attr__( 'Block Heading', 'motivate' ),
      'default'     => '',
    ),
    'link_url' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Block URL', 'motivate' ),
      'description' => esc_attr__( 'Block URL', 'motivate' ),
      'default'     => '',
    ),
    'link_description' => array(
      'sanitize_callback' => 'wp_kses_post',
      'type'        => 'textarea',
      'label'       => esc_attr__( 'Block Text', 'motivate' ),
      'description' => esc_attr__( 'Block Text', 'motivate' ),
      'default'     => '',
    ),

    'link_button' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Block Button Text', 'motivate' ),
      'description' => esc_attr__( 'Block Button Text', 'motivate' ),
      'default'     => '',
    ),
  )
  ) );



/** 
  * Section: Homepage - HP Blocks
  */
  Kirki::add_section( 'at_sec__hpblocks3', array(
    'title'         => esc_attr__( 'Homepage Blocks 3', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings'    => 'at_setting__hpblockstitle3',
  'label'    => esc_html__( 'Block Title', 'motivate' ),
  'section'     => 'at_sec__hpblocks3',
  'default'  => esc_attr__( 'Default Title', 'motivate' ),
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'number',
  'settings'    => 'at_sec__hpblocks3_nb',
  'label'       => esc_attr__( 'Number of blocks per row', 'motivate' ),
  'section'     => 'at_sec__hpblocks3',
  'default'     => 3,
  'choices'     => array(
    'min'  => 1,
    'max'  => 4,
    'step' => 1,
  ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'repeater',
  'label'       => esc_attr__( 'Homepage Block Control', 'motivate' ),
  'section'     => 'at_sec__hpblocks3',
  'priority'    => 10,
  'row_label' => array(               
          'type' => 'text',
          'value' => esc_attr__('Block', 'motivate' ),
  ),
  'settings'    => 'at_setting__hpblocks3',
  'default'     => array(
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block One', 'motivate' ),
      'link_url'  => '#',
    ),
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block Two', 'motivate' ),
      'link_url'  => '#',
    ),
    array(
      'link_image'  => '',
      'link_text' => esc_attr__( 'Block Three', 'motivate' ),
      'link_url'  => '#',
    ),
  ),
  'fields' => array(
    'link_image' => array(
      'type'        => 'image',
      'label'       => esc_attr__( 'Block Image', 'motivate' ),
      'description' => esc_attr__( 'Block Image', 'motivate' ),
      'default'     => '',
    ),
    'link_text' => array(
      'type'        => 'text',
      'sanitize_callback' => 'wp_kses_post',
      'label'       => esc_attr__( 'Block Heading', 'motivate' ),
      'description' => esc_attr__( 'Block Heading', 'motivate' ),
      'default'     => '',
    ),
    'link_url' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Block URL', 'motivate' ),
      'description' => esc_attr__( 'Block URL', 'motivate' ),
      'default'     => '',
    ),
    'link_description' => array(
      'sanitize_callback' => 'wp_kses_post',
      'type'        => 'textarea',
      'label'       => esc_attr__( 'Block Text', 'motivate' ),
      'description' => esc_attr__( 'Block Text', 'motivate' ),
      'default'     => '',
    ),

    'link_button' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Block Button Text', 'motivate' ),
      'description' => esc_attr__( 'Block Button Text', 'motivate' ),
      'default'     => '',
    ),
  )
  ) );




  /** 
  * Section: Homepage - Additional Text
  */
  Kirki::add_section( 'at_sec__hptextblock', array(
    'title'         => esc_attr__( 'Homepage Text Block', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );


  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__textblocktitle',
  'label'    => esc_html__( 'Block Title', 'motivate' ),
  'section'  => 'at_sec__hptextblock',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  ) );


  Kirki::add_field( 'at_theme', array(
  'type'     => 'textarea',
  'settings' => 'at_setting__textblockcontent',
  'label'    => esc_html__( 'Content', 'motivate' ),
  'section'  => 'at_sec__hptextblock',
  'default'  => esc_attr__( 'This is a default value', 'motivate' ),
  'priority' => 10,
  ) );

 



  /** 
  * Section: Homepage - HP Testimonials
  */
  Kirki::add_section( 'at_sec__hptestimonials', array(
    'title'         => esc_attr__( 'Homepage Testimonials', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'     => 'text',
    'settings' => 'at_setting__hptestimonialstitle',
    'label'    => esc_html__( 'Testimonial Block Title', 'motivate' ),
    'section'  => 'at_sec__hptestimonials',
    'default'  => esc_attr__( 'What My Wonderful Clients Say', 'motivate' ),
    'priority' => 10,
    ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'number',
  'settings'    => 'at_sec__hptestimonial_nb',
  'label'       => esc_attr__( 'Number of testimonials per row', 'motivate' ),
  'section'     => 'at_sec__hptestimonials',
  'default'     => 2,
  'choices'     => array(
    'min'  => 1,
    'max'  => 3,
    'step' => 1,
  ),
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'repeater',
  'label'       => esc_attr__( 'Testimonials', 'motivate' ),
  'section'     => 'at_sec__hptestimonials',
  'priority'    => 10,
  'row_label' => array(               
          'type' => 'text',
          'value' => esc_attr__('Testimonial', 'motivate' ),
  ),
  'settings'    => 'at_setting__hptestimonials',
  'default'     => array(
    array(
      'testimonial_image'  => '',
      'testimonial_text' => '',
      'testimonial_name'  => '',
      'testimonial_bio'  => '',
    ),
  ),
  'fields' => array(
    'testimonial_image' => array(
      'type'        => 'image',
      'label'       => esc_attr__( 'Testimonial Image', 'motivate' ),
      'description' => esc_attr__( '60px by 60px Image', 'motivate' ),
      'default'     => '',
    ),
    'testimonial_text' => array(
      'sanitize_callback' => 'wp_kses_post',
      'type'        => 'textarea',
      'label'       => esc_attr__( 'Testimonial Text', 'motivate' ),
      'description' => esc_attr__( 'Enter the testimonial content here', 'motivate' ),
      'default'     => '',
    ),
    'testimonial_name' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Testimonial Name', 'motivate' ),
      'description' => esc_attr__( 'Enter the customer/client name here', 'motivate' ),
      'default'     => '',
    ),
    'testimonial_bio' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Testimonial Bio', 'motivate' ),
      'description' => esc_attr__( 'Enter any extra information about the customer/client here', 'motivate' ),
      'default'     => '',
    ),
  )
  ) );




  /** 
  * Section: Homepage - HP Blog
  */
  Kirki::add_section( 'at_sec__hpblog', array(
    'title'         => esc_attr__( 'Homepage Blog Section', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'     => 'text',
    'settings' => 'at_setting__hpblogtitle',
    'label'    => esc_html__( 'Blog Block Title', 'motivate' ),
    'section'  => 'at_sec__hpblog',
    'default'  => esc_attr__( 'From The Blog', 'motivate' ),
    'priority' => 10,
    ) );

  Kirki::add_field( 'at_theme', array(
    'settings'    => 'at_setting__blogpostnb',
    'section'     => 'at_sec__hpblog',
    'type'        => 'radio-buttonset',
    'label'       => esc_attr__( 'Number of blog post shown', 'motivate' ),
    'description' => esc_attr__( 'Select the number of post you want to show in your homepage', 'motivate' ),
    'default'     => '6',
    'priority'    => 10,
    'choices'     => array(
      '3'   => '3 posts',
      '6' => '6 posts',
      '12'  => '12 posts',
    ),
  ) );

   Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__blogbutton',
  'label'    => esc_html__( 'Button Title', 'motivate' ),
  'section'  => 'at_sec__hpblog',
  'default'  => esc_attr__( 'More from the Blog', 'motivate' ),
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__blogurl',
  'label'    => esc_html__( 'Button URL', 'motivate' ),
  'section'  => 'at_sec__hpblog',
  'default'  => esc_attr__( '/blog', 'motivate' ),
  'priority' => 10,
  ) );




  /** 
  * Section: Homepage - HP Featured
  */
  Kirki::add_section( 'at_sec__hpfeatured', array(
    'title'         => esc_attr__( 'Homepage Featured', 'motivate' ),
    'panel'       => 'at_panel__homepage',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'     => 'text',
    'settings' => 'at_setting__hpfeaturedtitle',
    'label'    => esc_html__( 'Featured Title', 'motivate' ),
    'section'  => 'at_sec__hpfeatured',
    'default'  => esc_attr__( 'As Featured In', 'motivate' ),
    'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'repeater',
  'label'       => esc_attr__( 'Homepage Featured Images', 'motivate' ),
  'section'     => 'at_sec__hpfeatured',
  'priority'    => 10,
  'row_label' => array(               
          'type' => 'text',
          'value' => esc_attr__('Block', 'motivate' ),
  ),
  'settings'    => 'at_setting__hpfeatured',
  'default'     => array(
    array(
      'image'  => '',
    ),
  ),
  'fields' => array(
    'image' => array(
      'type'        => 'image',
      'label'       => esc_attr__( 'Block Image', 'motivate' ),
      'description' => esc_attr__( 'Block Image', 'motivate' ),
      'default'     => '',
    ),
  )
  ) );


  




  /** 
  * Section: Social Links
  */
  Kirki::add_section( 'at_sec__social', array(
    'title'         => esc_attr__( 'Social Links', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'     => 'text',
    'settings' => 'at_setting__socialtitle',
    'label'    => esc_html__( 'Title', 'motivate' ),
    'section'  => 'at_sec__social',
    'default'  => esc_attr__( "Let's connect", 'motivate' ),
    'priority' => 10,
    ) );

  

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialfacebook',
  'label'    => esc_html__( 'Facebook Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialtwitter',
  'label'    => esc_html__( 'Twitter Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialgoogleplus',
  'label'    => esc_html__( 'Google+ Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialinstagram',
  'label'    => esc_html__( 'Instagram Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialflickr',
  'label'    => esc_html__( 'Flickr Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialyoutube',
  'label'    => esc_html__( 'YouTube Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialvimeo',
  'label'    => esc_html__( 'Vimeo Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialpinterest',
  'label'    => esc_html__( 'Pinterest Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialdribbble',
  'label'    => esc_html__( 'Dribbble Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialsoundcloud',
  'label'    => esc_html__( 'Soundcloud Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__sociallinkedin',
  'label'    => esc_html__( 'LinkedIn Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'     => 'text',
  'settings' => 'at_setting__socialtumblr',
  'label'    => esc_html__( 'Tumblr Link', 'motivate' ),
  'section'  => 'at_sec__social',
  'default'  => '',
  'priority' => 10,
  ) );

  /**
  * Theme Typography
  */
  Kirki::add_section( 'typography_sec', array(
    'title'          => esc_attr__( 'Typography', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'       => 1,
    'capability'     => 'edit_theme_options',
  ) );


  Kirki::add_field( 'at_theme', array(
    'type'        => 'typography',
    'settings'    => 'at_typography_blocktitle',
    'label'       => esc_attr__( 'Block Title Tyography', 'motivate' ),
    'description' => esc_attr__( 'Set the Block Title typography here', 'motivate' ),
    'section'     => 'typography_sec',
    'default'     => array(
      'font-family'    => 'Playfair Display',
      'variant'        => '600',
      'text-transform' => 'none',
      'font-size'      => '30px',
      'line-height'    => '36px',
      'letter-spacing' => '0',
      
    ),
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output' => array(
      array(
        'element' => '.at-ctalist .at-ctalist__title, .at-testimonals .at-testimonals__title, .at-bloglist .at-bloglist__title, .at-featured .at-featured__title, .at-relatedposts .at-relatedposts__title, .at-commentform .at-commentform__title, .at-commentslist .at-commentslist__title, .at-about .at-about__title, .at-textblock .at-textblock__title, .at-socialfooter .at-socialfooter__title, .at-optin .at-optin__title, .at-ctalist2 .at-ctalist__title, .at-ctalist3 .at-ctalist__title',
      ),
    ),
    'js_vars'     => array(
      array(
        'element'  => '.at-ctalist .at-ctalist__title, .at-testimonals .at-testimonals__title, .at-bloglist .at-bloglist__title, .at-featured .at-featured__title, .at-relatedposts .at-relatedposts__title, .at-commentform .at-commentform__title, .at-commentslist .at-commentslist__title, .at-about .at-about__title, .at-textblock .at-textblock__title, .at-socialfooter .at-socialfooter__title, .at-optin .at-optin__title, .at-ctalist2 .at-ctalist__title, .at-ctalist3 .at-ctalist__title',
      ),
    ),
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__color1',
    'label'       => esc_attr__( 'Title Color 1', 'motivate' ),
    'description' => esc_attr__( 'Color of the titles on white background', 'motivate' ),
    'section'     => 'typography_sec',
    'default'     => '#66B7AF',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.at-bloglist .at-bloglist__title, .at-about .at-about__title, .at-textblock .at-textblock__title, .at-ctalist3 h4, .site-header__nav > ul > li ul li a, .at-relatedposts .at-relatedposts__title,.at-ctalist3 .at-ctalist__title',
        'property' => 'color',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.at-bloglist .at-bloglist__title, .at-about .at-about__title, .at-textblock .at-textblock__title, .at-ctalist3 h4, .site-header__nav > ul > li ul li a, .at-relatedposts .at-relatedposts__title, .at-ctalist3 .at-ctalist__title',
        'function' => 'style',
        'property' => 'color',
      ),
    ),

  ) );


  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__color2',
    'label'       => esc_attr__( 'Title Color 2', 'motivate' ),
    'description' => esc_attr__( 'Color of the titles on main color background', 'motivate' ),
    'section'     => 'typography_sec',
    'default'     => '#ffffff',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.at-socialfooter ul a, .at-socialfooter .at-socialfooter__title, .at-bloglist .at-blog__blockbutton, .at-optin .at-optin__title, .at-optin .at-optin__subtitle, .at-ctalist2 .at-ctalist__title, .at-ctalist .at-ctalist__blockbutton span, .at-ctalist3 .at-ctalist__blockbutton span, .at-ctalist .at-ctalist__block .at-ctalist__content h4, .site-header__nav ul li a, .at-commentform__submit input[type="submit"]',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-socialfooter ul a svg path, .at-socialfooter ul a svg circle',
        'property' => 'fill',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.at-socialfooter ul a, .at-socialfooter .at-socialfooter__title, .at-bloglist .at-blog__blockbutton, .at-optin .at-optin__title, .at-optin .at-optin__subtitle, .at-ctalist2 .at-ctalist__title, .at-ctalist .at-ctalist__blockbutton span, .at-ctalist3 .at-ctalist__blockbutton span, .at-ctalist .at-ctalist__block .at-ctalist__content h4, .site-header__nav ul li a, .at-commentform__submit input[type="submit"]',
        'function' => 'style',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-socialfooter ul a svg path, .at-socialfooter ul a svg circle',
        'function' => 'style',
        'property' => 'fill',
      ),
    ),

  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_setting__color3',
    'label'       => esc_attr__( 'Title Color 3', 'motivate' ),
    'description' => esc_attr__( 'Color of the text and titles on secondary color background', 'motivate' ),
    'section'     => 'typography_sec',
    'default'     => '#ffffff',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.at-ctalist .at-ctalist__title, .at-commentform .at-commentform__title,  .at-pageheader__title, .at-testimonals .at-testimonals__title, .at-featured .at-featured__title, .at-ctalist2 .at-ctalist__block .at-ctalist__content h4, .at-ctalist2 .at-ctalist__blockbutton span, .site-header__nav > ul > li ul li a:hover, .at-socialshare a, .at-relatedposts .at-relatedposts__post .at-relatedposts__posttitle a, .at-commentform p, .widget .widget__title, .mc4wp-form input[type="submit"], .at-hero .at-hero__btn span, .at-testimonial2 .at-testimonial2__author, .at-testimonial2 .at-testimonial2__authordetails, .at-testimonial2 .at-testimonial2__content p, .at-comment .at-comment__actions a, .at-commentslist .at-commentslist__title, .widget_calendar table tfoot a',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-socialshare a svg path',
        'property' => 'fill',
      ),

      
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.at-ctalist .at-ctalist__title, .at-commentform .at-commentform__title, .at-pageheader__title, .at-testimonals .at-testimonals__title, .at-featured .at-featured__title, .at-ctalist2 .at-ctalist__block .at-ctalist__content h4, .at-ctalist2 .at-ctalist__blockbutton span, .site-header__nav > ul > li ul li a:hover, .at-socialshare a, .at-relatedposts .at-relatedposts__post .at-relatedposts__posttitle a, .at-commentform  p, .widget .widget__title, .mc4wp-form input[type="submit"], , .at-hero .at-hero__btn span, .at-testimonial2 .at-testimonial2__author, .at-testimonial2 .at-testimonial2__authordetails, .at-testimonial2 .at-testimonial2__content p, .at-comment .at-comment__actions a, .at-commentslist .at-commentslist__title, .widget_calendar table tfoot a',
        'function' => 'style',
        'property' => 'color',
      ),
      array(
        'element'  => '.at-socialshare a svg path',
        'function' => 'style',
        'property' => 'fill',
      ),
    ),

  ) );


 Kirki::add_field( 'at_theme', array(
    'type'        => 'typography',
    'settings'    => 'at_typography_headings',
    'label'       => esc_attr__( 'Other Headings Font', 'motivate' ),
    'description' => esc_attr__( 'Set the heading typography here', 'motivate' ),
    'section'     => 'typography_sec',
    'default'     => array(
      'font-family'    => 'Playfair Display',
      'variant'        => '700',
      'text-transform' => 'none',
      'color'          => '#1a1a1a',
    ),
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output' => array(
      array(
        'element' => 'h1, h2, h3, h4, h5, h6',
      ),
    ),
    'js_vars'     => array(
      array(
        'element'  => 'h1, h2, h3, h4, h5, h6',
      ),
    ),
  ) );


  

  Kirki::add_field( 'at_theme', array(
    'type'        => 'typography',
    'settings'    => 'at_typography_body',
    'label'       => esc_attr__( 'Body Font', 'motivate' ),
    'description' => esc_attr__( 'Set the body typography here', 'motivate' ),
    'section'     => 'typography_sec',
    'default'     => array(
      'font-family'    => 'Open Sans',
      'variant'        => 'regular',
      'font-size'      => '15px',
      'line-height'    => '23px',
      'letter-spacing' => '0',
      'color'          => '#424242',
    ),
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output' => array(
      array(
        'element' => 'body, .at-post .at-post__excerpt p',
      ),
    ),
    'js_vars'     => array(
    array(
      'element'  => 'body, .at-post .at-post__excerpt p',
    ),
  ),
  ) );

  



  /** 
  * Section: Footer
  */
  Kirki::add_section( 'at_sec__footer', array(
    'title'         => esc_attr__( 'Footer', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  

    Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_topfootercolor',
    'label'       => esc_attr__( 'Top Footer Color', 'motivate' ),
    'section'     => 'at_sec__footer',
    'default'     => '#262626',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.site-footer .at-top-footer',
        'property' => 'background',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.site-footer .at-top-footer',
        'function' => 'style',
        'property' => 'background',
      ),
    ),

  ) );


  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_topfootertextcolor',
    'label'       => esc_attr__( 'Top Footer Text Color', 'motivate' ),
    'section'     => 'at_sec__footer',
    'default'     => '#fff',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.at-top-footer h1, .at-top-footer h2, .at-top-footer h3, .at-top-footer h4, .at-top-footer h5, .at-top-footer h6, .at-top-footer p, .at-top-footer .site-footer-widgets a',
        'property' => 'color',
      ),
      array(
        'element'  => '.site-footer-widgets .at-socialwidget svg path',
        'property' => 'fill',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.at-top-footer h1, .at-top-footer h2, .at-top-footer h3, .at-top-footer h4, .at-top-footer h5, .at-top-footer h6, .at-top-footer p, .at-top-footer .site-footer-widgets a',
        'function' => 'style',
        'property' => 'color',
      ),
      array(
        'element'  => '.site-footer-widgets .at-socialwidget svg path',
        'function' => 'style',
        'property' => 'fill',
      ),
    ),

  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_bottomfootercolor',
    'label'       => esc_attr__( 'Bottom Footer Color', 'motivate' ),
    'section'     => 'at_sec__footer',
    'default'     => '#1a1a1a',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.site-footer .at-bottom-footer',
        'property' => 'background',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.site-footer .at-bottom-footer',
        'function' => 'style',
        'property' => 'background',
      ),
    ),

  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'color',
    'settings'    => 'at_bottomfootertextcolor',
    'label'       => esc_attr__( 'Bottom Footer Text Color', 'motivate' ),
    'section'     => 'at_sec__footer',
    'default'     => '#777',
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output'      => array(
      array(
        'element'  => '.site-footer .site-footer__copyright',
        'property' => 'color',
      ),
    ),
    
    'js_vars'     => array(
      array(
        'element'  => '.site-footer .site-footer__copyright',
        'function' => 'style',
        'property' => 'color',
      ),
    ),

  ) );

  Kirki::add_field( 'at_theme', array(
      'type'     => 'textarea',
      'settings' => 'at_setting__copyright',
      'label'    => esc_attr__( 'Copyright Message', 'motivate' ),
      'section'  => 'at_sec__footer',
      'sanitize_callback' => 'wp_kses_post',
      'default'  => esc_html__('&copy; Copyright 2017 All Rights Reserved.', 'motivate' ),
      'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
      'type'     => 'text',
      'settings' => 'at_setting__poweredby',
      'label'    => esc_attr__( 'Your Affilate Link', 'motivate' ),
      'description' => esc_attr__('Register to become an affiliate (free) and earn commissions', 'motivate' ),
      'section'  => 'at_sec__footer',
      'sanitize_callback' => 'wp_kses_post',
      'default'  => esc_url('https://launchandsell.com/?poweredby', 'motivate' ),
      'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'        => 'typography',
    'settings'    => 'at_typography_footernav',
    'label'       => esc_attr__( 'Bottom Footer Navigation Typography', 'motivate' ),
    'description' => esc_attr__( 'Set the footer navigation typography here', 'motivate' ),
    'section'     => 'at_sec__footer',
    'default'     => array(
      //'font-family'    => 'Open ',
      //'variant'        => '400',
      'font-size'      => '15px',
      //'line-height'    => '1',
      //'letter-spacing' => '0',
      'color'          => '#f5f7f8',
    ),
    'priority'    => 10,
    'transport'   => 'postMessage',
    'output' => array(
      array(
        'element' => '.nav-footer ul a',
      ),
    ),
    'js_vars'     => array(
    array(
      'element'  => '.nav-footer ul a',
    ),
  ),
  ) );

}

  /** 
  * Panel: OptIn
  */
  //Kirki::add_panel( 'at_panel__optin', array(
  //    'priority'    => 10,
  //    'title'       => esc_attr__( 'Opt-in', 'motivate' ),
  //    'description' => esc_attr__( 'Opt-in Options', 'motivate' ),
  //) );

  /** 
  * Section: Homepage - HP Optin
  */
  Kirki::add_section( 'at_sec__hpoptin', array(
    'title'         => esc_attr__( 'Opt-In Options', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  Kirki::add_field( 'at_theme', array(
    'type'     => 'text',
    'settings' => 'at_setting__hpoptintitle',
    'label'    => esc_html__( 'Optin Title', 'motivate' ),
    'section'  => 'at_sec__hpoptin',
    'default'  => esc_attr__( 'Get my FREE Marketing Training Kit now!', 'motivate' ),
    'priority' => 10,
  ) );



  Kirki::add_field( 'at_theme', array(
    'type'     => 'textarea',
    'settings' => 'at_setting__hpoptinsubtitle',
    'label'    => esc_html__( 'Optin Subtitle', 'motivate' ),
    'section'  => 'at_sec__hpoptin',
    'default'  => esc_attr__( '', 'motivate' ),
    'priority' => 10,
  ) );



  Kirki::add_field( 'at_theme', array(
    'sanitize_callback' => 'wp_kses_post',
    'type'     => 'text',
    'settings' => 'at_setting__hpoptinform',
    'label'    => esc_html__( 'Optin Form', 'motivate' ),
    'section'  => 'at_sec__hpoptin',
    'default'  => '',
    'priority' => 10,
  ) );

  Kirki::add_field( 'at_theme', array(
  'type'        => 'image',
  'settings'    => 'at_setting__hpoptinimg',
  'label'       => esc_attr__( 'Optin Image', 'motivate' ),
  'description' => esc_attr__( 'If you want to place an image on the left', 'motivate' ),
  'section'     => 'at_sec__hpoptin',
  'priority'    => 10,
  ) );



  /** 
  * Panel: Testimonials
  */
  //Kirki::add_panel( 'at_panel__testimonials', array(
  //    'priority'    => 10,
  //    'title'       => esc_attr__( 'Testimonials', 'motivate' ),
  //    'description' => esc_attr__( 'Add your testimonials here', 'motivate' ),
  //) );

  /** 
  * Section: Testimonials
  */
  Kirki::add_section( 'at_sec__testimonials', array(
    'title'         => esc_attr__( 'Testimonials', 'motivate' ),
    'panel'       => 'at_panel__main',
    'priority'      => 1,
    'capability'    => 'edit_theme_options',
  ) );

  /** 
  * Setting: Testimonials
  */
  Kirki::add_field( 'at_theme', array(
  'type'        => 'repeater',
  'label'       => esc_attr__( 'Testimonials', 'motivate' ),
  'section'     => 'at_sec__testimonials',
  'priority'    => 10,
  'row_label' => array(               
          'type' => 'text',
          'value' => esc_attr__('Testimonial', 'motivate' ),
  ),
  'settings'    => 'at_setting__testimonials',
  'default'     => array(
    array(
      'testimonial_image'  => '',
      'testimonial_text' => '',
      'testimonial_name'  => '',
      'testimonial_bio'  => '',
    ),
  ),
  'fields' => array(
    'testimonial_image' => array(
      'type'        => 'image',
      'label'       => esc_attr__( 'Testimonial Image', 'motivate' ),
      'description' => esc_attr__( '', 'motivate' ),
      'default'     => '',
    ),
    'testimonial_text' => array(
      'type'        => 'textarea',
      'label'       => esc_attr__( 'Testimonial Text', 'motivate' ),
      'description' => esc_attr__( 'Enter the testimonial content here', 'motivate' ),
      'default'     => '',
    ),
    'testimonial_name' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Testimonial Name', 'motivate' ),
      'description' => esc_attr__( 'Enter the customer/client name here', 'motivate' ),
      'default'     => '',
    ),
    'testimonial_bio' => array(
      'type'        => 'text',
      'label'       => esc_attr__( 'Testimonial Bio', 'motivate' ),
      'description' => esc_attr__( 'Enter any extra information about the customer/client here', 'motivate' ),
      'default'     => '',
    ),
  )
  ) );
