{%- from "nationalarchives/components/button/macro.njk" import tnaButton -%}
{%- from "nationalarchives/templates/partials/logo/macro.njk" import tnaLogo -%}

{%- set containerClasses = [params.classes] if params.classes else [] -%}
{%- set classes = containerClasses | join(' ') -%}

{% if "social" in params %}
  {% set social = params.social %}
{% elif params.defaultContent %}
  {% set social = [
    {
      href: "https://twitter.com/UKNatArchives",
      icon: "twitter",
      title: "The National Archives X feed (formerly known as Twitter)",
      shortTitle: "X (formerly Twitter)"
    },
    {
      href: "https://www.youtube.com/c/TheNationalArchivesUK",
      icon: "youtube",
      title: "The National Archives YouTube channel",
      shortTitle: "YouTube"
    },
    {
      href: "https://www.facebook.com/TheNationalArchives",
      icon: "facebook",
      title: "The National Archives Facebook page",
      shortTitle: "Facebook"
    },
    {
      href: "https://www.flickr.com/photos/nationalarchives",
      icon: "flickr",
      title: "The National Archives Flickr feed",
      shortTitle: "Flickr"
    },
    {
      href: "https://www.instagram.com/nationalarchivesuk/",
      icon: "instagram",
      title: "The National Archives Instagram feed",
      shortTitle: "Instagram"
    }
  ] %}
{% else %}
  {% set social = [] %}
{% endif %}

{% if "navigation" in params %}
  {% set navigation = params.navigation %}
{% elif params.defaultContent %}
  {% set navigation = [
    {
      title: "Quick links",
      items: [
        {
          text: "About us",
          href: (params.defaultContentBaseURL or "") ~ "/about-us/"
        },
        {
          text: "Contact us",
          href: (params.defaultContentBaseURL or "") ~ "/contact-us/"
        },
        {
          text: "News",
          href: (params.defaultContentBaseURL or "") ~ "/news/"
        },
        {
          text: "Blogs",
          href: (params.defaultContentBaseURL or "") ~ "/blogs/"
        },
        {
          text: "Podcasts",
          href: (params.defaultContentBaseURL or "") ~ "/explore-the-collection/on-the-record-podcast/"
        },
        {
          text: "Image library",
          href: "https://images.nationalarchives.gov.uk/"
        },
        {
          text: "Press room",
          href: (params.defaultContentBaseURL or "") ~ "/about-us/press-and-media/"
        },
        {
          text: "Jobs",
          href: (params.defaultContentBaseURL or "") ~ "/about-us/working-here-and-opportunities/"
        },
        {
          text: "British citizenship services",
          href: (params.defaultContentBaseURL or "") ~ "/contact-us/british-citizenship-services/"
        },
        {
          text: "Historical Manuscripts Commission",
          href: (params.defaultContentBaseURL or "") ~ "/archives-sector/our-archives-sector-role/historical-manuscripts-commission/"
        }
      ]
    },
    {
      title: "Other websites",
      items: [
        {
          text: "UK Government Web Archive",
          href: (params.defaultContentBaseURL or "") ~ "/webarchive/"
        },
        {
          text: "Legislation.gov.uk",
          href: "https://www.legislation.gov.uk/"
        },
        {
          text: "Find Case Law",
          href: "https://caselaw.nationalarchives.gov.uk/"
        },
        {
          text: "The Gazette",
          href: "https://www.thegazette.co.uk/",
          external: true
        },
        {
          text: "The National Archives Trust",
          href: "https://www.nationalarchivestrust.org.uk/",
          external: true
        },
        {
          text: "Friends of The National Archives",
          href: "https://ftna.org.uk/",
          external: true
        },
        {
          text: "National Archives Design System",
          href: "https://design-system.nationalarchives.gov.uk/"
        }
      ]
    }
  ] %}
{% else %}
  {% set navigation = [] %}
{% endif %}

{% if "legal" in params %}
  {% set legal = params.legal %}
{% elif params.defaultContent %}
  {% set legal = [
    {
      text: "Accessibility statement",
      href: (params.defaultContentBaseURL or "") ~ "/accessibility-statement/"
    },
    {
      text: "Freedom of information",
      href: (params.defaultContentBaseURL or "") ~ "/freedom-of-information/"
    },
    {
      text: "Terms and conditions",
      href: (params.defaultContentBaseURL or "") ~ "/terms-and-conditions/"
    },
    {
      text: "Privacy notice",
      href: (params.defaultContentBaseURL or "") ~ "/terms-and-conditions/privacy-notice/"
    },
    {
      text: "Cookies",
      href: (params.defaultContentBaseURL or "") ~ "/cookies/"
    }
  ] %}
{% else %}
  {% set legal = [] %}
{% endif %}

