/* Shared styling for the published legal pages.
 *
 * Inlined into each document at build time is deliberately NOT done here: the
 * pages are served as plain static objects from the web bucket, outside the
 * Flutter app's Content-Security-Policy behaviour (/app/*), so a same-origin
 * stylesheet link is allowed and keeps the three documents visually identical
 * without duplicating the rules three times.
 */

:root {
  --bg: #fdfbf7;
  --surface: #ffffff;
  --text: #23201c;
  --muted: #6b625a;
  --rule: #e8e0d4;
  --accent: #d97706;
  --todo-bg: #ffe8a3;
  --todo-text: #7a4b00;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171512;
    --surface: #201d19;
    --text: #ece7e0;
    --muted: #a99f93;
    --rule: #383129;
    --accent: #f5b445;
    --todo-bg: #6b4a00;
    --todo-text: #ffe8a3;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2.5rem 1.25rem 5rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 46rem;
  margin: 0 auto;
}

header {
  border-bottom: 2px solid var(--rule);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.2rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

p,
li {
  margin: 0.65rem 0;
}

ul,
ol {
  padding-left: 1.4rem;
}

a {
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--rule);
}

th {
  background: var(--surface);
  font-weight: 600;
}

/* An unfilled placeholder is styled to be impossible to miss on the published
 * page. Shipping one by accident should look like a bug, not like prose. */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 0.25em;
  white-space: nowrap;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 0.35rem;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

/* Multi-paragraph callouts otherwise pad twice at the top and bottom: once from
 * the box, once from the first and last paragraph's own margin. */
.callout > p:first-child {
  margin-top: 0;
}

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

/* Linked-to from the other document, so it has to be findable once you land on
 * it rather than sitting flush against the section above. */
:target {
  scroll-margin-top: 1.5rem;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  margin-right: 1rem;
}
