<?php
/**
 * Content Recent Property Template
 * 
 * This template displays the content for individual recent property posts.
 * 
 * HOW TO OVERRIDE THIS TEMPLATE:
 * 1. Copy this file from: wp-content/plugins/havenlytics/templates/content-property-recent.php
 * 2. Paste it to your theme at: wp-content/themes/your-theme/havenlytics/content-property-recent.php
 * 3. Modify the copied file to customize the recent property page
 * 
 * @package     Havenlytics
 * @subpackage  Templates/
 * @since       2.0.0
 */
if (!defined('ABSPATH')) {
    exit;
}

// Prefix all variables with hvnly_ to avoid global namespace conflicts
$hvnly_property_id = get_the_ID();
$hvnly_price = hvnly_get_property_price();
?>

<article id="property-<?php the_ID(); ?>" <?php post_class('hvnly-property-item hvnly-recent-property'); ?>>
    <div class="hvnly-property-inner">

        <div class="hvnly-property-image">
            <a href="<?php the_permalink(); ?>">
                <?php 
                // The function hvnly_get_property_image() should return escaped HTML
                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                echo hvnly_get_property_image($hvnly_property_id, 'thumbnail', [
                    'class' => 'hvnly-property-thumbnail',
                    'loading' => 'lazy'
                ]); 
                ?>
            </a>
        </div>

        <div class="hvnly-property-content">
            <h4 class="hvnly-property-title">
                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
            </h4>

            <div class="hvnly-property-price">
                <?php echo wp_kses_post( $hvnly_price ); ?>
            </div>
        </div>
    </div>
</article>