<?php
/**
 * Grid Card footer top Template
 * 
 * Displays property email from preset_hvnly_property_field_email field in the grid card footer top section.
 * 
 * HOW TO OVERRIDE THIS TEMPLATE:
 * 1. Copy this file from: wp-content/plugins/havenlytics/templates/archive/fields/email.php
 * 2. Paste it to your theme at: wp-content/themes/your-theme/havenlytics/archive/fields/email.php
 * 3. Modify the copied file to customize email display
 * 
 * AVAILABLE VARIABLES:
 * $property_id - Current property ID
 * 
 * EXAMPLE OVERRIDE:
 * You can change email layout, colors, icons, or implement carousel display.
 * 
 * @package     Havenlytics
 * @subpackage  Templates/archive/Fields
 * @since       2.0.0
 */

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

// Prefix all variables with hvnly_ to avoid global namespace conflicts
$hvnly_property_id = $property_id ?? get_the_ID();
$hvnly_property_data = $property_data ?? hvnly_get_property_data($hvnly_property_id);
$hvnly_mode = $mode ?? 'default';

$hvnly_email = get_post_meta($hvnly_property_id, 'preset_hvnly_property_field_email', true);
?>

    <?php if ($hvnly_email): ?>
        <div class="hvnly-property-field-email hvnly-property-contact-info-mode-<?php echo esc_attr($hvnly_mode); ?>">
          
            <div class="hvnly-property-content-feature-icon">
                <i class="fas fa-envelope"></i>
            </div>
            <a href="mailto:<?php echo esc_attr($hvnly_email); ?>"><?php echo esc_html($hvnly_email); ?></a>
        </div>
    <?php endif; ?>