{% load static design_system_tags wagtailcore_tags wagtailimages_tags i18n wagtailuserbar wagtailsettings_tags sass_tags %}

{% get_settings use_default_site=True %}

<!DOCTYPE html>

<html lang="{% get_current_language as LANGUAGE_CODE %}{{ LANGUAGE_CODE }}"
      data-design-system-scheme="system"
      {% block mourning %}{% if settings.wagtail_design_system.WagtailDesignSystemConfig.mourning %}data-design-system-mourning{% endif %}{% endblock mourning %}>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta name="format-detection"
          content="telephone=no,date=no,address=no,email=no,url=no">

    {% block title %}
      <title>
      {% if title %}
        {{ title }} — {{ SITE_CONFIG.site_title }}
      {% else %}
        {{ settings.wagtail_design_system.WagtailDesignSystemConfig.site_title }}
      {% endif %}
      </title>
    {% endblock title %}

    {% design_system_css %}
    
    {% design_system_favicon %}

    {% block extra_css %}
    {% endblock extra_css %}


    {% block tracking %}
      {% if settings.wagtail_design_system.AnalyticsSettings.head_scripts %}
        {{ settings.wagtail_design_system.AnalyticsSettings.head_scripts|safe }}
      {% endif %}
    {% endblock tracking %}

    {% block opengraph %}
    {% endblock opengraph %}

  </head>

  <body>

    {% block skiplinks %}
      {% design_system_skiplinks skiplinks %}
    {% endblock skiplinks %}

    {% block header %}
      {% include "wagtail_design_system/header.html" %}
    {% endblock header %}

    <div class="design-system-container design-system-mt-4w design-system-mb-6w">
      {% block breadcrumb %}
        {% design_system_breadcrumb %}
      {% endblock breadcrumb %}
      <main id="content" role="main">
        {% block content %}
        {% endblock content %}
      </main>
    </div>

    {% design_system_theme_modale %}

    {% if SITE_CONFIG.notice %}
      {% design_system_notice title=SITE_CONFIG.notice %}
    {% endif %}

    {% block header_after %}
      {% wagtailuserbar %}
      {% if settings.wagtail_design_system.WagtailDesignSystemConfig.notice %}
        {% design_system_notice title=settings.wagtail_design_system.WagtailDesignSystemConfig.notice %}
      {% endif %}
    {% endblock header_after %}

    {% block follow_newsletter_social_media %}
      {% if settings.wagtail_design_system.WagtailDesignSystemConfig.show_newsletter_and_social_block %}
        {% include "sites_faciles/follow.html" %}
      {% endif %}
    {% endblock follow_newsletter_social_media %}

    {% block footer %}
      {% include "wagtail_design_system/footer.html" %}
    {% endblock footer %}

    {% design_system_js nonce=request.csp_nonce %}

    {% block extra_js %}
    {% endblock extra_js %}



    {% block body_tracking_scripts %}
      {% if settings.wagtail_design_system.AnalyticsSettings.body_scripts %}
        {{ settings.wagtail_design_system.AnalyticsSettings.body_scripts|safe }}
      {% endif %}
    {% endblock body_tracking_scripts %}

    {# djlint:off #}
    {% block lang %}{% get_current_language as LANGUAGE_CODE %}{{ LANGUAGE_CODE }}{% endblock lang %}
    {# djlint:on #}

  </body>

</html>