{% assign categories = '' | split: '' %}
{% for cat in course.categories %}
  {% assign cat_name = cat.name | split: '!@#$%^&*()' %}
  {% assign categories = categories | concat: cat_name %}
{% endfor %}
{% assign compressed_image_url = course.image_url | replace: "resize=width:820,height:500", "resize=width:500,height:305" %}
<div class="np-card np-grid-spacing col-xs-12 col-sm-6 col-md-4" filter-type='co' category-name='{{categories | join: '+'}}'>
  <div class="np-card-container">
    {% if course.ribbon %}
      <div class="np-card-ribbon">
        {{ course.ribbon }}
      </div>
    {% endif %}
    <img
      class="np-card-image"
      alt="{{ course.name }}"
      src="{{ compressed_image_url }}"
    >
    <div class="np-card-content np-card-content-vertical np-card-padding">
      <p class='categories'>
        {% for category in course.categories %}
          {{category.name}}   
        {% endfor %}
      </p>
      <h3 class="np-card-content-title">
        {{ course.name }}
      </h3>
      <div class="np-card-content-footer">
        <div class="np-card-content-progress np-button-color">
          {% t shared.progress, count: course.progress %}
        </div>
        {% capture course_path %}{% route course, id: course.id %}{% endcapture %}
        {% if course.has_to_restart? %}
          {% include "course_version_outdated_popup", path: course_path %}
        {% endif %}
        <a class="np-button np-button-wide" href="{{ course_path }}">
          {% t shared.view %}
        </a>
      </div>
    </div>
  </div>
</div>

<style>
  .categories {
    margin: 0;
  }
  .np-card {
    min-height: 0;
    min-width: 0;
  }
  @media screen and (min-width: 768px) {
    .np-grid-spacing {
    padding-left: 3%;
    }
  }
</style>