<?php
/**
 * Education Modern header layout — Design Lab approved preset.
 *
 * Visual clone of the Education Modern / ktbysa-inspired header.
 * Independent layout — does not alter classic/modern/centered.
 *
 * @package Kutby
 * @since   2.9.2
 */

declare(strict_types=1);

namespace Kutby\Header\Layouts;

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

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

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

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

	/**
	 * {@inheritdoc}
	 */
	public function label(): string {
		return 'Education Modern';
	}

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

	/**
	 * {@inheritdoc}
	 */
	public function render( HeaderContext $ctx ): void {
		?>
		<header class="kutby-header kutby-header--education-modern" data-kutby-edu-header>
			<div class="kutby-header-edu">
				<?php MobileToggle::render( $ctx, array( 'class' => 'kutby-nav-toggle kutby-header-edu__menu' ) ); ?>

				<div class="kutby-header-edu__logo">
					<?php Logo::render( $ctx ); ?>
				</div>

				<div class="kutby-header-edu__search">
					<?php
					if ( $ctx->bool( 'show_search' ) ) {
						Search::render(
							$ctx,
							array(
								'class'       => 'kutby-header-search kutby-header-edu__search-box',
								'force_style' => 'form',
								'placeholder' => 'ابحث عن مادة أو صف أو ملف دراسي...',
							)
						);
					}
					?>
				</div>

				<div class="kutby-header-edu__nav">
					<?php Navigation::render( $ctx ); ?>
				</div>

				<div class="kutby-header-edu__actions">
					<?php
					ThemeToggle::render(
						$ctx,
						array(
							'force' => true,
							'class' => 'kutby-theme-toggle kutby-header-edu__theme',
						)
					);
					?>
				</div>
			</div>
		</header>
		<?php
	}
}
