/* One footer for every public page.
   Icons are Phosphor regular (MIT), the same weight as a filled UI glyph.
   The app uses Material Symbols Rounded; these are the web match for that job:
   quotes, article, info, lock, question, plus instagram-logo for the
   icon-only social link. */

.foot.site-foot,
.site-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding: 28px 16px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-style: normal;
  box-sizing: border-box;
}

.site-foot-copy {
  display: block;
  width: 100%;
  margin: 0;
  color: #B7B7C2;
  font: 400 12px/1.4 Geist, ui-sans-serif, system-ui, sans-serif;
}

.site-foot-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  gap: 8px;
  width: min(100%, 640px);
  margin: 0;
  padding: 0;
}

.foot.site-foot a,
.site-foot a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #F4F1EA;
  text-decoration: none;
  white-space: nowrap;
  font: 600 14px/1 Geist, ui-sans-serif, system-ui, sans-serif;
  touch-action: manipulation;
  transition: background 140ms ease, border-color 140ms ease;
}

.site-foot a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}

/* Icon-only social link: a 44px circle beside the text pills. */
.foot.site-foot a.site-foot-icon,
.site-foot a.site-foot-icon {
  width: 44px;
  padding: 0;
}

.site-foot a:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #F4F1EA;
}

.site-foot a:focus-visible {
  outline: 2px solid #89B4FA;
  outline-offset: 3px;
}

/* The landing sheet is already padded. Keep the pills clear of the legal line. */
.closing-end .site-foot {
  padding: 4px 0 0;
}

.closing-end .fine {
  margin-top: 14px;
  text-align: center;
}

@media (max-width: 720px) {
  .foot.site-foot {
    align-items: center;
    flex-direction: column;
  }
}

@media (max-width: 839px) {
  .closing-end .site-foot-nav {
    width: min(100%, 720px);
  }
}

/* 320-wide phones: slightly tighter pills so five links wrap to two rows
   and still clear the crate. Height stays 44px; the gap stays 8px. */
@media (max-width: 360px) {
  .chapter[data-chapter="closing"] .site-foot a {
    padding: 0 10px;
  }
}
@media (max-width: 360px) and (max-height: 700px) {
  .chapter[data-chapter="closing"] .site-foot a {
    padding: 0 8px;
  }
}

/* Home, desktop: the same one-row footer as the blog, centered, 32px above
   the bottom. The trademark line sits above the copyright so the pills stay
   the bottom row. */
@media (min-width: 840px) {
  .chapter[data-chapter="closing"] .closing-end {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    max-width: calc(100vw - 48px);
    margin: 0;
    padding: 0;
    pointer-events: none;
  }
  .chapter[data-chapter="closing"] .site-foot {
    position: static;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    pointer-events: auto;
  }
  .chapter[data-chapter="closing"] .site-foot-nav {
    flex-wrap: nowrap;
    width: max-content;
    max-width: 100%;
  }
  .chapter[data-chapter="closing"] .fine {
    order: -1;
    margin: 0 0 12px;
    text-align: center;
    max-width: 62ch;
  }
}
