/*
 * Legal pages (User Agreement, EN and RU). Tokens, header and base styles come
 * from /styles.css. The agreement is set as a white sheet in both themes, like
 * the invoice paper elsewhere on the site. Sections are numbered because legal
 * text is cited by number; the numbers hang in the left margin on wide screens.
 */

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang__link {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.lang__link:hover {
  color: var(--text);
}

.lang__link[aria-current="page"] {
  background: var(--primary);
  color: var(--primary-fg);
}

.legal {
  padding-block: clamp(32px, 6vw, 88px) clamp(48px, 7vw, 112px);
}

.doc {
  --hang: 56px;

  width: min(100% - 2 * var(--gutter), 860px);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 64px) clamp(32px, 5vw, 72px);
  background: var(--paper);
  color: var(--paper-text);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(23 48 42 / 10%), 0 24px 48px -24px rgb(23 48 42 / 45%);
  counter-reset: section;
}

.doc__head {
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--paper-text);
}

.doc__title {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.doc__meta {
  margin-top: 12px;
  color: var(--paper-muted);
  font-family: var(--font-doc);
  font-size: 0.875rem;
}

.doc__draft {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  font-weight: 700;
  line-height: 1.5;
}

.doc__section {
  position: relative;
  margin-top: 40px;
  counter-increment: section;
}

.doc__heading {
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.doc__heading::before {
  content: counter(section) ".";
  margin-right: 0.6em;
  color: var(--paper-muted);
  font-family: var(--font-doc);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.doc__section p {
  max-width: 40em;
  margin-top: 14px;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.doc__section ul {
  max-width: 40em;
  margin-top: 14px;
  padding-left: 1.25em;
  list-style: disc;
}

.doc__section li {
  margin-top: 10px;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.doc__section a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 1000px) {
  .doc {
    padding-left: calc(64px + var(--hang));
  }

  .doc__heading::before {
    position: absolute;
    left: calc(-1 * var(--hang));
    margin-right: 0;
  }
}

@media print {
  .site-header {
    display: none;
  }

  .legal {
    padding: 0;
  }

  .doc {
    width: 100%;
    padding: 0;
    background: #fff;
    box-shadow: none;
  }

  .doc__draft {
    border: 1px solid #999;
    background: none;
  }
}
