<?php
/**
 * Modern header — Announcement → Logo row → Nav → utilities.
 *
 * @package Kutby
 * @since   2.6.0
 */

declare(strict_types=1);

namespace Kutby\Header\Layouts;

use Kutby\Header\Components\AnnouncementBar;
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 ModernHeader
 */
final class ModernHeader implements HeaderLayoutInterface {

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

	/**
	 * {@inheritdoc}
	 */
	public function label(): string {
		return 'عصري';
	}

	/**
	 * {@inheritdoc}
	 */
	public function option_keys(): array {
		return array(
			'height',
			'announcement_enabled',
			'announcement_text',
			'announcement_link',
			'show_search',
			'search_style',
		);
	}

	/**
	 * {@inheritdoc}
	 */
	public function render( HeaderContext $ctx ): void {
		?>
		<div class="kutby-header-stack kutby-header-stack--modern">
			<?php AnnouncementBar::render( $ctx ); ?>
			<header class="kutby-header kutby-header--modern">
				<div class="kutby-container kutby-header__row kutby-header__row--brand">
					<?php Logo::render( $ctx ); ?>
					<?php MobileToggle::render( $ctx ); ?>
					<div class="kutby-header__utilities">
						<?php Search::render( $ctx ); ?>
					</div>
				</div>
				<div class="kutby-container kutby-header__row kutby-header__row--nav">
					<?php Navigation::render( $ctx ); ?>
				</div>
			</header>
		</div>
		<?php
	}
}
