<?php
/**
 * Maintenance page template.
 *
 * @package MacaHold
 *
 * @var array<string, mixed> $maca_hold_settings
 * @var string              $maca_hold_title
 * @var string              $maca_hold_message
 * @var string              $maca_hold_logo_url
 * @var string              $maca_hold_inline_styles
 * @var string              $maca_hold_body_class
 * @var bool                $maca_hold_has_bg_image
 * @var string              $maca_hold_background_image_url
 * @var int|null            $maca_hold_countdown_target
 */

defined( 'ABSPATH' ) || exit;
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<meta name="robots" content="noindex, nofollow" />
	<title><?php echo esc_html( $maca_hold_title ); ?></title>
	<?php
	/**
	 * Filter style handles printed on the maintenance page.
	 *
	 * @param string[] $styles Registered style handles.
	 */
	$maca_hold_style_handles = apply_filters( 'maca_hold_maintenance_styles', array( 'maca-hold-maintenance' ) );
	wp_print_styles( $maca_hold_style_handles );
	?>
	<?php
	wp_print_scripts(
		array_filter(
			array(
				'maca-hold-strings',
				! empty( $maca_hold_has_bg_image ) ? 'maca-hold-maintenance' : null,
			)
		)
	);
	/**
	 * Fires in the maintenance page head. Add-ons may output favicon, analytics, or meta tags.
	 *
	 * @param array<string, mixed> $settings Plugin settings.
	 */
	do_action( 'maca_hold_maintenance_head', $maca_hold_settings );
	?>
</head>
<body
	class="<?php echo esc_attr( $maca_hold_body_class ); ?>"
	style="<?php echo esc_attr( $maca_hold_inline_styles ); ?>"
	<?php if ( ! empty( $maca_hold_has_bg_image ) ) : ?>
		data-maca-hold-bg-url="<?php echo esc_url( $maca_hold_background_image_url ); ?>"
	<?php endif; ?>
>
	<?php include MACA_HOLD_PATH . 'public/templates/partials/login-link.php'; ?>
	<?php include MACA_HOLD_PATH . 'public/templates/partials/content.php'; ?>
	<?php
	if ( ! empty( $maca_hold_countdown_target ) ) {
		wp_print_scripts( 'maca-hold-countdown' );
	}
	?>
</body>
</html>
