<?php
$padded = str_pad($page->chapter_number()->value(), 2, '0', STR_PAD_LEFT);
snippet('html-head', [
  'pageTitle' => 'Chapter ' . $padded . ' · ' . $page->title()->value(),
]);
?>

<body data-screen-label="<?= html($padded . ' ' . $page->title()->value()) ?>" class="chapter-page">

  <?php snippet('effects') ?>
  <?php snippet('header') ?>

  <?php snippet('chapter/hero', ['page' => $page]) ?>

  <article class="chapter-body">
    <?php foreach ($page->sections()->toBlocks() as $block): ?>
      <?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
    <?php endforeach ?>
  </article>

  <?php snippet('chapter/nav-footer', ['page' => $page]) ?>

  <?php snippet('menu', ['currentPage' => $page]) ?>
  <?php snippet('scripts') ?>

</body>

</html>