<?php
/**
 * Header Builder Options
 *
 * @package Code4rest
 */

namespace Code4rest;

use Code4rest\Theme_Customizer;
use function Code4rest\code4rest;

Theme_Customizer::add_settings(
	array(
		'info_background' => array(
			'control_type' => 'code4rest_title_control',
			'section'      => 'general_colors',
			'label'        => esc_html__( 'Backgrounds', 'code4rest' ),
			'settings'     => false,
		),
		'site_background' => array(
			'control_type' => 'code4rest_background_control',
			'section'      => 'general_colors',
			'label'        => esc_html__( 'Site Background', 'code4rest' ),
			'default'      => code4rest()->default( 'site_background' ),
			'live_method'     => array(
				array(
					'type'     => 'css_background',
					'selector' => 'body',
					'property' => 'background',
					'pattern'  => '$',
					'key'      => 'base',
				),
			),
			'input_attrs'  => array(
				'tooltip'  => __( 'Site Background', 'code4rest' ),
			),
		),
		'content_background' => array(
			'control_type' => 'code4rest_background_control',
			'section'      => 'general_colors',
			'label'        => esc_html__( 'Content Background', 'code4rest' ),
			'default'      => code4rest()->default( 'content_background' ),
			'live_method'     => array(
				array(
					'type'     => 'css_background',
					'selector' => '.content-bg, body.content-style-unboxed .site',
					'property' => 'background',
					'pattern'  => '$',
					'key'      => 'base',
				),
			),
			'input_attrs'  => array(
				'tooltip'  => __( 'Content Background', 'code4rest' ),
			),
		),
		'above_title_background' => array(
			'control_type' => 'code4rest_background_control',
			'section'      => 'general_colors',
			'label'        => esc_html__( 'Title Above Content Background', 'code4rest' ),
			'default'      => code4rest()->default( 'above_title_background' ),
			'live_method'     => array(
				array(
					'type'     => 'css_background',
					'selector' => '.wp-site-blocks .entry-hero-container-inner',
					'property' => 'background',
					'pattern'  => '$',
					'key'      => 'base',
				),
			),
			'input_attrs'  => array(
				'tooltip'  => __( 'Title Above Content Background', 'code4rest' ),
			),
		),
		'above_title_overlay_color' => array(
			'control_type' => 'code4rest_color_control',
			'section'      => 'general_colors',
			'label'        => esc_html__( 'Title Above Content Overlay Color', 'code4rest' ),
			'default'      => code4rest()->default( 'above_title_overlay_color' ),
			'live_method'     => array(
				array(
					'type'     => 'css',
					'selector' => '.entry-hero-container-inner .hero-section-overlay',
					'property' => 'background',
					'pattern'  => '$',
					'key'      => 'color',
				),
			),
			'input_attrs'  => array(
				'colors' => array(
					'color' => array(
						'tooltip' => __( 'Overlay Color', 'code4rest' ),
						'palette' => true,
					),
				),
				'allowGradient' => true,
			),
		),
		'info_links' => array(
			'control_type' => 'code4rest_title_control',
			'section'      => 'general_colors',
			'label'        => esc_html__( 'Content Links', 'code4rest' ),
			'settings'     => false,
		),
		'link_color' => array(
			'control_type' => 'code4rest_color_link_control',
			'section'      => 'general_colors',
			'transport'    => 'refresh',
			'label'        => esc_html__( 'Links Color', 'code4rest' ),
			'default'      => code4rest()->default( 'link_color' ),
			'live_method'     => array(
				array(
					'type'     => 'css_link',
					'selector' => 'a',
					'property' => 'color',
					'pattern'  => 'link-style-$',
					'key'      => 'base',
				),
			),
		),
	)
);

