<?php
/**
 * Floating Sidebar Variant 3.
 *
 * @package     Relatedly
 * @since       2.0.0
 * @fs_premium_only
 */

namespace Relatedly\Theming\Floating\Variants;

use Relatedly\Theming\AbstractTheme;

defined( 'ABSPATH' ) || exit;

/**
 * Renders floating sidebar variant 3.
 *
 * @since 2.0.0
 */
class Variant3 extends AbstractTheme {
	/**
	 * Template file name.
	 *
	 * @var string
	 */
	protected string $template_file = 'floating/variant3.php';

	/**
	 * Get the tracking display type.
	 *
	 * @return string
	 */
	protected function display_type(): string {
		return 'floating'; }

	/**
	 * Build template variables.
	 *
	 * @param \WP_Post $post      Post object.
	 * @param int|null $source_id Source post ID.
	 * @return array<string,mixed>
	 */
	protected function template_vars( \WP_Post $post, ?int $source_id ): array {
		$vars             = parent::template_vars( $post, $source_id );
		$vars['css_vars'] = $this->css_vars(
			array(
				'--relatedly-bg'          => 'floating_sidebar_variant3_bg',
				'--relatedly-title-color' => 'floating_sidebar_variant3_title_color',
				'--relatedly-label-color' => 'floating_sidebar_variant3_label_color',
			)
		);
		return $vars;
	}
}
