<?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');
$services_page = get_page_by_path('services', OBJECT, 'page');
$testimonials_page = get_page_by_path('testimonials', OBJECT, 'page');
$about_page = get_page_by_path('about', OBJECT, 'page');
$blog_page = get_page_by_path('blog', 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 ($services_page) : ?>
			<!-- wp:navigation-link {"label":"Services","type":"page","id":<?php echo (int) $services_page->ID; ?>,"url":"/services/","kind":"post-type"} /-->
			<?php endif; ?>
			<?php if ($testimonials_page) : ?>
			<!-- wp:navigation-link {"label":"Testimonials","type":"page","id":<?php echo (int) $testimonials_page->ID; ?>,"url":"/testimonials/","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 ($blog_page) : ?>
			<!-- wp:navigation-link {"label":"Blog","type":"page","id":<?php echo (int) $blog_page->ID; ?>,"url":"/blog/","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 -->

			<!-- 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); ?>">Book Session</a></div>
				<!-- /wp:button -->
			</div>
			<!-- /wp:buttons -->
		</div>
		<!-- /wp:group -->
	</div>
	<!-- /wp:group -->
</div>
<!-- /wp:group -->
