/* Our legal texts (privacy.html, terms.html), both as a dialog over any of our pages (legal.js)
   and as pages of their own. It uses the pages' tokens; the fallbacks are the same values, for
   the pages of their own, which have no tokens. */

.legal-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--rounded-lg, 0.5rem);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.legal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.legal-dialog__body {
  position: relative;
  padding: 32px;
}

.legal-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--rounded-full, 9999px);
  background: transparent;
  font-size: var(--text-2xl, 1.5rem);
  line-height: 1;
  color: var(--color-text-muted, #3c4045);
  cursor: pointer;
}

.legal-dialog__close:hover {
  background: var(--color-surface, #eeeceb);
  color: var(--color-text-primary, #000000);
}

.legal {
  font-family: var(--typography-body-font-family, 'Alegreya Sans', sans-serif);
  line-height: var(--leading-normal, 1.5);
  color: var(--color-text-primary, #000000);
}

/* The right padding keeps the heading clear of the close button. */
.legal h2 {
  margin: 0 0 8px;
  padding-right: 32px;
  font-family: var(--typography-headings-font-family, 'Poppins', sans-serif);
  font-size: var(--text-2xl, 1.5rem);
  line-height: var(--leading-tight, 1.25);
  color: var(--color-text-heading, #000000);
}

.legal h3 {
  margin: 20px 0 4px;
  font-family: var(--typography-headings-font-family, 'Poppins', sans-serif);
  font-size: var(--text-base, 1rem);
  line-height: var(--leading-snug, 1.375);
  color: var(--color-text-heading, #000000);
}

.legal p {
  margin: 0 0 8px;
  color: var(--color-text-muted, #3c4045);
}

.legal strong {
  color: var(--color-text-primary, #000000);
}

.legal a {
  color: var(--color-text-link, #336099);
}

.legal .legal__updated {
  margin: 20px 0 0;
  font-size: var(--text-sm, 0.875rem);
}

/* A legal text opened on its own: the same box on the pages' grey background. */

.legal-page {
  margin: 0;
  background: var(--color-surface, #eeeceb);
}

.legal-page .legal {
  box-sizing: border-box;
  max-width: 640px;
  margin: 32px auto;
  padding: 32px;
  border-radius: var(--rounded-lg, 0.5rem);
  background: #ffffff;
}

@media (max-width: 520px) {
  .legal-dialog__body {
    padding: 24px 20px;
  }

  .legal-page .legal {
    margin: 16px;
    padding: 24px 20px;
  }
}
