<?php
/**
 * File Path: templates/partials/cover.php
 *
 * Cover Partial
 *
 * Uses MBS_Cover_Renderer for consistent 4-level cover hierarchy (Doc 1c §5).
 * All output wrapped in .mbs-wrapper per TC-1 through TC-10.
 *
 * @package MyBookShowroom
 * @since   1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! mbs_is_registered() ) {
	return;   // ← LICENSE GATE (GP-T-1)
}

// $post_id and optional $format_row are expected from calling context
if ( ! isset( $post_id ) ) {
	$post_id = get_the_ID();
}

echo MBS_Cover_Renderer::render( $post_id, $format_row ?? null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- trusted renderer returns pre-escaped HTML
?>
