<?php

/**
 * Server render for the `arraysubs/content-restricted` block.
 *
 * Variables in scope (provided by WordPress when the block.json `render` file is
 * included): $attributes (array), $content (string — the already-rendered inner
 * blocks HTML), $block (WP_Block). Do NOT declare functions here: this file is
 * included once per block instance.
 *
 * $content is trusted, already block-rendered, KSES-filtered HTML, so it is
 * passed through unescaped (as core dynamic container blocks do). Only the
 * shortcode attribute values injected by Hooks::gate() are sanitized there.
 *
 * @package ArraySubs\Features\GutenbergIntegration
 *
 * @var array                                                  $attributes
 * @var string                                                 $content
 * @var \WP_Block                                              $block
 */

defined('ABSPATH') || exit;

// Always delegate to the gate, even for empty inner content, so a configured
// visibility fallback / denial message still renders.
echo \ArraySubs\Features\GutenbergIntegration\Services\Hooks::gate($attributes, (string) $content); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
