{% set v = module.content %} {% set s = module.style %} {% set a = module.advanced %} {# Preload hero images if needed #} {% if v.image.src and v.image_priority == 'high' %} {% endif %} {# Main card element with custom properties - now using theme variables as fallbacks #}
{# Corner-flag label if present #} {% if v.badge %} {{ v.badge }} {% endif %} {# Image for default, logo-over-image, and image-right variants #} {% if v.variant in ['default', 'logo-over-image', 'image-right', 'full-background'] and v.image.src %}
{% set loading = v.image_priority == 'high' ? 'eager' : (v.image_priority == 'low' ? 'lazy' : v.image.loading) %} {% set fetchpriority = v.image_priority == 'high' ? 'high' : (v.image_priority == 'low' ? 'low' : 'auto') %} {# Check if HubSpot has set explicit dimensions (meaning size is restricted) #} {% set has_explicit_size = v.image.width and v.image.height %} {% set img_style = '' %} {% if has_explicit_size %} {# Respect HubSpot's sizing - don't let CSS override it #} {% set img_style = 'max-height: ' ~ v.image.height ~ 'px !important; width: auto !important; height: auto !important;' %} {% endif %} {# Check if image is HubSpot-hosted (resize_image_url only works with HubSpot URLs) #} {% set is_hubspot_image = v.image.src is string_containing 'hubspot' or v.image.src is string_containing 'hubspotusercontent' or v.image.src is string_containing 'f.hubspotusercontent' %} {{ v.image_alt|default('', true)|escape }} {# Logo overlay for logo-over-image variant #} {% set logo_url = v.logo.src|default(v.logo) %} {% if v.variant == 'logo-over-image' and logo_url %} {% endif %}
{% endif %} {# Card body content #}
{% if v.eyebrow %}

{{ v.eyebrow|escape }}

{% endif %}

{{ v.title|escape }}

{% if v.content %}
{{ v.content|sanitize_html }}
{% endif %} {% if v.meta %}

{{ v.meta|escape }}

{% endif %} {# CTA button or link #} {% if v.cta_url.href and v.cta_text %} {% set target_attrs = v.new_tab ? 'target="_blank" rel="noopener noreferrer"' : '' %} {% set aria_label = v.cta_aria_label ? 'aria-label="' ~ v.cta_aria_label|escape ~ '"' : '' %} {% if v.cta_as_button %} {{ v.cta_text|escape }} {% else %} {{ v.cta_text|escape }} {% endif %} {% endif %}
{# Structured data if enabled #} {% if a.structured_data %} {% endif %} {# Inline critical CSS - leveraging theme styles #} {% require_css %} {% end_require_css %}