/*
Theme Name:   Hello Elementor Child
Template:     hello-elementor
Author: 	  NAVY
Author URI:   nabarajdhungel.com.np
*/

/* =======================================
   BEM & Utility Naming Convention Used  
   - BEM for structured components  
   - Utility classes for global styles  
======================================== */

/* ========================================== 
   Responsive Global Styles
   ======================================= */

html,
body {
  overflow-x: hidden;
}

:root {
  --mb-padding: clamp(1.25rem, 0.523rem + 3.636vw, 1.5rem) /* 24px - 18px for mobile screens.*/
}


.cursor-red {
/*   cursor: url('/wp-content/uploads/2025/09/Orange-Arrow-Right-Top.svg') 0 0, auto !important; */
  cursor: pointer !important;
}
/* ======================================= 
   Responsive Global Styles
   ========================================== */


// Shortcode: [award_card] - Generates the complete Award Card (Logo + Status + Category)
add_shortcode('award_card', function() {
    // 1. Get Data from the "Award Win" Post
    $brand_id = get_field('award_organization'); 
    $status   = get_field('award_status'); // 'winner', 'nominee', etc.
    $category = get_field('category');     // e.g. "Best Director"
    $year     = get_field('year');

    // 2. Get the Logo from the "Brand" Post
    $logo_img = '';
    if ($brand_id) {
        $logo_img = get_the_post_thumbnail($brand_id, 'medium', ['class' => 'award-logo-img']);
    }

    // 3. Format the Status Label (Winner vs Nominee)
    $status_label = '';
    $status_class = 'status-' . esc_attr($status); // e.g., "status-winner"
    
    // Convert 'winner' to "WINNER", 'nominee' to "NOMINEE"
    $display_text = strtoupper(str_replace('_', ' ', $status));

    // 4. Build the HTML
    $html = '
    <div class="award-card ' . $status_class . '">
        <div class="award-laurel-container">
            ' . $logo_img . '
            <div class="award-status-label">' . $display_text . '</div>
        </div>
        <div class="award-details">
            <div class="award-category">' . esc_html($category) . '</div>
            <div class="award-year">' . esc_html($year) . '</div>
        </div>
    </div>';

    return $html;
});