<?php
/**
 * Title: Header
 * Slug: twentytwentyfive/header
 * Categories: header
 * Block Types: core/template-part/header
 * Description: Site header with site title and navigation.
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_Five
 * @since Twenty Twenty-Five 1.0
 */

$home_page = get_page_by_path('home', OBJECT, 'page');
$course_page = get_page_by_path('course', OBJECT, 'page');
$pricing_page = get_page_by_path('pricing', OBJECT, 'page');
$results_page = get_page_by_path('results', OBJECT, 'page');
$about_page = get_page_by_path('about', OBJECT, 'page');
$resources_page = get_page_by_path('resources', OBJECT, 'page');
$contact_page = get_page_by_path('contact', OBJECT, 'page');
$book_session_page = get_page_by_path('book-session', OBJECT, 'page');
$book_session_url = $book_session_page ? get_permalink($book_session_page) : home_url('/book-session/');
?>
<!-- wp:group {"align":"full","layout":{"type":"default"}} -->
<div class="wp-block-group alignfull">
	<!-- wp:group {"layout":{"type":"constrained"}} -->
	<div class="wp-block-group">
		<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
		<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30)">
			<!-- wp:site-title {"level":0} /-->

			<!-- wp:navigation {"overlayBackgroundColor":"base","overlayTextColor":"contrast","layout":{"type":"flex","justifyContent":"center","flexWrap":"wrap"}} -->
			<?php if ($home_page) : ?>
			<!-- wp:navigation-link {"label":"Home","type":"page","id":<?php echo (int) $home_page->ID; ?>,"url":"/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($course_page) : ?>
			<!-- wp:navigation-link {"label":"Course","type":"page","id":<?php echo (int) $course_page->ID; ?>,"url":"/course/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($pricing_page) : ?>
			<!-- wp:navigation-link {"label":"Pricing","type":"page","id":<?php echo (int) $pricing_page->ID; ?>,"url":"/pricing/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($results_page) : ?>
			<!-- wp:navigation-link {"label":"Results","type":"page","id":<?php echo (int) $results_page->ID; ?>,"url":"/results/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($resources_page) : ?>
			<!-- wp:navigation-link {"label":"Resources","type":"page","id":<?php echo (int) $resources_page->ID; ?>,"url":"/resources/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($about_page) : ?>
			<!-- wp:navigation-link {"label":"About","type":"page","id":<?php echo (int) $about_page->ID; ?>,"url":"/about/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($contact_page) : ?>
			<!-- wp:navigation-link {"label":"Contact","type":"page","id":<?php echo (int) $contact_page->ID; ?>,"url":"/contact/","kind":"post-type"} /-->
			<?php endif; ?>
			<!-- wp:navigation-link {"label":"Admin","type":"custom","url":"/wp-admin/","kind":"custom"} /-->
			<!-- /wp:navigation -->

			<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"right"}} -->
			<div class="wp-block-buttons">
				<!-- wp:button -->
				<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="<?php echo esc_url($book_session_url); ?>">Free Run Review</a></div>
				<!-- /wp:button -->
			</div>
			<!-- /wp:buttons -->
		</div>
		<!-- /wp:group -->
	</div>
	<!-- /wp:group -->
</div>
<!-- /wp:group -->