{% if "showNewsletter" in params %}
  {% set showNewsletter = params.showNewsletter %}
{% elif params.defaultContent %}
  {% set showNewsletter = true %}
{%- else %}
  {% set showNewsletter = false %}
{%- endif %}

{% set cookiesUrl = "" %}
{% if params.themeSelector %}
  {% if "cookiesUrl" in params %}
    {% set cookiesUrl = params.cookiesUrl %}
  {% elif params.defaultContent %}
    {% set cookiesUrl = (params.defaultContentBaseURL or "") ~ "/cookies/" %}
  {%- endif %}
{%- endif %}

<footer class="tna-footer{% if classes %} {{ classes }}{% endif %}" data-module="tna-footer" {%- for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
  {%- if params.themeSelector %}
  <section class="tna-footer__theme-selector tna-background-tint" data-theme-on-load="{{ params.currentTheme or 'light' }}" hidden>
    <div class="tna-container tna-!--padding-vertical-xs">
      <div class="tna-column tna-column--flex-1">
        <h2 class="tna-visually-hidden">Change the site theme</h2>
      </div>
      <div class="tna-column tna-column--full-small tna-column--full-tiny">
        <div class="tna-button-group tna-button-group--small">
          {{ tnaButton({
            text: "System theme",
            iconSvg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="24" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 320C512 214 426 128 320 128L320 512C426 512 512 426 512 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320z" /></svg>',
            title: "Change to using the system theme",
            buttonElement: true,
            plain: params.currentTheme != "system",
            classes: "tna-footer__theme-selector-button",
            attributes: {
              value: "system",
              "aria-current": params.currentTheme == "system"
            }
          }) }}
          {{ tnaButton({
            text: "Light theme",
            iconSvg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="24" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M320 32C328.4 32 336.3 36.4 340.6 43.7L396.1 136.3L500.9 110C509.1 108 517.8 110.4 523.7 116.3C529.6 122.2 532 131 530 139.1L503.7 243.8L596.4 299.3C603.6 303.6 608.1 311.5 608.1 319.9C608.1 328.3 603.7 336.2 596.4 340.5L503.7 396.1L530 500.8C532 509 529.6 517.7 523.7 523.6C517.8 529.5 509 532 500.9 530L396.2 503.7L340.7 596.4C336.4 603.6 328.5 608.1 320.1 608.1C311.7 608.1 303.8 603.7 299.5 596.4L243.9 503.7L139.2 530C131 532 122.4 529.6 116.4 523.7C110.4 517.8 108 509 110 500.8L136.2 396.1L43.6 340.6C36.4 336.2 32 328.4 32 320C32 311.6 36.4 303.7 43.7 299.4L136.3 243.9L110 139.1C108 130.9 110.3 122.3 116.3 116.3C122.3 110.3 131 108 139.2 110L243.9 136.2L299.4 43.6L301.2 41C305.7 35.3 312.6 31.9 320 31.9zM320 176C240.5 176 176 240.5 176 320C176 399.5 240.5 464 320 464C399.5 464 464 399.5 464 320C464 240.5 399.5 176 320 176zM320 416C267 416 224 373 224 320C224 267 267 224 320 224C373 224 416 267 416 320C416 373 373 416 320 416z" /></svg>',
            title: "Change to using the light theme",
            buttonElement: true,
            plain: params.currentTheme and params.currentTheme != "light",
            classes: "tna-footer__theme-selector-button",
            attributes: {
              value: "light",
              "aria-current": not params.currentTheme or params.currentTheme == "light"
            }
          }) }}
          {{ tnaButton({
            text: "Dark theme",
            iconSvg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="24" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576C388.8 576 451.3 548.8 497.3 504.6C504.6 497.6 506.7 486.7 502.6 477.5C498.5 468.3 488.9 462.6 478.8 463.4C473.9 463.8 469 464 464 464C362.4 464 280 381.6 280 280C280 207.9 321.5 145.4 382.1 115.2C391.2 110.7 396.4 100.9 395.2 90.8C394 80.7 386.6 72.5 376.7 70.3C358.4 66.2 339.4 64 320 64z" /></svg>',
            title: "Change to using the dark theme",
            buttonElement: true,
            plain: params.currentTheme != "dark",
            classes: "tna-footer__theme-selector-button",
            attributes: {
              value: "dark",
              "aria-current": params.currentTheme == "dark"
            }
          }) }}
        </div>
        <div class="tna-footer__theme-selector-notice" hidden>
          <p>To save your preference, <button type="button" class="tna-footer__theme-selector-enable-settings-cookies">enable settings cookies</button>. Review your <a href="{{ cookiesUrl }}">cookie preferences</a>.</p>
        </div>
      </div>
    </div>
  </section>
  {%- endif %}
  <div class="tna-footer__inner">
    <div class="tna-container">
      <div class="tna-column tna-column--flex-1" itemscope itemtype="https://schema.org/Organization">
        {{ tnaLogo() }}
        <h2 class="tna-heading-m tna-footer__title" itemprop="name" translate="no">The National Archives</h2>
        <address class="tna-footer__address" translate="no" itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
          <meta itemprop="streetAddress" content="Bessant Drive">
          <span itemprop="addressLocality">Kew</span>, <span itemprop="addressRegion">Richmond</span><br>
          <span itemprop="postalCode">TW9 4DU</span>
          <meta itemprop="addressCountry" content="GB">
        </address>
        <meta itemprop="foundingDate" content="2003-04">
        <div itemprop="parentOrganization" itemscope itemtype="https://schema.org/Organization">
          <meta itemprop="name" content="Department for Culture, Media and Sport">
          <meta itemprop="url" content="https://gov.uk/dcms">
        </div>
        {%- if params.meta %}
        <div class="tna-footer__meta">
          {{ params.meta | safe }}
        </div>
        {%- endif %}
        {%- if social | length %}
          <h3 class="tna-!--visually-hidden">
            Follow us on social media
          </h3>
          <nav class="tna-footer__social" aria-label="Social">
            <ul class="tna-ul tna-ul--plain tna-footer__social-items">
            {%- for item in social %}
              <li class="tna-footer__social-item">
                <a href="{{ item.href }}" class="tna-footer__social-item-link"{%- if item.shortTitle %} aria-label="{{ item.title }}" title="{{ item.title }}"{%- endif %} data-name="{{ item.icon }}">
                  {%- if item.icon == 'twitter' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M453.2 112L523.8 112L369.6 288.2L551 528L409 528L297.7 382.6L170.5 528L99.8 528L264.7 339.5L90.8 112L236.4 112L336.9 244.9L453.2 112zM428.4 485.8L467.5 485.8L215.1 152L173.1 152L428.4 485.8z" /></svg>
                  {%- elif item.icon == 'youtube' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M581.7 188.1C575.5 164.4 556.9 145.8 533.4 139.5C490.9 128 320.1 128 320.1 128C320.1 128 149.3 128 106.7 139.5C83.2 145.8 64.7 164.4 58.4 188.1C47 231 47 320.4 47 320.4C47 320.4 47 409.8 58.4 452.7C64.7 476.3 83.2 494.2 106.7 500.5C149.3 512 320.1 512 320.1 512C320.1 512 490.9 512 533.5 500.5C557 494.2 575.5 476.3 581.8 452.7C593.2 409.8 593.2 320.4 593.2 320.4C593.2 320.4 593.2 231 581.8 188.1zM264.2 401.6L264.2 239.2L406.9 320.4L264.2 401.6z" /></svg>
                  {%- elif item.icon == 'facebook' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 440 146.7 540.8 258.2 568.5L258.2 398.2L205.4 398.2L205.4 320L258.2 320L258.2 286.3C258.2 199.2 297.6 158.8 383.2 158.8C399.4 158.8 427.4 162 438.9 165.2L438.9 236C432.9 235.4 422.4 235 409.3 235C367.3 235 351.1 250.9 351.1 292.2L351.1 320L434.7 320L420.3 398.2L351 398.2L351 574.1C477.8 558.8 576 450.9 576 320z" /></svg>
                  {%- elif item.icon == 'flickr' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M496 96L144 96C117.5 96 96 117.5 96 144L96 496C96 522.5 117.5 544 144 544L496 544C522.5 544 544 522.5 544 496L544 144C544 117.5 522.5 96 496 96zM240.5 256C275.6 256 304 284.4 304 319.5C304 354.6 275.6 383 240.5 383C205.4 383 177 354.6 177 319.5C177 284.4 205.4 256 240.5 256zM399.5 256C434.6 256 463 284.4 463 319.5C463 354.6 434.6 383 399.5 383C364.4 383 336 354.6 336 319.5C336 284.4 364.4 256 399.5 256z" /></svg>
                  {%- elif item.icon == 'instagram' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320.3 205C256.8 204.8 205.2 256.2 205 319.7C204.8 383.2 256.2 434.8 319.7 435C383.2 435.2 434.8 383.8 435 320.3C435.2 256.8 383.8 205.2 320.3 205zM319.7 245.4C360.9 245.2 394.4 278.5 394.6 319.7C394.8 360.9 361.5 394.4 320.3 394.6C279.1 394.8 245.6 361.5 245.4 320.3C245.2 279.1 278.5 245.6 319.7 245.4zM413.1 200.3C413.1 185.5 425.1 173.5 439.9 173.5C454.7 173.5 466.7 185.5 466.7 200.3C466.7 215.1 454.7 227.1 439.9 227.1C425.1 227.1 413.1 215.1 413.1 200.3zM542.8 227.5C541.1 191.6 532.9 159.8 506.6 133.6C480.4 107.4 448.6 99.2 412.7 97.4C375.7 95.3 264.8 95.3 227.8 97.4C192 99.1 160.2 107.3 133.9 133.5C107.6 159.7 99.5 191.5 97.7 227.4C95.6 264.4 95.6 375.3 97.7 412.3C99.4 448.2 107.6 480 133.9 506.2C160.2 532.4 191.9 540.6 227.8 542.4C264.8 544.5 375.7 544.5 412.7 542.4C448.6 540.7 480.4 532.5 506.6 506.2C532.8 480 541 448.2 542.8 412.3C544.9 375.3 544.9 264.5 542.8 227.5zM495 452C487.2 471.6 472.1 486.7 452.4 494.6C422.9 506.3 352.9 503.6 320.3 503.6C287.7 503.6 217.6 506.2 188.2 494.6C168.6 486.8 153.5 471.7 145.6 452C133.9 422.5 136.6 352.5 136.6 319.9C136.6 287.3 134 217.2 145.6 187.8C153.4 168.2 168.5 153.1 188.2 145.2C217.7 133.5 287.7 136.2 320.3 136.2C352.9 136.2 423 133.6 452.4 145.2C472 153 487.1 168.1 495 187.8C506.7 217.3 504 287.3 504 319.9C504 352.5 506.7 422.6 495 452z" /></svg>
                  {%- elif item.icon == 'rss' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M160 96C124.7 96 96 124.7 96 160L96 480C96 515.3 124.7 544 160 544L480 544C515.3 544 544 515.3 544 480L544 160C544 124.7 515.3 96 480 96L160 96zM192 200C192 186.7 202.7 176 216 176C353 176 464 287 464 424C464 437.3 453.3 448 440 448C426.7 448 416 437.3 416 424C416 313.5 326.5 224 216 224C202.7 224 192 213.3 192 200zM192 296C192 282.7 202.7 272 216 272C299.9 272 368 340.1 368 424C368 437.3 357.3 448 344 448C330.7 448 320 437.3 320 424C320 366.6 273.4 320 216 320C202.7 320 192 309.3 192 296zM192 416C192 398.3 206.3 384 224 384C241.7 384 256 398.3 256 416C256 433.7 241.7 448 224 448C206.3 448 192 433.7 192 416z" /></svg>
                  {%- elif item.icon == 'github' %}
                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="32" aria-hidden="true" focusable="false"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M237.9 461.4C237.9 463.4 235.6 465 232.7 465C229.4 465.3 227.1 463.7 227.1 461.4C227.1 459.4 229.4 457.8 232.3 457.8C235.3 457.5 237.9 459.1 237.9 461.4zM206.8 456.9C206.1 458.9 208.1 461.2 211.1 461.8C213.7 462.8 216.7 461.8 217.3 459.8C217.9 457.8 216 455.5 213 454.6C210.4 453.9 207.5 454.9 206.8 456.9zM251 455.2C248.1 455.9 246.1 457.8 246.4 460.1C246.7 462.1 249.3 463.4 252.3 462.7C255.2 462 257.2 460.1 256.9 458.1C256.6 456.2 253.9 454.9 251 455.2zM316.8 72C178.1 72 72 177.3 72 316C72 426.9 141.8 521.8 241.5 555.2C254.3 557.5 258.8 549.6 258.8 543.1C258.8 536.9 258.5 502.7 258.5 481.7C258.5 481.7 188.5 496.7 173.8 451.9C173.8 451.9 162.4 422.8 146 415.3C146 415.3 123.1 399.6 147.6 399.9C147.6 399.9 172.5 401.9 186.2 425.7C208.1 464.3 244.8 453.2 259.1 446.6C261.4 430.6 267.9 419.5 275.1 412.9C219.2 406.7 162.8 398.6 162.8 302.4C162.8 274.9 170.4 261.1 186.4 243.5C183.8 237 175.3 210.2 189 175.6C209.9 169.1 258 202.6 258 202.6C278 197 299.5 194.1 320.8 194.1C342.1 194.1 363.6 197 383.6 202.6C383.6 202.6 431.7 169 452.6 175.6C466.3 210.3 457.8 237 455.2 243.5C471.2 261.2 481 275 481 302.4C481 398.9 422.1 406.6 366.2 412.9C375.4 420.8 383.2 435.8 383.2 459.3C383.2 493 382.9 534.7 382.9 542.9C382.9 549.4 387.5 557.3 400.2 555C500.2 521.8 568 426.9 568 316C568 177.3 455.5 72 316.8 72zM169.2 416.9C167.9 417.9 168.2 420.2 169.9 422.1C171.5 423.7 173.8 424.4 175.1 423.1C176.4 422.1 176.1 419.8 174.4 417.9C172.8 416.3 170.5 415.6 169.2 416.9zM158.4 408.8C157.7 410.1 158.7 411.7 160.7 412.7C162.3 413.7 164.3 413.4 165 412C165.7 410.7 164.7 409.1 162.7 408.1C160.7 407.5 159.1 407.8 158.4 408.8zM190.8 444.4C189.2 445.7 189.8 448.7 192.1 450.6C194.4 452.9 197.3 453.2 198.6 451.6C199.9 450.3 199.3 447.3 197.3 445.4C195.1 443.1 192.1 442.8 190.8 444.4zM179.4 429.7C177.8 430.7 177.8 433.3 179.4 435.6C181 437.9 183.7 438.9 185 437.9C186.6 436.6 186.6 434 185 431.7C183.6 429.4 181 428.4 179.4 429.7z" /></svg>
                  {%- endif %}
                  <span class="tna-footer__social-item-link-text">
                    {{ item.shortTitle or item.title }}
                  </span>
                </a>
              </li>
            {%- endfor %}
            </ul>
          </nav>
        {%- endif %}
      </div>
      {%- if navigation | length %}
      <div class="tna-footer__navigation tna-column tna-column--flex-2 tna-column--full-medium tna-column--full-small tna-column--full-tiny tna-columns tna-columns--2 tna-columns--1-tiny">
        {%- for group in navigation %}
        <nav class="tna-footer__navigation-block tna-columns__block" aria-label="{{ group.title }}">
          {%- if not group.hideTitle %}
          <h3 class="tna-footer__navigation-block-heading tna-heading-m">
            {{ group.title }}
          </h3>
          {%- endif %}
          <ul class="tna-footer__navigation-block-items tna-ul tna-ul--plain">
          {%- for item in group.items %}
            <li class="tna-footer__navigation-block-item">
              <a href="{{ item.href }}" class="tna-footer__navigation-block-item-link"{%- if item.title or item.newTab %} aria-label="{{ item.title if item.title else item.text }}{%- if item.newTab %} (opens in new tab){% endif %}" title="{{ item.title if item.title else item.text }}{%- if item.newTab %} (opens in new tab){% endif %}"{% endif %}{%- if item.newTab %} target="_blank"{% endif %}{%- if item.external %} rel="noreferrer nofollow noopener"{% endif %}>
                {{ item.text }}
              </a>
            </li>
          {%- endfor %}
          </ul>
        </nav>
        {%- endfor %}
      </div>
      {%- endif %}
      {%- if showNewsletter %}
      <div class="tna-column tna-column--flex-1">
        <div class="tna-footer__mailing-list">
          <h3 class="tna-footer__navigation-block-heading tna-heading-m">
            Sign up to our emails
          </h3>
          <p>
            Hear about our latest news, stories from the collection and priority booking for events.
          </p>
          <div class="tna-button-group">
            {{ tnaButton({
              text: "Subscribe",
              href: "https://pages.enews.nationalarchives.gov.uk/pages/subscribe",
              attributes: {
                "aria-label": "Subscribe to the National Archives newsletter",
                rel: "noreferrer nofollow noopener"
              }
            }) | indent(10) }}
          </div>
        </div>
      </div>
      {%- endif %}
    </div>
    <div class="tna-container">
      {%- if legal | length %}
      <h3 class="tna-!--visually-hidden">
        Legal information
      </h3>
      <nav class="tna-footer__legal tna-column tna-column--full" aria-label="Legal">
        <ul class="tna-footer__legal-items tna-ul tna-ul--plain">
          {%- for item in legal %}
          <li class="tna-footer__legal-item">
            <a href="{{ item.href }}" class="tna-footer__legal-item-link" {%- if item.title %} title="{{ item.title }}"{% endif %}>
              {{ item.text }}
            </a>
          </li>
          {%- endfor %}
        </ul>
        <hr>
      </nav>
      {%- else %}
      <div class="tna-column--full">
        <hr>
      </div>
      {%- endif %}
    </div>
    <div class="tna-container tna-footer__licence">
      <div class="tna-column tna-column--full-tiny">
        <svg class="tna-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 483.2 195.7" width="60" height="24">
          <title>Open Government Licence</title>
          <path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
        </svg>
      </div>
      <div class="tna-column tna-column--flex-1">
        <p>All content is available under the <a href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" class="tna-footer__link">Open Government Licence v3.0</a>, except where otherwise stated</p>
      </div>
      <div class="tna-column tna-column--full-small tna-column--full-tiny tna-footer__govuk">
        <a href="https://www.gov.uk/" class="tna-footer__govuk-link">
          <svg aria-hidden="true" class="tna-footer__govuk-logotype-crown" width="32" height="30" focusable="false" viewBox="0 0 32 30" xmlns="http://www.w3.org/2000/svg">
            <title translate="no">GOV.UK</title>
            <path d="M22.6 10.4c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m-5.9 6.7c-.9.4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m10.8-3.7c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s0 2-1 2.4m3.3 4.8c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4M17 4.7l2.3 1.2V2.5l-2.3.7-.2-.2.9-3h-3.4l.9 3-.2.2c-.1.1-2.3-.7-2.3-.7v3.4L15 4.7c.1.1.1.2.2.2l-1.3 4c-.1.2-.1.4-.1.6 0 1.1.8 2 1.9 2.2h.7c1-.2 1.9-1.1 1.9-2.1 0-.2 0-.4-.1-.6l-1.3-4c-.1-.2 0-.2.1-.3m-7.6 5.7c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s0 2 1 2.4m-5 3c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s.1 2 1 2.4m-3.2 4.8c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s0 2 1 2.4m14.8 11c4.4 0 8.6.3 12.3.8 1.1-4.5 2.4-7 3.7-8.8l-2.5-.9c.2 1.3.3 1.9 0 2.7-.4-.4-.8-1.1-1.1-2.3l-1.2 4c.7-.5 1.3-.8 2-.9-1.1 2.5-2.6 3.1-3.5 3-1.1-.2-1.7-1.2-1.5-2.1.3-1.2 1.5-1.5 2.1-.1 1.1-2.3-.8-3-2-2.3 1.9-1.9 2.1-3.5.6-5.6-2.1 1.6-2.1 3.2-1.2 5.5-1.2-1.4-3.2-.6-2.5 1.6.9-1.4 2.1-.5 1.9.8-.2 1.1-1.7 2.1-3.5 1.9-2.7-.2-2.9-2.1-2.9-3.6.7-.1 1.9.5 2.9 1.9l.4-4.3c-1.1 1.1-2.1 1.4-3.2 1.4.4-1.2 2.1-3 2.1-3h-5.4s1.7 1.9 2.1 3c-1.1 0-2.1-.2-3.2-1.4l.4 4.3c1-1.4 2.2-2 2.9-1.9-.1 1.5-.2 3.4-2.9 3.6-1.9.2-3.4-.8-3.5-1.9-.2-1.3 1-2.2 1.9-.8.7-2.3-1.2-3-2.5-1.6.9-2.2.9-3.9-1.2-5.5-1.5 2-1.3 3.7.6 5.6-1.2-.7-3.1 0-2 2.3.6-1.4 1.8-1.1 2.1.1.2.9-.3 1.9-1.5 2.1-.9.2-2.4-.5-3.5-3 .6 0 1.2.3 2 .9l-1.2-4c-.3 1.1-.7 1.9-1.1 2.3-.3-.8-.2-1.4 0-2.7l-2.9.9C1.3 23 2.6 25.5 3.7 30c3.7-.5 7.9-.8 12.3-.8" fill="currentColor" fill-rule="evenodd" />
          </svg>
          GOV.UK
        </a>
      </div>
    </div>
  </div>
</footer>
