/* Eartrax legal pages — /eartrax/privacy/ and /eartrax/terms/
   Reuses the landing page tokens from ../styles.css and only adds the
   typography a long legal document needs. */

.doc {
  max-width: 800px;
  padding: 60px 0 40px;
}

.doc-head {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}

.doc-head h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  margin-bottom: 14px;
}

.doc-lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
}

.doc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
  margin: 28px 0 0;
}

.doc-meta div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.doc-meta dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.doc-meta dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.doc-meta code {
  font-size: 0.8em;
}

.doc h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin: 42px 0 14px;
  scroll-margin-top: 96px;
}

.doc h2:first-of-type {
  margin-top: 0;
}

.doc p {
  color: #ded9d9;
  margin-bottom: 14px;
}

.doc p + p {
  margin-top: 4px;
}

.doc ul {
  margin: 0 0 16px;
  padding-left: 22px;
  color: #ded9d9;
}

.doc li {
  margin-bottom: 10px;
  padding-left: 2px;
}

.doc li::marker {
  color: var(--primary);
}

.doc strong {
  color: var(--text);
  font-weight: 650;
}

.doc code {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: #2a2527;
  border: 1px solid var(--border);
  color: #ffb9ae;
  overflow-wrap: anywhere;
}

.doc a {
  color: var(--primary-2);
  text-underline-offset: 2px;
}

.doc a:hover {
  color: #ff8b83;
}

.doc a.btn,
.doc a.btn:hover {
  color: #fff;
  text-decoration: none;
}

.doc .muted {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Summary callout */

.doc-summary {
  padding: 22px 24px;
  border: 1px solid rgba(240, 68, 68, 0.35);
  border-radius: var(--radius);
  background:
    radial-gradient(
      120% 120% at 0% 0%,
      rgba(240, 68, 68, 0.16) 0%,
      rgba(23, 23, 25, 0) 62%
    ),
    var(--surface);
}

.doc-summary h2 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-2);
}

.doc-summary ul {
  margin: 0;
}

.doc-summary li:last-child {
  margin-bottom: 0;
}

/* Permission table */

.doc-table {
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.doc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 420px;
}

.doc-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.doc-table td {
  padding: 11px 16px;
  border-bottom: 1px solid #2b2426;
  color: #ded9d9;
  vertical-align: top;
}

.doc-table code {
  font-size: 0.76em;
  white-space: nowrap;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

/* Contact + back link */

.doc-contact {
  padding: 20px;
  margin: 18px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.doc-contact .btn {
  margin-bottom: 12px;
}

.doc-back {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .doc {
    padding: 40px 0 28px;
  }

  .doc-summary {
    padding: 18px;
  }

  .doc h2 {
    margin-top: 34px;
  }

  .doc-table table {
    min-width: 360px;
  }
}

/* Below this width a two-column meta grid is narrower than the package
   name, which then breaks in the middle of a word. */
@media (max-width: 560px) {
  .doc-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-meta dd {
    overflow-wrap: break-word;
  }
}
