/*
 * Typography for the long-form pages — privacy, terms and the guide.
 *
 * Those pages are GENERATED from docs/legal/*.md and docs/GUIDE.md by
 * scripts/build-legal.mjs, which drops marked's plain HTML into `.doc`. This
 * styles that HTML into one readable column. It leans entirely on the variables
 * and reset already in styles.css — so it inherits dark mode for free and adds
 * no colour of its own — and, like the rest of the site, carries no inline
 * anything, which is what lets the strict CSP in `_headers` stand unwidened.
 */

/* The reading column: same width and side gutter for the document and its footer. */
.docwrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.doc {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: 3rem;
}

.doc h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

.doc h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.6em;
  padding-top: 1.4em;
  border-top: 1px solid var(--border);
}

.doc h3 {
  font-size: 1.08rem;
  margin: 1.8em 0 0.4em;
}

.doc p,
.doc li {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.68;
}

.doc p {
  margin: 0 0 1.1em;
}

.doc ul,
.doc ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

.doc li {
  margin: 0.3em 0;
}

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

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

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-high);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

/*
 * A `---` in the source becomes an <hr>, and every h2 already draws its own
 * rule above itself. Where the two meet — at almost every section break — that
 * made two lines with an empty band between them. The h2 gives up its rule
 * there and the <hr> stands for both.
 */
.doc hr + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc blockquote {
  margin: 0 0 1.2em;
  padding: 0.2em 0 0.2em 1em;
  border-left: 3px solid var(--accent-line);
  color: var(--muted);
}

/* Wide tables scroll inside themselves rather than forcing the page to. */
.tablewrap {
  overflow-x: auto;
  margin: 0 0 1.4em;
}

.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  text-align: left;
  padding: 0.55em 0.8em;
  border-bottom: 1px solid var(--border);
}

.doc th {
  color: var(--muted);
  font-weight: 600;
}

/* A quiet footer of cross-links under every document. */
.doc-foot {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
}

.doc-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
}

.doc-foot-links a {
  color: var(--accent);
  text-decoration: none;
}

.doc-foot-links a:hover {
  text-decoration: underline;
}

.doc-foot-note {
  color: var(--faint);
  font-size: 0.9rem;
  line-height: 1.6;
}

.doc-foot-note a {
  color: var(--muted);
}
