<?php
/**
 * Block snippet: pinned
 * Renders a sticky full-viewport pinned scroll section.
 */
$bg = $block->image()->toFile();
?>
<section class="pinned-section">
  <div class="pinned-stage">
    <div class="pinned-bg<?= $bg ? '' : ' t1' ?>" data-parallax="0.2"<?= $bg ? ' style="background-image: url(\'' . $bg->url() . '\')"' : '' ?>></div>
    <div class="pinned-overlay"></div>
    <div class="pinned-text">
      <h2><?= $block->heading() ?></h2>
      <?php if ($block->body()->isNotEmpty()): ?>
      <?= $block->body() ?>
      <?php endif ?>
    </div>
  </div>
</section>
