/* ──────────────────────────────────────────────────────────────────────────
   Shared site footer — used by the homepage (index.html) and every news page
   (news/*). This file owns the footer's structure; each page supplies the theme
   colors through custom properties so the same markup fits the dark homepage and
   the light news pages. Footer markup lives in news/_footer.html (stamped into
   index.html and the news templates by news/generate.py).

   Each page must define, on :root (or a themed scope):
     --footer-fg           footer text + social-icon color
     --footer-fg-hover     social-icon / tooltip hover color
     --footer-rule         divider hairline color
     --footer-tip-bg       tooltip background
     --footer-tip-border   tooltip border
     --footer-tip-fg       tooltip text
     --footer-pbc-fg       "a public benefit corporation" line color
     --footer-pbc-hover    pbc color while the tooltip is hovered
     --footer-icon-filter  filter applied to the resting logo (e.g. none, or
                           brightness(0) saturate(0) to ink a white glyph)
   ────────────────────────────────────────────────────────────────────────── */

footer {
  width: 95%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 0 30px;
}

footer .footer-divider {
  border-top: 1px solid var(--footer-rule);
  padding-top: 12px;
  margin-bottom: 15px;
}

footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: var(--footer-fg);
  font-size: 0.8rem;
}

footer .footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

footer .footer-icon-default {
  opacity: 0.46;
  filter: var(--footer-icon-filter, none);
}

footer a.linkedin,
footer a.x-link {
  color: var(--footer-fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

footer a.linkedin svg,
footer a.x-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

footer .footer-legal {
  display: flex;
  align-items: center;
  gap: 6px;
}

footer a.footer-legal-link {
  color: var(--footer-fg);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}

footer .footer-legal-sep {
  opacity: 0.4;
}

@media (hover: hover) {
  footer a.footer-legal-link:hover {
    opacity: 1;
    color: var(--footer-fg-hover);
  }
}

/* Footer copyright tooltip (footer-scoped so it never touches the news pages'
   citation / sidenote tooltips, which keep their own styles). */
footer .tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

footer .tooltip::before {
  content: "";
  position: absolute;
  inset: -8px -10px;
}

footer .tooltip .tooltiptext {
  visibility: hidden;
  width: 320px;
  background-color: var(--footer-tip-bg);
  border: 1px solid var(--footer-tip-border);
  color: var(--footer-tip-fg);
  text-align: justify;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  border-radius: 3px;
  padding: 1em;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  right: 0;
  opacity: 0;
  font-size: 0.75rem;
  line-height: 1.6;
}

footer .tooltip:hover .tooltiptext,
footer .tooltip.tooltip-open .tooltiptext,
footer .tooltip:has(.tooltiptext:hover) .tooltiptext {
  visibility: visible;
  opacity: 1;
}

footer .pbc {
  font-style: italic;
  font-size: 0.52rem;
  color: var(--footer-pbc-fg);
  letter-spacing: 0.04em;
}

@media (hover: hover) {
  footer a.linkedin:hover,
  footer a.x-link:hover { color: var(--footer-fg-hover); }
  footer .tooltip:hover { color: var(--footer-fg-hover); }
  footer .tooltip:hover .pbc { color: var(--footer-pbc-hover); }
  footer .footer-icon-link:hover .footer-icon-default { opacity: 0 !important; }
  footer .footer-icon-link:hover .footer-icon-hover { opacity: 1 !important; }
}

@media (max-width: 640px) {
  footer { width: 92%; padding: 0 0 20px; }
  footer .footer-divider { padding-top: 9px; margin-bottom: 10px; }
  footer .footer-bottom { flex-direction: row; align-items: center; }
  footer .tooltip .tooltiptext { width: 240px; line-height: 1.4; }
}
