/* Site footer — app/views/shared/_site_footer.html.erb
 *
 * Three bands inside one surface: the link columns, the address block (the
 * Delaware registered office plus the X link) last, and a hairline-separated
 * bottom bar with the copyright and the medical disclaimer.
 * `:footer_extra` (the home page's X feed) renders above all of it.
 */

.app-footer {
  margin-top: auto;
  padding-block: var(--spacing-48);
  background-color: var(--background-surface-1);
  border-top-width: var(--stroke-weight-1);
  border-top-style: solid;
  border-top-color: var(--border-default);
}

.app-footer-inner {
  /* Full-bleed with the nav's own gutters (.main-nav-bar: 16px, 48px from
     tablet up) rather than the 1296px content box, so the first footer column
     starts exactly under the nav's logo at every width. */
  padding-inline: var(--spacing-16);

  @media (min-width: 48rem) { padding-inline: var(--spacing-48); }
}

/* The home page's X feed (`content_for :footer_extra`), when there is one. */
.site-footer-extra { margin-bottom: var(--spacing-48); }

/* ============ Top band: identity + link columns ============ */

/* Stacked on mobile; from tablet up the same shape as .main-nav-bar — link
   columns at the left gutter, the address block pushed to the right one. */
.site-footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-32);

  @media (min-width: 48rem) {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-48);
  }
}

.site-footer-identity { max-width: 24rem; /* Note: keeps the address block from stretching on wide screens */ }

/* <address> defaults to italic in every browser. */
.site-footer-address {
  font-style: normal;
  line-height: 1.5;
}

/* ============ X link ============ */

.site-footer-social {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-12);
  align-self: flex-start;
  padding: var(--spacing-8) var(--spacing-12);
  border-radius: var(--corner-radius-sm);
  border-width: var(--stroke-weight-1);
  border-style: solid;
  border-color: var(--border-default);
  color: var(--text-secondary);
  text-decoration: none;

  &:hover {
    color: var(--text-primary);
    background-color: var(--background-surface-2);
  }
}

.site-footer-social-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.site-footer-social-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.site-footer-social-handle {
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-500);
  color: inherit;
}

.site-footer-social-label {
  font-size: var(--font-size-12);
  color: var(--text-tertiary);
}

/* ============ Link columns ============ */

/* Two columns, each as wide as its longest link, from mobile up. */
.site-footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-32);

  @media (min-width: 48rem) {
    grid-template-columns: repeat(2, max-content);
    gap: var(--spacing-80);
  }
}

.site-footer-list {
  list-style: none;
  padding: var(--spacing-0);
  margin: var(--spacing-0);
}

.site-footer-link {
  font-size: var(--font-size-14);
  color: var(--text-secondary);
  text-decoration: none;

  &:hover {
    color: var(--text-primary);
    text-decoration: underline;
  }
}

/* ============ Bottom bar ============ */

.site-footer-bottom {
  margin-top: var(--spacing-32);
  padding-top: var(--spacing-16);
  border-top-width: var(--stroke-weight-1);
  border-top-style: solid;
  border-top-color: var(--border-default);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);

  @media (min-width: 48rem) {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-24);
  }
}

.site-footer-disclaimer {
  @media (min-width: 48rem) { text-align: right; }
}
