{#
/**
 * @file
 * Default theme implementation to display a node.
 *
 * Available variables:
 * - node: The node entity with limited access to object properties and methods.
     Only "getter" methods (method names starting with "get", "has", or "is")
     and a few common methods such as "id" and "label" are available. Calling
     other methods (such as node.delete) will result in an exception.
 * - label: The title of the node.
 * - content: All node items. Use {{ content }} to print them all,
 *   or print a subset such as {{ content.field_example }}. Use
 *   {{ content|without('field_example') }} to temporarily suppress the printing
 *   of a given child element.
 * - author_picture: The node author user entity, rendered using the "compact"
 *   view mode.
 * - metadata: Metadata for this node.
 * - date: Themed creation date field.
 * - author_name: Themed author name field.
 * - url: Direct URL of the current node.
 * - display_submitted: Whether submission information should be displayed.
 * - attributes: HTML attributes for the containing element.
 *   The attributes.class element may contain one or more of the following
 *   classes:
 *   - node: The current template type (also known as a "theming hook").
 *   - node--type-[type]: The current node type. For example, if the node is an
 *     "Article" it would result in "node--type-article". Note that the machine
 *     name will often be in a short form of the human readable label.
 *   - node--view-mode-[view_mode]: The View Mode of the node; for example, a
 *     teaser would result in: "node--view-mode-teaser", and
 *     full: "node--view-mode-full".
 *   The following are controlled through the node publishing options.
 *   - node--promoted: Appears on nodes promoted to the front page.
 *   - node--sticky: Appears on nodes ordered above other non-sticky nodes in
 *     teaser listings.
 *   - node--unpublished: Appears on unpublished nodes visible only to site
 *     admins.
 * - title_attributes: Same as attributes, except applied to the main title
 *   tag that appears in the template.
 * - content_attributes: Same as attributes, except applied to the main
 *   content tag that appears in the template.
 * - author_attributes: Same as attributes, except applied to the author of
 *   the node tag that appears in the template.
 * - title_prefix: Additional output populated by modules, intended to be
 *   displayed in front of the main title tag that appears in the template.
 * - title_suffix: Additional output populated by modules, intended to be
 *   displayed after the main title tag that appears in the template.
 * - view_mode: View mode; for example, "teaser" or "full".
 * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'.
 * - page: Flag for the full page state. Will be true if view_mode is 'full'.
 * - readmore: Flag for more state. Will be true if the teaser content of the
 *   node cannot hold the main body content.
 * - logged_in: Flag for authenticated user status. Will be true when the
 *   current user is a logged-in member.
 * - is_admin: Flag for admin user status. Will be true when the current user
 *   is an administrator.
 *
 * @see template_preprocess_node()
 *
 * @ingroup themeable
 */
#}
{{ attach_library('socialbase/teaser') }}
{{ attach_library('social_featured_content/featured') }}

{%
  set classes = [
  'card teaser teaser--tile',
  'teaser-' ~ node.bundle|clean_class,
  no_image ? 'no-image'
]
%}

<div{{ attributes.addClass(classes) }}>

  {% block card_image %}
    <div class="teaser__image" aria-hidden="true">

      {% block card_hero_image %}

        <div class="img_wrapper">
          {% if node_image %}
            {{ node_image }}
          {% else %}
            <hr class="no-feature-image">
          {% endif %}
        </div>

      {% endblock %}

      {% block card_teaser_type %}
        <a href="{{ url }}" aria-hidden="true" title="{{- node.type.0.entity.label() -}}: &nbsp;{{- label|render|striptags|trim -}}">
          <div class="teaser__teaser-type">
            <svg class="teaser__teaser-type-icon" aria-labelledby="{{- node.type.0.entity.label() -}}-{{ node.id }}">
              <title id="{{- node.type.0.entity.label() -}}-{{ node.id }}">{{- node.type.0.entity.label() -}}: &nbsp;{{- label|render|striptags|trim -}}</title>
              {% if topic_type_icon %}
                <use xlink:href="#{{- topic_type_icon -}}"></use>
              {% elseif event_type_icon %}
                <use xlink:href="#{{- event_type_icon -}}"></use>
              {% else %}
                <use xlink:href="#icon-{{- node.bundle|clean_class -}}"></use>
              {% endif %}
            </svg>
          </div>
        </a>
      {% endblock %}

    </div>
  {% endblock %}

  <div class='teaser__body'>
    <div class="teaser__content">

      {% block card_title %}
        {{ title_prefix }}
        <h4{{ title_attributes }} class="teaser__title">
          <a href="{{ url }}" rel="bookmark">
            <span class="sr-only">{{ node.type.0.entity.label() -}}: </span>
            {{ label }}
          </a>
        </h4>
        {{ title_suffix }}
      {% endblock %}

      {% block card_body %}
        <small class="text-muted">

          {% if display_submitted %}
            {% embed "node--teaser__field.html.twig" %}
              {%- block field_icon -%} account_circle {%- endblock -%}
              {% block svg_title %} <title>{% trans %} Author name {% endtrans %}</title> {% endblock %}
              {%- block field_value %}
                <div class="teaser__published">
                  <span class="sr-only">{% trans %}Created on{% endtrans %} </span>
                  <div class="teaser__published-date">{{ date }} <span aria-hidden="true">&bullet;</span></div>
                  <span class="sr-only"> {% trans %}by{% endtrans %} </span>
                  <div class="teaser__published-author">{{ author }}</div>
                </div>
              {%- endblock -%}
            {% endembed %}

            {% if topic_type %}
              {% embed "node--teaser__field.html.twig" %}
                {%- block field_icon -%} label {%- endblock -%}
                {% block svg_title %} <title>{% trans %} Topic type: {% endtrans %}</title> {% endblock %}
                {%- block field_value -%}
                  <span class="sr-only">{% trans %}Topic type:{% endtrans %}</span>
                  {{ topic_type }}
                {%- endblock -%}
              {% endembed %}
            {% endif %}

          {% endif %}
        </small>
      {% endblock %}

    </div>
  </div>
  <div class="card__actionbar">
    {% block card_actionbar %}

      {% if visibility_icon and visibility_label %}
        <div class="badge teaser__badge no-padding">
        <span class="badge__container">
          <svg class="badge__icon" aria-hidden="true">
            <title>{% trans %}Visibility{% endtrans %}</title>
            <use xlink:href="#icon-{{ visibility_icon }}"></use>
          </svg>
          <span class="sr-only">{% trans %}The visibility of this content is set to {{ visibility_label }}{% endtrans %} </span>
          <span class="badge__label text-gray">{{ visibility_label|capitalize }}</span>
        </span>
        </div>
      {% endif %}

      {% block card_link %}
        {% if not hide_card_link %}
          <a href="{{ url }}" class="card__link" rel="bookmark">
            {% if card_link_label %}
              {{ card_link_label }}
            {% else %}
              {{ 'Read more'|t }}
            {% endif %}
            <span class="visually-hidden">{% trans %}about {{ label }}{% endtrans %} </span>
          </a>
        {% endif %}
      {% endblock %}

    {% endblock %}
  </div>
</div>
