/* Public legal pages (/privacy/, /terms/, /support/). Builds on landing.css tokens. */

.legal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 20px 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-primary);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.legal-logo {
  height: 32px;
  width: auto;
}

.legal-brand-name {
  font-family: var(--font-decorative);
  font-size: 1.2rem;
  font-weight: 700;
}

.legal-nav {
  display: flex;
  gap: 8px;
}

.legal-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.legal-nav a:hover {
  color: var(--accent-dark);
  background: var(--accent-light);
}

.legal-nav a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.legal-body a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Matches the loading/status banner palette in docs/style_guide.md. */
.legal-draft-banner {
  padding: 12px 40px;
  background: #f5e6c8;
  color: #6b4f2e;
  border-bottom: 1px solid var(--border-primary);
  font-size: 1rem;
  text-align: center;
}

.legal-main {
  flex: 1;
  padding: 48px 24px 64px;
}

.legal-document {
  max-width: 760px;
  margin: 0 auto;
}

.legal-title {
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.legal-effective,
.legal-lede {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.legal-document h2 {
  font-size: 1.35rem;
  margin: 40px 0 12px;
  color: var(--text-primary);
}

.legal-document section {
  scroll-margin-top: 16px;
}

.legal-document a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-document a:hover {
  color: var(--accent-dark);
}

.legal-document ul,
.legal-document ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

.legal-document li {
  margin-bottom: 0.5em;
}

.legal-toc {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin: 24px 0;
}

.legal-toc ol {
  columns: 2;
  column-gap: 32px;
  margin: 0;
}

.legal-toc li {
  break-inside: avoid;
}

.legal-placeholder {
  background: #f5e6c8;
  color: #6b4f2e;
  border-radius: 4px;
  padding: 0 2px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.legal-review {
  border-left: 4px solid #a89580;
  background: var(--bg-feature-alt);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.5;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

.legal-table thead th {
  background: var(--bg-card);
  font-family: var(--font-primary);
  font-weight: 700;
}

.legal-table tbody th {
  font-weight: 600;
  width: 22%;
}

.legal-table tbody tr:last-child th,
.legal-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 768px) {
  .legal-header {
    padding: 16px 20px;
  }

  .legal-draft-banner {
    padding: 12px 20px;
  }

  .legal-main {
    padding: 32px 20px 48px;
  }

  .legal-title {
    font-size: 1.8rem;
  }

  .legal-toc ol {
    columns: 1;
  }

  /* Stack the provider table so it reads without sideways scrolling. */
  .legal-table thead {
    display: none;
  }

  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
  }

  .legal-table tr {
    border-bottom: 1px solid var(--border-light);
    padding: 8px 0;
  }

  .legal-table tbody tr:last-child {
    border-bottom: none;
  }

  .legal-table th,
  .legal-table td {
    border-bottom: none;
    padding: 4px 14px;
  }

  .legal-table tbody th {
    width: 100%;
    font-size: 1.05rem;
  }

  .legal-table td:nth-of-type(1)::before {
    content: "What it does: ";
    font-weight: 600;
  }

  .legal-table td:nth-of-type(2)::before {
    content: "What it receives: ";
    font-weight: 600;
  }
}
