{#
  Contact email SDC — Figma desktop 1-6938, mobile 1-6684.
  Icon + label (e.g. "Email") + underlined email link. Dark or light background.
#}
{% set bg = backgroundcolor|default('dark') %}
{% set has_url = url is not empty %}
{% set has_icon = icon_media is defined and icon_media is not empty and icon_media.src is defined and icon_media.src is not empty %}

<div class="contact-email contact-email--{{ bg }}" data-node-id="1-6938">
  <div class="contact-email__inner">
    {% if has_icon %}
      <div class="contact-email__icon">
        {% include '@caresphere_theme/components/icon/icon.twig' with {
          media: icon_media,
          icon_size: 'small',
          custom_width: null,
          custom_height: null
        } only %}
      </div>
    {% endif %}
    <div class="contact-email__content">
      {% if label is not empty %}
        <h6 class="contact-email__label">{{ label }}</h6>
      {% endif %}
      {% if email_text is not empty %}
        {% if has_url %}
          <a href="{{ url }}" class="contact-email__link">{{ email_text }}</a>
        {% else %}
          <span class="contact-email__text">{{ email_text }}</span>
        {% endif %}
      {% endif %}
    </div>
  </div>
</div>
