{% assign activities_count = 0 %}
{% for course_section in course.sections %}
  {% for course_activity in course_section.activities %}
    {% assign activities_count = activities_count | plus: 1 %}
  {% endfor %}
{% endfor %} 

<div class="np-course-details">
    <div class="np-course-detail">                 
        <strong class="np-act-count">{{ activities_count }}</strong>
        <span class="np-details-label">
          {% if activities_count == 1 %}Activity{% else %}Activities{% endif %}
        </span>
    </div>
</div>

<style>
  .np-act-count,
  .np-details-label {
    font-size: 1.125rem;
    color: #fff;
    flex: 0 1 calc(33.33%);
    text-shadow: 1px 1px black;
  }

  @media screen and (min-width: 768px){
    .np-act-count{
      font-size: 1.5rem;
    }
  }
</style>