<?php
/**
 * The template for displaying 404 pages (not found)
 *
 * @link https://codex.wordpress.org/Creating_an_Error_404_Page
 *
 * @package One Newspaper
 */
use OneNewspaper\CustomizerDefault as ONP;
get_header();
	?>
		<div id="theme-content">
			<?php
				/**
				 * hook - one_newspaper_before_main_content
				 * 
				 */
				do_action( 'one_newspaper_before_main_content' );
			?>
			<main id="primary" class="site-main <?php echo esc_attr( 'width-' . one_newspaper_get_section_width_layout_val() ); ?>">
				<div class="one-newspaper-container">
					<div class="row">
					<div class="secondary-left-sidebar">
							<?php
								get_sidebar('left');
							?>
						</div>
						<div class="primary-content">
							<section class="error-404 not-found">
								<?php
									/**
									 * hook - one_newspaper_before_inner_content
									 * 
									 */
									do_action( 'one_newspaper_before_inner_content' );
								?>
								<div class="post-inner-wrapper one-newspaper-card">
									<header class="page-header">
										<h1 class="page-title one-newspaper-block-title"><?php echo esc_html__( 'Oops! That page can\'t be found.', 'one-newspaper' ); ?></h1>
									</header><!-- .page-header -->

									<div class="page-content">
										<?php
											$error_page_image = ONP\one_newspaper_get_customizer_option( 'error_page_image' );
											if( $error_page_image != 0 ) {
												echo wp_get_attachment_image( $error_page_image, 'full' );
											} 
										?>
										<p><?php echo esc_textarea( 'It looks like nothing was found at this location. Maybe try another search?' ); ?></p>
									</div><!-- .page-content -->

									<div class="page-footer">
										<a class="button-404" href="<?php echo esc_url( home_url() ); ?>">
											<?php
												echo one_newspaper_get_icon_control_html([ 'type' => 'icon', 'value' => 'fa-solid fa-tent-arrow-turn-left' ]);
												
												echo '<span class="button-label">'. esc_html__( 'Go back to home', 'one-newspaper' ) .'</span>';
											?>
										</a>	
									</div>
								</div><!-- .post-inner-wrapper -->
							</section><!-- .error-404 -->
						</div>
						<div class="secondary-sidebar">
							<?php
								get_sidebar();
							?>
						</div>
					</div>
				</div>
			</main><!-- #main -->
		</div><!-- #theme-content -->
	<?php
get_footer();
