<?php
/**
 * Template Name: Nextpage Canvas
 *
 * A blank canvas page template that outputs only the header and footer built
 * with the Nextpage Helper Builder (resolved from Nextpage Options or the page
 * meta), with the page content in between. It intentionally does NOT load the
 * theme's own header.php / footer.php, so block based pages are edge to edge.
 *
 * Falls back gracefully when the Nextpage Helper plugin is inactive.
 *
 * @package nextpage
 */

if (!defined('ABSPATH')) {
	exit();
}
?>
<!doctype html>
<html <?php language_attributes(); ?>>

<head>
	<meta charset="<?php bloginfo('charset'); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">
	<?php wp_head(); ?>
</head>

<body <?php body_class('nextpage-canvas'); ?>>
	<?php
	if (function_exists('wp_body_open')) {
		wp_body_open();
	} else {
		do_action('wp_body_open');
	}

	// Builder header (from Nextpage Options / page meta).
	if (function_exists('nextpage_helper_the_header')) {
		nextpage_helper_the_header();
	}
	?>

	<div id="content" class="site-content">
		<?php
		while (have_posts()) :
			the_post();
			the_content();
		endwhile;
		?>
	</div><!-- #content -->

	<?php
	// Builder footer (from Nextpage Options / page meta).
	if (function_exists('nextpage_helper_the_footer')) {
		nextpage_helper_the_footer();
	}

	wp_footer();
	?>
</body>

</html>
