<?php
/**
 * Centered header — Logo center, nav below, utilities end-aligned.
 *
 * @package Kutby
 * @since   2.6.0
 */

declare(strict_types=1);

namespace Kutby\Header\Layouts;

use Kutby\Header\Components\CTAButton;
use Kutby\Header\Components\Logo;
use Kutby\Header\Components\MobileToggle;
use Kutby\Header\Components\Navigation;
use Kutby\Header\Components\Search;
use Kutby\Header\Contracts\HeaderLayoutInterface;
use Kutby\Header\Support\HeaderContext;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class CenteredHeader
 */
final class CenteredHeader implements HeaderLayoutInterface {

	/**
	 * {@inheritdoc}
	 */
	public function id(): string {
		return 'centered';
	}

	/**
	 * {@inheritdoc}
	 */
	public function label(): string {
		return 'وسطي';
	}

	/**
	 * {@inheritdoc}
	 */
	public function option_keys(): array {
		return array(
			'show_search',
			'search_style',
			'cta_enabled',
			'cta_text',
			'cta_url',
		);
	}

	/**
	 * {@inheritdoc}
	 */
	public function render( HeaderContext $ctx ): void {
		?>
		<header class="kutby-header kutby-header--centered">
			<div class="kutby-container kutby-header__row kutby-header__row--brand">
				<div class="kutby-header__spacer" aria-hidden="true"></div>
				<?php Logo::render( $ctx, array( 'class' => 'kutby-branding kutby-branding--center' ) ); ?>
				<div class="kutby-header__utilities">
					<?php Search::render( $ctx ); ?>
					<?php CTAButton::render( $ctx ); ?>
					<?php MobileToggle::render( $ctx ); ?>
				</div>
			</div>
			<div class="kutby-container kutby-header__row kutby-header__row--nav">
				<?php Navigation::render( $ctx, array( 'class' => 'kutby-nav kutby-nav--full' ) ); ?>
			</div>
		</header>
		<?php
	}
}
