/* ============================================================
   CityFrame — legal and help pages (privacy, terms, support).
   Loaded after /base.css, which holds the tokens, base type,
   brand mark, skip link and container. Only document layout
   lives here.
   ============================================================ */
:root {
  --line-strong: #b8c0dc;
  --measure: 68ch;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--ink);
}

/* ---------- Document ---------- */
.legal {
  padding-block: clamp(48px, 7vw, 88px) clamp(64px, 9vw, 112px);
}

.legal-head {
  max-width: var(--measure);
  margin-bottom: 48px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-head h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
}

/* The headings' second word, kept as markup from the old design. */
.serif {
  color: var(--ink-2);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 24px 0 0;
  color: var(--ink-3);
  font-size: 15px;
}

.lede {
  margin: 24px 0 0;
  color: var(--ink-2);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Two columns: sticky table of contents and the text. */
.legal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
}

@media (min-width: 960px) {
  .legal-body {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 88px;
  }
}

.toc {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 12px;
  color: var(--ink-3);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc ol,
.toc ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  font-size: 15px;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  color: var(--ink-2);
  line-height: 1.35;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc);
  flex: none;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--ink);
}

.prose {
  max-width: var(--measure);
  counter-reset: section;
}

.prose section {
  padding-top: 48px;
  scroll-margin-top: 88px;
}

.prose section:first-child {
  padding-top: 0;
}

.prose h2 {
  margin: 0 0 16px;
  counter-increment: section;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.prose h2::before {
  content: counter(section) ". ";
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.prose h3 {
  margin: 32px 0 12px;
  font-size: 19px;
  line-height: 1.3;
}

.prose p,
.prose li {
  color: var(--ink-2);
  text-wrap: pretty;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 1.15em;
}

.prose li::marker {
  color: var(--ink-3);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}

.prose a:hover,
.prose a:focus-visible {
  text-decoration-color: var(--accent-text);
}

code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  word-break: break-word;
}

.callout {
  margin: 0 0 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

/* Placeholder that must be replaced before publishing. */
.todo {
  padding: 0 3px;
  border-bottom: 1px dashed var(--danger-text);
  border-radius: 3px;
  background: var(--danger-bg);
  color: var(--ink);
}

/* ---------- Table ---------- */
.table-wrap {
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--ground);
  font-weight: 600;
  white-space: nowrap;
}

tbody td {
  color: var(--ink-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- Footer ---------- */
footer {
  padding-block: 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 15px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ink);
}
