/*
 * The legal pages: one column at a comfortable measure, generous leading and
 * numbered sections that can be linked to. Deliberately not small print.
 */

.legal {
  padding-block: 26px 90px;
}

/*
 * Two columns on wide screens: the contents stay in view on the left while the
 * text runs at a reading measure on the right. Pages without contents (the
 * imprint) keep one centred column.
 */
.legal-inner {
  max-width: 760px;
  margin-inline: auto;
}
.legal-inner:has(.legal-toc) {
  max-width: 1120px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.legal-inner:has(.legal-toc) > .legal-head {
  grid-column: 1 / -1;
}
.legal-inner:has(.legal-toc) > .legal-body {
  max-width: 72ch;
}

.legal-head {
  padding: 24px 0 34px;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 40px;
}
.legal-head h1 {
  margin: 12px 0 0;
  font-size: clamp(28px, 4.4vw, 48px);
  /* German compounds ("Geschäftsbedingungen") are wider than a phone at this
   * size. The heading carries lang="de", so the browser hyphenates in German. */
  hyphens: auto;
  overflow-wrap: anywhere;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.legal-meta {
  display: inline-flex;
  margin: 18px 0 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.legal-head .lang-legal-note {
  max-width: 64ch;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
}

/* The contents: quiet, numbered, and following the reader on wide screens. */
.legal-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 6px;
  /* A thin bar that shows itself only while the reader is over the contents. */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s;
}
.legal-toc:hover,
.legal-toc:focus-within {
  scrollbar-color: var(--border-primary) transparent;
}
.legal-toc ol {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border-primary);
}
.legal-toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.legal-toc a:hover {
  color: var(--text-primary);
}
.legal-toc a[aria-current="true"] {
  border-left-color: var(--text-primary);
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 960px) {
  .legal-inner:has(.legal-toc) {
    display: block;
    max-width: 760px;
  }
  .legal-toc {
    position: static;
    max-height: none;
    margin: 0 0 40px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
  }
  .legal-toc ol {
    border-left: 0;
  }
  .legal-toc a {
    padding: 5px 0;
    border-left: 0;
    margin-left: 0;
  }
}

.legal-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.legal-body h2 {
  margin: 52px 0 14px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  scroll-margin-top: 90px;
}
.legal-body h2:first-child {
  margin-top: 0;
}
.legal-body h3 {
  margin: 26px 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.legal-body p {
  margin: 0 0 14px;
}
.legal-body ul,
.legal-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legal-body li {
  line-height: 1.7;
}
.legal-body a {
  text-decoration: underline;
}
.legal-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Addresses and figures stand out from the paragraph, so a reader copying one
   can see where it ends. */
.legal-body address {
  font-style: normal;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-primary);
}

.legal-body dl {
  margin: 0 0 18px;
}
.legal-body dl > div {
  display: flex;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-secondary);
}
.legal-body dl > div:last-child {
  border-bottom: 0;
}
.legal-body dt {
  flex: none;
  width: 190px;
  font-weight: 600;
  color: var(--text-primary);
}
.legal-body dd {
  margin: 0;
  flex: 1;
}

/* The one box: things a reader must not skim past. */
.legal-note {
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
}
.legal-note p:last-child {
  margin-bottom: 0;
}
.legal-note-strong {
  border-color: var(--text-primary);
  background: var(--bg-card);
}

/* The withdrawal form is meant to be cut out and sent, so it is boxed like one. */
.legal-form {
  margin: 22px 0;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px dashed var(--text-faint);
  font-family: var(--font-sub);
  font-size: 13px;
  line-height: 1.85;
}
.legal-form p {
  margin: 0 0 12px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--border-secondary);
  vertical-align: top;
}
.legal-table th {
  font-weight: 600;
  color: var(--text-primary);
}
.legal-table-wrap {
  overflow-x: auto;
}

.legal-updated {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border-primary);
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .legal-body dl > div {
    flex-direction: column;
    gap: 4px;
  }
  .legal-body dt {
    width: auto;
  }
}

/* Short pages keep the footer at the bottom of the window instead of ending mid-screen. */
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main {
  flex: 1 0 auto;
  width: 100%;
}
