/* ==========================================================================
   Legal pages (/privacy-policy): table of contents + reading column.
   The copy itself is styled by .rich-text (app.css).
   ========================================================================== */

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-6);
}
@media (min-width: 992px) {
  .legal-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: var(--space-7);
  }
}
@media (min-width: 1280px) {
  .legal-layout {
    gap: var(--space-8);
  }
}

/* Table of contents ------------------------------------------------------- */
.legal-toc {
  padding: 30px 20px 20px;
  border-radius: var(--r-md);
  background: var(--tint);
}
.legal-toc__title {
  margin: 0 0 var(--space-3);
  padding-inline: 12px;
}
.legal-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-toc__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-700);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.35;
  transition: background-color .2s, color .2s;
}
.legal-toc__list a:hover,
.legal-toc__list a:focus-visible {
  background: var(--bg);
  color: var(--blue-500);
}
@media (min-width: 600px) and (max-width: 991px) {
  .legal-toc__list {
    columns: 2;
    column-gap: var(--space-4);
  }
  .legal-toc__list li {
    break-inside: avoid;
  }
}
@media (min-width: 992px) {
  /* Stays in view next to the text; scrolls inside itself on short screens. */
  .legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;   /* never hands its scroll over to the page */
  }
}

/* Reading column ---------------------------------------------------------- */
.legal-body {
  max-width: 760px;
}
.legal-body .legal-updated {
  display: inline-block;
  margin: 0 0 var(--space-6);
  padding: 8px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  color: var(--ink-500);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
}
.legal-section + .legal-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}
.legal-section > h2 {
  margin-top: 0;
}
.legal-section > :last-child {
  margin-bottom: 0;
}
/* The section a visitor jumped to from the contents (or a deep link). */
.legal-section:target > h2 {
  color: var(--blue-500);
}

/* Company details at the end of the policy. */
.legal-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: var(--space-4) 0 0;
  padding: 24px 30px;
  border-left: 4px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--tint);
  list-style: none;
  line-height: 1.5;
}
.legal-contact a {
  overflow-wrap: anywhere;
}
@media (max-width: 479px) {
  .legal-contact {
    padding: 20px;
  }
}

@media print {
  .legal-toc {
    display: none;
  }
}
