/* Presentation only. The wording of the legal pages lives in their HTML and stays untouched. */

.legal {
  padding: 3.5rem 0 4.5rem;
}

.legal__title {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  font-weight: 800;
}

.legal__updated {
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.policy-content {
  max-width: 50rem;
  margin-top: 2.5rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.policy-content h2 {
  margin: 3rem 0 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-soft);
  color: var(--color-white);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  overflow-wrap: break-word;
}

.policy-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.policy-content h3 {
  margin: 2.25rem 0 0.75rem;
  color: var(--color-white);
  font-size: 1.125rem;
}

.policy-content h4 {
  margin: 1.75rem 0 0.5rem;
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 700;
}

.policy-content p {
  margin: 0 0 1rem;
}

.policy-content strong {
  color: var(--color-white);
}

.policy-content ul,
.policy-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.policy-content li {
  margin-bottom: 0.5rem;
}

.policy-content a {
  color: var(--color-white);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.policy-content a:hover {
  text-decoration-color: var(--color-white);
}

.cookie-declaration {
  max-width: 50rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
  overflow-x: auto;
}

@media (max-width: 60rem) {
  .legal {
    padding: 2.25rem 0 3rem;
  }

  .policy-content {
    margin-top: 1.75rem;
  }

  .policy-content h2 {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
  }

  .credits-licence {
    padding: 1rem;
    font-size: 0.75rem;
  }

  .credits-section {
    margin-top: 2.5rem;
  }
}

/* Credits keep their source formatting, so licence blocks are printed verbatim. */

.credits-intro {
  max-width: 50rem;
  margin-top: 1.75rem;
  display: grid;
  gap: 1rem;
  color: var(--text-muted);
}

.credits-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
}

.credits-section__title {
  font-size: 1.5rem;
}

.credits-entry {
  margin-top: 2rem;
}

.credits-entry__title {
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
}

.credits-licence {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.875rem;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.credits-list {
  max-width: 62rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.credits-list li {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.credits-list a {
  color: var(--color-white);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
}

.legal.doc-page {
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}

.doc-toc {
  max-width: 50rem;
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.875rem;
  background: var(--surface-raised);
}

.doc-toc__title {
  margin: 0 0 0.75rem;
  color: var(--color-white);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
}

.doc-toc li {
  margin: 0.3rem 0;
  break-inside: avoid;
  color: var(--text-muted);
}

.doc-toc a {
  color: var(--color-white);
  text-decoration: none;
}

.doc-toc a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.policy-content pre.doc-code {
  max-width: 100%;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.875rem;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
}

.policy-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--color-white);
}

.policy-content :not(pre) > code {
  overflow-wrap: anywhere;
}

.policy-content pre code {
  color: inherit;
  font-size: inherit;
}

.doc-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 1.25rem;
  overflow-x: auto;
}

.policy-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.policy-content th,
.policy-content td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.policy-content th {
  color: var(--color-white);
  font-weight: 700;
  background: var(--surface-raised);
}

.policy-content .doc-check {
  list-style: none;
  padding-left: 0;
}

.policy-content .doc-check li {
  position: relative;
  padding-left: 1.75rem;
}

.policy-content .doc-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.15rem;
}

@media (max-width: 40rem) {
  .doc-toc ul {
    columns: 1;
  }

  .doc-toc {
    padding: 1rem;
  }
}
