/* ============================================================
   TBB Pages: legal documents (bundle "document")
   Markup: components/legal-document.php (Terms, Privacy).
   ~70ch reading column; table of contents sticky beside it on
   desktop, a plain list above it on smaller screens.
   ============================================================ */

.tbb-page .tbb-doc { padding-block: 56px 96px; }

.tbb-page .tbb-doc__head { max-width: calc(736px + 96px); text-align: center; }
.tbb-page .tbb-doc__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--tbb-fg);
  text-wrap: balance;
}
.tbb-page .tbb-doc__updated { margin-top: 12px; font-size: 14px; color: var(--tbb-subtle); }
.tbb-page .tbb-doc__intro { margin-top: 20px; font-size: 17px; line-height: 1.7; color: var(--tbb-muted); }

.tbb-page .tbb-doc__layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 736px);
  justify-content: center;
  gap: 56px;
  margin-top: 56px;
}

/* Table of contents */
.tbb-page .tbb-doc__toc {
  position: sticky;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--tbb-header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--tbb-header-h) - 48px);
  overflow-y: auto;
}
.tbb-page .tbb-doc__toc-title { font-family: var(--tbb-font-display); font-size: 13px; font-weight: 600; color: var(--tbb-fg); }
.tbb-page .tbb-doc__toc ol { display: grid; gap: 2px; margin-top: 12px; border-left: 1px solid var(--tbb-border); }
.tbb-page .tbb-doc__toc a {
  display: block;
  margin-left: -1px;
  padding: 5px 0 5px 14px;
  border-left: 1px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  color: var(--tbb-muted);
  transition: color .2s, border-color .2s;
}
.tbb-page .tbb-doc__toc a:hover { color: var(--tbb-fg); border-left-color: var(--tbb-edge-hover); }
.tbb-page .tbb-doc__toc a span { color: var(--tbb-subtle); font-variant-numeric: tabular-nums; }

/* Body */
.tbb-page .tbb-doc__body { max-width: 70ch; font-size: 16px; line-height: 1.75; color: var(--tbb-muted); }
.tbb-page .tbb-doc__section { scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--tbb-header-h) + 16px); }
.tbb-page .tbb-doc__section + .tbb-doc__section { margin-top: 40px; }
.tbb-page .tbb-doc__section h2 {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--tbb-fg);
}
.tbb-page .tbb-doc__section h2 span { color: var(--tbb-subtle); font-weight: 500; }
.tbb-page .tbb-doc__section p + p,
.tbb-page .tbb-doc__section p + ul,
.tbb-page .tbb-doc__section ul + p { margin-top: 14px; }
.tbb-page .tbb-doc__section ul { display: grid; gap: 6px; }
.tbb-page .tbb-doc__section li { position: relative; padding-left: 20px; }
.tbb-page .tbb-doc__section li::before {
  content: "";
  position: absolute;
  top: .7em;
  left: 4px;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--tbb-subtle);
  border-radius: 1px;
  transform: rotate(45deg);
}
.tbb-page .tbb-doc__section strong { font-weight: 600; color: var(--tbb-fg); }
.tbb-page .tbb-doc :is(.tbb-doc__intro, .tbb-doc__body) a:not(.tbb-link) {
  color: var(--tbb-fg);
  text-decoration: underline;
  text-decoration-color: var(--tbb-edge-hover);
  text-underline-offset: 3px;
  transition: color .2s;
}
.tbb-page .tbb-doc :is(.tbb-doc__intro, .tbb-doc__body) a:not(.tbb-link):hover { color: var(--tbb-brand); }

.tbb-page .tbb-doc__help { margin-top: 48px; }
.tbb-page .tbb-doc__help .tbb-card__title { margin-top: 0; }

@media (min-width: 768px) {
  .tbb-page .tbb-doc { padding-top: 80px; }
  .tbb-page .tbb-doc__title { font-size: 48px; }
}
@media (max-width: 1023px) {
  .tbb-page .tbb-doc__layout { grid-template-columns: minmax(0, 736px); gap: 40px; margin-top: 40px; }
  .tbb-page .tbb-doc__toc { position: static; max-height: none; padding: 20px; border: 1px solid var(--tbb-edge); border-radius: calc(var(--tbb-radius) + 4px); }
}
