<?php
/**
 * Header Navbar (bootstrap5)
 *
 * @package Poster
 * @since 1.1.0
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

$container = get_theme_mod( 'poster_container_type' );
?>
	<div class="<?php echo esc_attr( $container ); ?>">
<nav id="main-nav" class="navbar navbar-expand-md" aria-labelledby="main-nav-label">

	<h2 id="main-nav-label" class="screen-reader-text">
		<?php esc_html_e( 'Main Navigation', 'poster' ); ?>
	</h2>



		<button
			class="navbar-toggler order-first"
			type="button"
			data-bs-toggle="offcanvas"
			data-bs-target="#navbarNavOffcanvas"
			aria-controls="navbarNavOffcanvas"
			aria-expanded="false"
			aria-label="<?php esc_attr_e( 'Open menu', 'poster' ); ?>"
		>
			<span class="navbar-toggler-icon"></span>
		</button>

		<div class="offcanvas offcanvas-end" tabindex="-1" id="navbarNavOffcanvas">

			<div class="offcanvas-header">
				<button
					class="btn-close"
					type="button"
					data-bs-dismiss="offcanvas"
					aria-label="<?php esc_attr_e( 'Close menu', 'poster' ); ?>"
				></button>
			</div><!-- .offcancas-header -->

			<!-- The WordPress Menu goes here -->
			<?php
			wp_nav_menu(
				array(
					'theme_location'  => 'primary',
					'container_class' => 'offcanvas-body',
					'container_id'    => '',
					'menu_class'      => 'navbar-nav flex-grow-1 pe-3',
				'fallback_cb' => 'poster_primary_menu_fallback',
					'menu_id'         => 'main-menu',
					'walker'          => new poster_WP_Bootstrap_Navwalker(),
				)
			);
			?>
		
		
</nav><!-- #main-nav -->
</div><!-- .offcanvas -->