<?php
/**
 * WeCodeArt Framework
 *
 * WARNING: This file is part of the core WeCodeArt Framework. DO NOT edit this file under any circumstances.
 * Please do all modifications in the form of a child theme.
 *
 * @package		WeCodeArt Framework
 * @subpackage  Gutenberg\Blocks
 * @copyright   Copyright (c) 2025, WeCodeArt Framework
 * @since		6.2.0
 * @version		6.5.7
 */

namespace WeCodeArt\Gutenberg\Blocks\Design\Accordion;

defined( 'ABSPATH' ) || exit;

use WeCodeArt\Singleton;
use WeCodeArt\Gutenberg\Blocks\Dynamic;
use function WeCodeArt\Functions\get_prop;

/**
 * Gutenberg details block.
 */
class Heading extends Dynamic {

	use Singleton;

	/**
	 * Block namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'core';

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'accordion-heading';

	/**
	 * Block styles
	 *
	 * @return 	string 	The block styles.
	 */
	public function styles(): string {
		return <<<CSS
			.wp-block-accordion-heading__toggle {
				position: relative;
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 100%;
				padding: var(--wp--accordion-btn-padding-y) var(--wp--accordion-btn-padding-x);
				font-size: 1rem;
				text-align: left;
				color: var(--wp--accordion-btn-color);
				background-color: var(--wp--accordion-btn-bg);
				border: 0;
				border-radius: 0;
				overflow-anchor: none;
				transition: var(--wp--accordion-transition);
				cursor: pointer;

				&:focus {
					z-index: 3;
					border-color: var(--wp--accordion-btn-focus-border-color);
					box-shadow: var(--wp--accordion-btn-focus-box-shadow);
					outline: 0;
				}
			}

			.wp-block-accordion-heading__toggle-icon {
				transform: var(--wp--accordion-btn-icon-transform);
			}

			@media (prefers-reduced-motion:no-preference) {
				.wp-block-accordion-heading__toggle-icon {
					transition: transform .2s ease-in-out;
				}
			}
		CSS;
	}
}