/**
 * @file footer.css
 * Footer region — Figma desktop (1:7825), mobile (1:7638).
 * Dark background, newsletter + logo + nav columns + credits row.
 */

/* -------------------------------------------------------------------------
   Region and container layout (Figma: 3 rows — newsletter, links, credits)
   ------------------------------------------------------------------------- */
.footer-region {
  background-color: var(--background);
  color: var(--foreground);
  padding-block: 5rem;
}

.footer-region .footer__container {
  display: flex;
  flex-direction: column;
  gap: 3rem; /* 48px mobile */
}

@media (min-width: 48rem) {
  .footer-region .footer__container {
    gap: 5rem; /* 80px desktop */
  }
}

/* Row 2: logo + 5 nav columns — grid on desktop */
.footer-region .footer__links {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

@media (min-width: 48rem) {
  .footer-region .footer__links {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    column-gap: 2.5rem; /* 40px Figma */
    row-gap: 0;
  }
}

.footer-region .footer__links-logo {
  min-width: 0;
}

.footer-region .footer__links-col {
  min-width: 0;
}

/* Row 3: credits — divider, legal centered */
.footer-region .footer__credits {
  padding-top: 2rem;
  border-top: 1px solid var(--border-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  width: 100%;
}

.footer__credits-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.footer__copyright {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--foreground);
  margin-top: 1rem;
  opacity: 0.8;
  text-align: center;
}

.footer__connect-social {
  margin-top: 1.25rem;
}

/* Ensure social icons are visible and aligned in the Connect column */
.footer__connect-social .social-media-links--platforms {
  justify-content: flex-start;
  gap: 1rem;
}

/* -------------------------------------------------------------------------
   Newsletter (Figma: content left max 560px, actions right 400px; no radius)
   ------------------------------------------------------------------------- */
.footer-region .footer__newsletter,
.footer-region .footer__newsletter #block-donation-theme-newslettersignup {
  color: var(--foreground);
  line-height: 1.5;
}

.footer-region .footer__newsletter #block-donation-theme-newslettersignup > div,
.footer-region .footer__newsletter-inner > div {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* 12px Figma */
}

@media (min-width: 48rem) {
  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div,
  .footer-region .footer__newsletter-inner > div {
    display: grid;
    grid-template-rows: auto auto;
    gap: 0;
    align-items: start;
    justify-content: space-between;
  }

  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(1),
  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(2),
  .footer-region .footer__newsletter-inner > div > *:nth-child(1),
  .footer-region .footer__newsletter-inner > div > *:nth-child(2) {
    grid-column: 1;
    max-width: 35rem; /* 560px */
  }

  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(1),
  .footer-region .footer__newsletter-inner > div > *:nth-child(1) { grid-row: 1; }
  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(2),
  .footer-region .footer__newsletter-inner > div > *:nth-child(2) { grid-row: 2; }

  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(3),
  .footer-region .footer__newsletter-inner > div > *:nth-child(3) { grid-column: 2; grid-row: 1; }
  .footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(4),
  .footer-region .footer__newsletter-inner > div > *:nth-child(4) { grid-column: 2; grid-row: 2; }
}

/* Title "Stay in the loop" — 18px semibold */
.footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(1),
.footer-region .footer__newsletter-inner > div > *:nth-child(1) {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  margin: 0;
  color: var(--foreground);
}

/* Subtitle — 16px regular */
.footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(2),
.footer-region .footer__newsletter-inner > div > *:nth-child(2) {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  margin: 0.25rem 0 0 0;
  color: var(--foreground);
}

/* Form: input + button row on desktop, 16px gap; no border-radius (Figma) */
.footer-region .footer__newsletter .webform-submission-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  isolation: isolate;
  position: relative;
  z-index: 1;
}

@media (min-width: 48rem) {
  .footer-region .footer__newsletter .webform-submission-form {
    flex-direction: row;
    gap: 1rem; /* 16px Figma */
    align-items: stretch;
  }
}

.footer-region .footer__newsletter .form-item-email {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.footer-region .footer__newsletter .form-email {
  width: 100%;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  padding-block: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--foreground);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-secondary);
  border-radius: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  appearance: none;
}

.footer-region .footer__newsletter .form-email::placeholder {
  color: var(--input);
}

/* Reset form-actions component bleed (Drupal uses .form-actions for submit wrapper) */
.footer-region .footer__newsletter .form-actions {
  margin: 0;
  display: block;
  width: auto;
  flex: none;
  gap: 0;
}

