{#
/**
 * @file
 * Footer region — markup aligned to Figma (desktop 1:7825, mobile 1:7638).
 * Blocks are exposed per ID via caresphere_theme_preprocess_region() as footer_blocks.
 */
#}
{% set footer_blocks = footer_blocks|default({}) %}
{% set region_classes = [
  'region',
  'region-' ~ region|clean_class,
  'footer-region',
] %}
<div{{ attributes.addClass(region_classes) }}>
  <div class="custom-container footer__container">
    {# Row 1: Newsletter — full width #}
    {% if footer_blocks.caresphere_theme_newslettersignup is defined %}
      <section class="footer__newsletter" aria-labelledby="footer-newsletter-heading">
        <div class="footer__newsletter-inner">
          <h2 id="footer-newsletter-heading" class="visually-hidden">{{ 'Newsletter signup'|t }}</h2>
          {{ footer_blocks.caresphere_theme_newslettersignup }}
        </div>
      </section>
    {% endif %}

    {# Row 2: Logo + 5 nav columns #}
    <div class="footer__links">
      {% if footer_blocks.caresphere_theme_sitebranding_2 is defined %}
        <div class="footer__links-logo">
          {{ footer_blocks.caresphere_theme_sitebranding_2 }}
        </div>
      {% endif %}
      {% if footer_blocks.caresphere_theme_footerorganization is defined %}
        <nav class="footer__links-col" aria-labelledby="footer-organization-heading">
          <h2 id="footer-organization-heading" class="visually-hidden">{{ 'Organization'|t }}</h2>
          {{ footer_blocks.caresphere_theme_footerorganization }}
        </nav>
      {% endif %}
      {% if footer_blocks.caresphere_theme_footerprograms is defined %}
        <nav class="footer__links-col" aria-labelledby="footer-programs-heading">
          <h2 id="footer-programs-heading" class="visually-hidden">{{ 'Programs'|t }}</h2>
          {{ footer_blocks.caresphere_theme_footerprograms }}
        </nav>
      {% endif %}
      {% if footer_blocks.caresphere_theme_footersupport is defined %}
        <nav class="footer__links-col" aria-labelledby="footer-support-heading">
          <h2 id="footer-support-heading" class="visually-hidden">{{ 'Support'|t }}</h2>
          {{ footer_blocks.caresphere_theme_footersupport }}
        </nav>
      {% endif %}
      {% if footer_blocks.caresphere_theme_footerresources is defined %}
        <nav class="footer__links-col" aria-labelledby="footer-resources-heading">
          <h2 id="footer-resources-heading" class="visually-hidden">{{ 'Resources'|t }}</h2>
          {{ footer_blocks.caresphere_theme_footerresources }}
        </nav>
      {% endif %}
      {% if footer_blocks.caresphere_theme_footerconnect is defined %}
        <nav class="footer__links-col" aria-labelledby="footer-connect-heading">
          <h2 id="footer-connect-heading" class="visually-hidden">{{ 'Connect'|t }}</h2>
          {{ footer_blocks.caresphere_theme_footerconnect }}
          <div class="footer__connect-social">
            <ul class="social-media-links--platforms">
              <li><a href="https://www.facebook.com" target="_blank" aria-label="Facebook"><span class="fab fa-facebook-f"></span></a></li>
              <li><a href="https://www.twitter.com" target="_blank" aria-label="Twitter"><span class="fab fa-twitter"></span></a></li>
              <li><a href="https://www.instagram.com" target="_blank" aria-label="Instagram"><span class="fab fa-instagram"></span></a></li>
              <li><a href="https://www.linkedin.com" target="_blank" aria-label="LinkedIn"><span class="fab fa-linkedin-in"></span></a></li>
            </ul>
          </div>
        </nav>
      {% endif %}
    </div>

    {# Row 3: Legal links — now below the line #}
    <div class="footer__credits">
      <div class="footer__credits-legal">
        {% if footer_blocks.caresphere_theme_footer is defined %}
          {{ footer_blocks.caresphere_theme_footer }}
        {% endif %}
        <p class="footer__copyright">@2026 Developed by OpenSenselabs</p>
      </div>
    </div>
  </div>
</div>
