<?php
/**
 * File Path: includes/admin/tabs/appearance/class-mbs-appearance-dark-mode-render.php
 *
 * Appearance Tab — Dark Mode Render Class
 *
 * Called statically from MBS_Tab_Appearance_Render dispatcher.
 * Extracted from class-mbs-tab-appearance-render.php (RF-009).
 *
 * @package MyBookShowroom
 * @since   1.0.0
 */

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

class MBS_Appearance_Dark_Mode_Render { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- mbs_/MBS_ prefix is correct; scanner not configured with plugin prefix

	/**
	 * Render the Dark Mode section.
	 *
	 * @return void
	 */
	/**
	 * Render the Dark Mode section (F-007: toggle now active).
	 *
	 * Saved value drives data-mbs-theme="dark" on <html> via a blocking
	 * wp_head inline script on front-end MBS pages, overriding CSS custom
	 * property tokens with the dark palette defined in mbs-front.css.
	 *
	 * @return void
	 */
	public static function render(): void {
		?>
		<div class="mbs-appearance-section mbs-settings-card">
			<h3><?php esc_html_e( 'Dark Mode', 'my-book-showroom' ); ?></h3>
			<table class="form-table">
				<tr>
					<th><label for="mbs_appearance_dark_mode"><?php esc_html_e( 'Enable Dark Mode', 'my-book-showroom' ); ?></label></th>
					<td>
						<input type="checkbox" id="mbs_appearance_dark_mode" name="mbs_setting_appearance_dark_mode"
						       value="1" <?php checked( '1', get_option( 'mbs_setting_appearance_dark_mode', '' ) ); ?>>
						<p class="description">
							<?php esc_html_e( 'Apply a dark color palette to all My Book Showroom front-end elements. Takes effect immediately on save — no page cache flush required for MBS styles.', 'my-book-showroom' ); ?>
						</p>
					</td>
				</tr>
			</table>
		</div>
		<?php
	}

}
