/* Sharxora responsive public CTA + footer | 2026-11-08
   Loaded after the public theme layers on Home, Privacy and Terms. */

/* .legal-cta originally used margin:70px 0, overriding .shell's auto
   side margins and pinning the panel to the left edge. */
body[data-guide-context="home"] .legal-cta.shell {
  margin: clamp(36px, 5vw, 70px) auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(20px, 4vw, 52px);
  row-gap: 18px;
  padding: clamp(24px, 3vw, 38px);
}
body[data-guide-context="home"] .legal-cta > div:first-child {
  min-width: 0;
}
body[data-guide-context="home"] .legal-cta p {
  max-width: 62ch;
  font-size: 13px;
  line-height: 1.65;
}
body[data-guide-context="home"] .legal-cta .hero-actions {
  display: flex;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
body[data-guide-context="home"] .legal-cta .hero-actions .btn {
  max-width: 100%;
  text-align: center;
}

/* Readable link sizing and flexible alignment on every public/legal page. */
.footer {
  width: 100%;
  padding: 24px 0 calc(30px + env(safe-area-inset-bottom, 0px));
}
.footer .footer-row {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
}
.footer .footer-row > p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.footer .footer-links {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.footer .footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  .footer .footer-links a:hover {
    background: rgba(129, 182, 255, .1);
  }
}
html[data-forge-theme="light"] .footer .footer-links a:hover {
  background: rgba(33, 94, 166, .08);
}

/* Stack the CTA before its buttons; keep footer links off the viewport edge. */
@media (max-width: 900px) {
  body[data-guide-context="home"] .legal-cta.shell {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  body[data-guide-context="home"] .legal-cta .hero-actions {
    justify-content: flex-start;
  }
  .footer .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer .footer-links {
    justify-content: flex-start;
  }
}
@media (max-width: 620px) {
  body[data-guide-context="home"] .legal-cta.shell {
    margin-block: 38px 46px;
    padding: 23px 18px;
    gap: 20px;
    border-radius: 20px;
  }
  body[data-guide-context="home"] .legal-cta h2 {
    font-size: clamp(22px, 6vw, 26px);
  }
  body[data-guide-context="home"] .legal-cta p {
    font-size: 13px;
    line-height: 1.6;
  }
  body[data-guide-context="home"] .legal-cta .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 10px;
  }
  body[data-guide-context="home"] .legal-cta .hero-actions .btn {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
  }

  /* Bottom clearance keeps fixed Help and Back to Top controls from covering
     tappable footer links on narrow screens and mobile safe-area insets. */
  .footer {
    padding: 26px 0 calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .footer .footer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 16px;
  }
  .footer .footer-row > p {
    text-align: center;
  }
  .footer .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .footer .footer-links a {
    min-width: 0;
    min-height: 44px;
    padding: 11px 8px;
    border: 1px solid rgba(142, 174, 225, .18);
    background: rgba(127, 159, 215, .055);
  }
  html[data-forge-theme="light"] .footer .footer-links a {
    border-color: var(--forge-border, #d8e1ec);
    background: rgba(33, 94, 166, .035);
  }
}
