/* Legal pages (W7): golds `priv`/`terms` (1440) and `privM`/`termsM` (390), Light and Dark, from the D79 frames. The
   header, theme switch and footer come from landing.css; this file adds the title band and the document. The pages
   are generated from legal/ by tools/build-legal.mjs. Line heights are whole pixels, as Figma rounds them. */

/* Title band on the site field: the title, the version line and, on the privacy page, the summary of section 1. */

.legal-band {
  background: var(--r2-site-field);
}

.legal-band__inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 104px 20px 48px;
}

.legal-band__title {
  font-size: 40px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.legal-band__version {
  margin-top: 16px;
  font-size: 16px;
  line-height: 24px;
}

/* The version line is 358 px wide; from a 390 px viewport it keeps one line, as in privM/termsM, using 8 px of the
   right margin. */
@media (min-width: 390px) {
  .legal-band__version {
    white-space: nowrap;
  }
}

.legal-band__summary {
  margin-top: 32px;
  font-size: 17px;
  line-height: 26px;
}

/* Lists: a 24 px mark column and 8 px before the text, 8 px between items. */

.legal-band__summary,
.doc ul,
.doc ol {
  padding: 0;
  list-style: none;
}

.legal-band__summary li,
.doc li {
  position: relative;
  padding-left: 32px;
}

.legal-band__summary li + li,
.doc li + li {
  margin-top: 8px;
}

.legal-band__summary li::before,
.doc ul > li::before {
  content: "•";
  position: absolute;
  left: 0;
}

.doc ol {
  counter-reset: item;
}

.doc ol > li::before {
  counter-increment: item;
  content: counter(item) ".";
  position: absolute;
  left: 0;
}

/* The document: a reading column, sections 64 px apart, tables in their own scrolling region. */

.doc {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  font-size: 17px;
  line-height: 26px;
  overflow-wrap: break-word;
}

.doc > * + * {
  margin-top: 16px;
}

.doc > * + h2,
.doc > * + hr {
  margin-top: 64px;
}

.doc h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 29px;
  scroll-margin-top: 32px;
}

.doc h3,
.doc h4 {
  font-size: 19px;
  font-weight: 700;
  line-height: 29px;
  scroll-margin-top: 32px;
}

.doc strong {
  font-weight: 700;
}

.doc a {
  color: var(--r2-accent-default);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.doc a:hover {
  text-decoration-thickness: 2px;
}

.doc code {
  font: inherit;
}

.doc hr {
  height: 1px;
  margin-bottom: 0;
  border: 0;
  background: var(--r2-border-control);
}

.doc__table {
  overflow-x: auto;
}

.doc__table:focus-visible {
  outline-offset: 2px;
}

.doc table {
  min-width: 640px;
  border: 1px solid var(--r2-border-control);
  border-radius: 16px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;
  line-height: 24px;
}

.doc th,
.doc td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.doc th {
  font-weight: 700;
}

.doc td {
  border-top: 1px solid var(--r2-border-control);
}

@media (min-width: 1024px) {
  /* Right-aligned 44 px before the switch (88 px, 80 px from the edge at 1440), as in priv/terms. */
  .links--legal {
    left: auto;
    right: calc(80 * var(--u) + 132px);
  }

  .legal-band__inner {
    max-width: 1440px;
    padding: 160px calc(120 * var(--u)) 80px;
  }

  .legal-band__title {
    font-size: max(56px, calc(80 * var(--u)));
    line-height: 1.0625;
    letter-spacing: -0.025em;
  }

  .legal-band__summary {
    max-width: 760px;
    font-size: 20px;
    line-height: 30px;
  }

  .doc {
    max-width: 1440px;
    padding: 80px calc(120 * var(--u)) 120px;
  }

  .doc > :not(.doc__table, hr) {
    max-width: 760px;
  }

  .doc h2 {
    font-size: 28px;
    line-height: 34px;
  }

  .doc table {
    width: 100%;
  }
}