.footer-region .footer__newsletter .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 1.5rem;
  padding-block: 0.625rem;
  min-height: 2.75rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  color: var(--foreground);
  background-color: transparent;
  border: 1.5px solid var(--border-secondary);
  border-bottom-width: 4px;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  appearance: none;
}

@media (max-width: 47.9375rem) {
  .footer-region .footer__newsletter .form-submit {
    width: 100%;
  }
}

/* Tagline — 12px, below form; ensure it never overlaps the form row */
.footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(4),
.footer-region .footer__newsletter-inner > div > *:nth-child(4) {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  margin: 12px 0 0 0;
  color: var(--foreground);
  position: relative;
  z-index: 0;
}

/* Newsletter form wrapper (3rd child) — stacking so input/button stay on top */
.footer-region .footer__newsletter #block-donation-theme-newslettersignup > div > *:nth-child(3),
.footer-region .footer__newsletter-inner > div > *:nth-child(3) {
  isolation: isolate;
  min-height: 0;
}

/* -------------------------------------------------------------------------
   Logo (branding) inside .footer__links-logo
   ------------------------------------------------------------------------- */
.footer-region .footer__links-logo .branding__link {
  display: block;
}

.footer-region .footer__links-logo .branding {
  height: 2.25rem; /* 36px */
  width: 5.25rem; /* 84px */
}

/* -------------------------------------------------------------------------
   Footer nav columns (Organization, Programs, Support, Resources, Connect)
   Inside .footer__links-col — all links always expanded.
   ------------------------------------------------------------------------- */
.footer-region .footer__links-col [id^="block-donation-theme-footer"],
.footer-region .footer__links-col nav {
  min-width: 0;
}

.footer-region .footer__links-col h2 {
  margin: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

/* Menu list */
.footer-region .footer__links-col .menu--level-1 {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Column heading (parent item label) */
.footer-region .footer__links-col .menu__link--level-1 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  color: var(--foreground);
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: default;
  text-align: left;
}

/* Hide menu child chevron SVG in footer (SVG is sibling of link, not inside it) */
.footer-region .menu__item--has-children > svg {
  display: none !important;
}

/* Level 2 list — always visible */
.footer-region .footer__links-col .menu--level-2 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-region .footer__links-col .menu__item--level-2 {
  padding-block: 0.5rem;
}

.footer-region .footer__links-col .menu__link--level-2 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  color: var(--foreground);
  text-decoration: none;
}

.footer-region .footer__links-col .menu__link--level-2:hover {
  text-decoration: underline;
}

/* Nolink span (e.g. copyright) */
.footer-region .footer__links-col .menu__link--nolink.menu__link--level-2 {
  cursor: default;
}

@media (min-width: 48rem) {
  .footer-region .footer__links-col .menu--level-2 {
    margin-top: 1rem;
  }
}

/* -------------------------------------------------------------------------
   Credits: legal links + social (inside .footer__credits-legal / .footer__credits-social)
   ------------------------------------------------------------------------- */
.footer-region .footer__credits-legal .menu--level-1,
.footer-region .footer__credits-legal nav .menu--level-1 {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-region .footer__credits-legal .menu__item--level-1,
.footer-region .footer__credits-legal nav .menu__item--level-1 {
  padding: 0;
}

.footer-region .footer__credits-legal .menu__link--level-1,
.footer-region .footer__credits-legal nav .menu__link--level-1 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  color: var(--foreground);
  text-decoration: none;
}

.footer-region .footer__credits-legal .menu__link--level-1:hover,
.footer-region .footer__credits-legal nav .menu__link--level-1:hover {
  text-decoration: underline;
}

@media (max-width: 47.9375rem) {
  .footer-region .footer__credits-legal .menu--level-1,
  .footer-region .footer__credits-legal nav .menu--level-1 {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Social links block (inside .footer__credits-social) */
.footer-region .footer__credits-social .block-social-media-links,
.footer-region .footer__credits-social #block-donation-theme-socialmedialinks {
  margin: 0;
}

.footer-region .social-media-links--platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-region .social-media-links--platforms a {
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.footer-region .social-media-links--platforms a:hover {
  opacity: 0.85;
}

.footer-region .social-media-links--platforms .fab {
  font-size: 1.5rem;
}

.footer__credits-legal {
  width: 100%;
  text-align: center;
}