/* DSP Sync's Privacy Policy and Terms of Use pages, and the small links to
   them at the bottom of the pages visitors see. Easy reading on a phone:
   one narrow column, roomy lines, and headings that stand out. */

.legal-document {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  color: var(--color-base-content);
  font-size: 1rem;
  line-height: 1.65;

  & h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
  }

  & h2 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
  }

  & p,
  & ul {
    margin-bottom: 1rem;
  }

  & ul {
    padding-left: 1.25rem;
    list-style: disc;
  }

  & li {
    margin-bottom: 0.375rem;
  }

  & a {
    color: color-mix(in oklab, var(--color-primary) 65%, black);
    text-decoration: underline;
    overflow-wrap: anywhere;
  }

  @media (min-width: 768px) {
    padding-top: 3rem;

    & h1 {
      font-size: 2.25rem;
    }
  }
}

/* The two pages link to each other at the top, so a reader can switch
   without scrolling to the end. The page you are on is filled in. */
.legal-document .legal-document__switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;

  & a {
    padding: 0.5rem 1rem;
    border: 1px solid color-mix(in oklab, var(--color-primary) 65%, black);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
  }

  & a[aria-current="page"] {
    background: color-mix(in oklab, var(--color-primary) 65%, black);
    color: white;
  }
}

/* Moving between the legal pages starts at the top of the new page right
   away. The app's smooth scrolling would otherwise slide it up from where
   the reader left the old page. */
html:has(.legal-document) {
  scroll-behavior: auto;
}

.legal-document__version {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: color-mix(in oklab, var(--color-base-content) 80%, transparent);
}

.legal-links {
  padding: 1.5rem 1rem;
  border-top: 1px solid color-mix(in oklab, var(--color-base-content) 15%, transparent);
  color: color-mix(in oklab, var(--color-base-content) 80%, transparent);
  font-size: 0.875rem;
  text-align: center;

  & nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
  }

  & a {
    color: inherit;
    text-decoration: underline;
    padding: 0.5rem 0;
  }

  & a:hover {
    color: var(--color-base-content);
  }
}
