{% comment %} Show featured section text if either headline or subheadline are defined {% endcomment %}
{% if homepage.featured_courses_headline and homepage.featured_courses_headline.size > 0 %}
{% assign has_featured_headline = true %}
{% else %}
{% assign has_featured_headline = false %}
{% endif %}
{% if homepage.featured_courses_subheadline and homepage.featured_courses_subheadline.size > 0 %}
{% assign has_featured_subheadline = true %}
{% else %}
{% assign has_featured_subheadline = false %}
{% endif %}
{% if has_featured_headline or has_featured_subheadline %}
{% if homepage.featured_courses_headline and homepage.featured_courses_headline.size > 0 %}
{{ homepage.featured_courses_headline }}
{% endif %}
{% if homepage.featured_courses_subheadline and homepage.featured_courses_subheadline.size > 0 %}
{{ homepage.featured_courses_subheadline }}
{% endif %}
{% endif %}
{% comment %} Add different classes dependant on the number of featured courses. {% endcomment %}
{% assign card_classes = "card--horizontal np-stretch-content" %}
{% case courses.featured.size %}
{% when 3 %}
{% assign card_classes = card_classes | append: " col-lg-4" %}
{% when 2 %}
{% assign card_classes = card_classes | append: " col-md-6" %}
{% endcase %}
{% for course in courses.featured %}
{% include "cards_course", course: course, card_classes: card_classes %}
{% endfor %}
{% endif %}