{% if file.media_type and (file.media_type.type == 'image' or file.media_type == 'application/pdf') %}
    <div class="py-2" data-bs-theme="dark">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col">
                    <figure>
                        <a href="{{ file | file | url }}" class="image-link">
                            <picture>
                                {% for size, breakpoint in [(1300, 900), (900, 500)] %}
                                    <source srcset="{{ file | image_resize_cover((size, size)) | url }}" media="(min-width: {{ breakpoint }}px)">
                                {% endfor %}
                                <img src="{{ file | image_resize_cover((500, 500)) | url }}" alt="{{ file.label | localize }}" class="image">
                            </picture>
                        </a>
                        <figcaption class="mt-1">{{ file.label | localize }}</figcaption>
                    </figure>
                </div>
            </div>
        </div>
    </div>
{% endif %}

<div class="file-usage py-2">
    <div class="container">
        <div class="row">
            <div class="col">
                <a href="{{ file | file | url }}" class="file-view-original">{% trans %}View original size{% endtrans %}</a>
            </div>
        </div>
        {% if file.copyright_notice is not none or file.license is not none %}
            <div class="row mt-2">
                {% if file.copyright_notice is not none %}
                    <div class="col col-12 col-lg-6">
                        <h2>{% trans %}Copyright{% endtrans %}</h2>
                        <p>
                            {% if file.copyright_notice.url is not none %}
                                <a href="{{ file.copyright_notice.url | localize }}">
                            {% endif %}
                            {{ file.copyright_notice.summary | localize | html_lang }}
                            {% if file.copyright_notice.url is not none %}
                                </a>
                            {% endif %}
                        </p>
                    </div>
                {% endif %}
                {% if file.license is not none %}
                    <div class="col col-12 col-lg-6">
                        <h2>{% trans %}License{% endtrans %}</h2>
                        <p>
                            {% if file.license.url is not none %}
                                <a href="{{ file.license.url | localize }}">
                            {% endif %}
                            {{ file.license.summary | localize | html_lang }}
                            {% if file.license.url is not none %}
                                </a>
                            {% endif %}
                        </p>
                    </div>
                {% endif %}
            </div>
        {% endif %}
    </div>
</div>
