{% include "header" %}
{% include "course_version_outdated_alert", courses: courses.featured %}
<main class="np-main np-homepage">
<div class="np-homepage-hero">
<div class="np-homepage-hero-image">
<img class="np-homepage-hero-image"
    src="{{ homepage.artwork_url }}"
    alt="{{ homepage.headline }}"
    />
</div>
<div class="np-homepage-hero-content">
    <div class="np-homepage-headline np-header-font-color">
    <img src="https://i.imgur.com/TayoEHg.png" style="width: 500px">
    </div>
    <div class="np-homepage-subheadline np-header-font-color">
    {{ homepage.subheadline }}
    </div>
</div>
</div>
</div>
{% include "sub_navigation" %}
<div class="np-homepage-featured np-max-width">
<div class="np-homepage-featured-text">
    <div class="np-homepage-headline">
    {{ homepage.featured_courses_headline }}
    </div>
    <div class="np-homepage-subheadline">
    {{ homepage.featured_courses_subheadline }}
    </div>
</div>
    {% if courses.in_catalog.any? %}
      {% capture course.properties.course_order %}{{ course.properties.course_order | plus: 1 }}{% endcapture %}
    {% assign catalog_courses = courses.in_catalog | sort: "course.properties.course_order" %}
      <div class="np-homepage-featured-courses row">
        {% for course in catalog_courses %}
          <div class="col-xs-12 col-sm-8  col-md-12" style="margin:auto;">
            {% include "cards_featured_course" with course %}
        </div>
    {% endfor %}
    </div>
{% else %}
    <div class="np-homepage-featured-empty">
    <div class="np-zero-state-text">
        {% t .empty, key: current_school.course_vocabulary %}
    </div>
    <img
        class="np-zero-state-courses"
        alt="{% t .empty, key: current_school.course_vocabulary %}"
    />
    </div>
{% endif %}
</div>
{% include "section_popular_topics" %}

{% include "section_professionals" %}

{% include "section_faqs" %}

{% include "section_instructors" %}
</main>
{% include "footer" %}

<style>
.np-card-content-description {
height: 100px;
}
.np-card-content-title {
height: 28px;
}
</style>

<script>
window.onload = function() {
[].slice.call(document.getElementsByClassName("np-card-content-description")).forEach(function(element) {
    if(element.innerText.length > 350){
    element.innerText = element.innerText.slice(0,350) + '...'
    }
});
}
</script>
