<footer class="site-footer">
    <div class="container footer-inner">
        <div class="footer-grid">
            <section class="footer-about">
                {% include 'partials/brand.html.twig' with { brand_variant: 'footer' } %}
                {% set footer_about_text = footer_about|default('')|trim|replace({"\r\n": "\n", "\r": "\n"}) %}
                {% if footer_about_text %}
                    {% for paragraph in footer_about_text|split("\n\n") %}
                        {% if paragraph|trim %}
                            <p{% if not loop.first %} class="footer-tagline muted"{% endif %}>{{ paragraph|trim|nl2br }}</p>
                        {% endif %}
                    {% endfor %}
                {% elseif site.tagline %}
                    <p class="footer-tagline muted">{{ site.tagline }}</p>
                {% endif %}
            </section>
            <section class="footer-links">
                <h2 class="footer-heading">{{ trans('footer.explore') }}</h2>
                <ul>
                    <li><a href="/">{{ trans('common.boards') }}</a></li>
                    <li><a href="/search">{{ trans('common.search') }}</a></li>
                    {% if not members_only or user %}<li><a href="/feed.xml">{{ trans('footer.rss') }}</a></li>{% endif %}
                    {% if user %}
                        <li><a href="/profile">{{ trans('footer.your_profile') }}</a></li>
                    {% else %}
                        <li><a href="/login">{{ trans('footer.sign_in') }}</a></li>
                        {% if allow_registration %}<li><a href="/register">{{ trans('footer.register') }}</a></li>{% endif %}
                    {% endif %}
                </ul>
            </section>
            <section class="footer-links">
                <h2 class="footer-heading">{% if gdpr_enabled %}{{ trans('footer.privacy_gdpr') }}{% else %}{{ trans('footer.privacy') }}{% endif %}</h2>
                <ul>
                    <li><a href="/privacy">{{ trans('footer.privacy_policy') }}</a></li>
                    <li><a href="/cookies">{{ trans('footer.cookie_policy') }}</a></li>
                    {% if user %}
                        <li><a href="/profile/export">{{ trans('footer.download_data') }}</a></li>
                        <li><a href="/profile">{{ trans('footer.manage_account') }}</a></li>
                    {% endif %}
                </ul>
                {% if gdpr_enabled %}
                    <p class="footer-gdpr-note muted">{{ trans('footer.gdpr_note') }}</p>
                {% endif %}
            </section>
            <section class="footer-links">
                <h2 class="footer-heading">{{ trans('footer.operator') }}</h2>
                <p class="footer-operator">{{ privacy_operator_name }}</p>
                {% if privacy_contact_email %}
                    <p><a href="mailto:{{ privacy_contact_email }}">{{ privacy_contact_email }}</a></p>
                {% endif %}
                {% if site.url %}
                    <p class="muted"><a href="{{ site.url }}" rel="noopener">{{ site.url }}</a></p>
                {% endif %}
                {% include 'partials/locale_switcher.html.twig' with { variant: 'footer' } %}
            </section>
        </div>
        {% for html in plugin_footer_html|default([]) %}
            {{ html|raw }}
        {% endfor %}
        <p class="footer-meta">
            {{ trans('footer.copyright', { year: "now"|date("Y"), operator: privacy_operator_name }) }} · {{ trans('footer.powered_by') }} <a href="https://github.com/YeOK/Latch" rel="noopener">Latch</a>
            {% if gdpr_enabled %} · <button type="button" class="link-button" id="footer-cookie-settings">{{ trans('footer.cookie_settings') }}</button>{% endif %}
        </p>
    </div>
</footer>