/* Keep the active brand's fonts, palette and paragraph rhythm.
   The measure is tuned against real line breaks in the storefront fonts. */

/* Native focus and fragment jumps must not compete over a long document. */
html:has(.legal-document) {
  scroll-behavior: auto;
}

.legal-document-frame {
  width: 100%;
  max-width: calc(54ch + 6rem);
  margin-inline: auto;
  padding-inline: 1rem;
}

.legal-document-paper {
  padding: 1.25rem;
}

.legal-document-body {
  overflow-wrap: anywhere;
}

.legal-document-body p {
  text-wrap: pretty;
}

.legal-document-body :is(h2, h3) {
  text-wrap: balance;
  scroll-margin-top: 7rem;
}

#main-content .legal-document .legal-document-paper > .legal-document-title {
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  line-height: 1.2;
  text-wrap: balance;
}

#main-content .legal-document-body a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.075em;
}

.legal-document-body :is(h2, h3):target {
  outline: 2px solid rgb(var(--gaming-400));
  outline-offset: 0.35rem;
}

@media (width >= 640px) {
  .legal-document-paper {
    padding: 2rem;
  }
}

.legal-document-toc {
  margin-block: 0 2rem;
  border-block: 1px solid rgb(var(--professional-700, 51 65 85) / 65%);
  padding-block: 0.5rem;
}

.legal-document-toc summary {
  cursor: pointer;
  min-height: 44px;
  align-content: center;
  font-weight: 600;
}

.legal-document-toc ol {
  list-style: decimal;
  padding-inline-start: 1.5rem;
}

#main-content .legal-document-toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: 0.4rem;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
