<?php
/**
 * Archive Lock Indicator Template
 *
 * Displays a lock indicator for protected posts on archive pages.
 * This template is used when archive_display_mode is set to 'archive_lock_indicator'.
 *
 * Vars passed in:
 * - int    $postgate_post_id    The ID of the protected post
 * - string $postgate_post_url   The permalink to the locked post
 *
 * @package PostGate
 * @subpackage Templates
 * @since 1.0.0
 */

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

// Get settings using centralized helper
$postgate_settings = PostGate_Template_Utils::get_archive_lock_settings();
?>
<div class="postgate-archive-lock" role="region" aria-label="<?php esc_attr_e( 'Protected Content', 'postgate' ); ?>">
	<div class="postgate-archive-lock__icon" aria-hidden="true">
		<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
			<path
				d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z"
				fill="currentColor" />
		</svg>
	</div>

	<div class="postgate-archive-lock__content">
		<h3 class="postgate-archive-lock__title">
			<?php echo esc_html( $postgate_settings['title'] ); ?>
		</h3>

		<a href="<?php echo esc_url( $postgate_post_url ); ?>" class="postgate-archive-lock__button">
			<?php echo esc_html( $postgate_settings['button_text'] ); ?>
		</a>
	</div>
</div>