{% extends "frontend/base.html" %}
{% load i18n static %}
{% block html_title %}
    {% block page_title %}
        {% translate "Services" %}
    {% endblock page_title %}
{% endblock html_title %}
{% block content %}
    <section class="section">
        <div class="card">
            <div class="card-content">
                <div class="card-body">
                    <form class="search-form" auto-submit>
                        {{ filter_form }}
                    </form>
                </div>
            </div>
        </div>
        {% for service in services %}
            <div class="card col-6 col-lg-3 col-md-4">
                <div class="card-header d-flex align-items-center">
                    {% if service.logo %}
                        <img src="{{ service.logo.url }}"
                             alt="{{ service.name }}"
                             class="me-3"
                             style="max-width: 48px;
                                    max-height: 48px">
                    {% endif %}
                    <div class="d-flex flex-column">
                        <h4 class="mb-0">{{ service.name }}</h4>
                        <small class="text-muted">{{ service.category }}</small>
                    </div>
                </div>
                <div class="card-body">
                    {% if service.description %}<p class="card-text">{{ service.description }}</p>{% endif %}
                </div>
                <div class="card-footer d-flex justify-content-between">
                    <span></span>
                    <a href="{{ service.slug }}/" class="btn btn-light-primary">{% translate "Read More" %}</a>
                </div>
            </div>
        {% empty %}
            <div class="card">
                <div class="card-body">
                    <p>{% translate "No services found." %}</p>
                </div>
            </div>
        {% endfor %}
    </section>
    <script src="{% static "js/autosubmit.js" %}" defer></script>
{% endblock content %}
