/* ============================================================
   VPT Legal Pages — Shared Styles
   Used by: terms-of-use.html, privacy-policy.html
   ============================================================ */

.legal-wrap {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem);
}

.legal-section {
  margin-bottom: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  line-height: 1.3;
}

.legal-h2 .sec-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.legal-h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.75rem 0 0.65rem;
}

.legal-h3:first-child {
  margin-top: 0;
}

.legal-wrap p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 0.875rem;
}

.legal-wrap p:last-child {
  margin-bottom: 0;
}

.legal-wrap ul,
.legal-wrap ol {
  margin: 0.5rem 0 0.875rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-wrap li {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.legal-wrap a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}

@media (hover: hover) {
.legal-wrap a:hover {
  color: var(--white);
}
}

.legal-wrap strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── Callout boxes ─── */
.legal-callout {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.legal-callout--warn {
  border-color: rgba(240, 178, 107, 0.35);
  background: var(--amber-dim);
}

.legal-callout--info {
  border-color: rgba(79, 209, 224, 0.25);
  background: var(--cyan-dim);
}

.legal-callout p,
.legal-callout li {
  font-size: 0.875rem !important;
}

.legal-callout ul {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

.callout-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  display: block;
  margin-bottom: 0.65rem;
}

.legal-callout--warn .callout-title {
  color: var(--amber);
}
.legal-callout--info .callout-title {
  color: var(--cyan);
}

/* ─── Data table (used in Privacy Policy §5) ─── */
.legal-table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-bright);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legal-table th {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-bright);
  white-space: nowrap;
}

.legal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

@media (hover: hover) {
.legal-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
}

/* ─── In-page cross-references and contents (see legal.js) ─── */
.legal-wrap a.legal-xref {
  border-bottom: 1px solid rgba(79, 209, 224, 0.35);
}

.legal-toc a {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.25rem;
  padding: 0.3rem 0 0.3rem 0.75rem;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.legal-toc a span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding-top: 0.1rem;
}
@media (hover: hover) {
.legal-toc a:hover {
  color: var(--text-primary);
  border-left-color: var(--border-bright);
}
}
.legal-toc a[aria-current="true"] {
  color: var(--text-primary);
  border-left-color: var(--cyan);
}
.legal-toc a[aria-current="true"] span {
  color: var(--cyan);
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
}
.legal-toc-title,
.legal-toc--inline summary {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}
.legal-toc-title {
  display: block;
  margin-bottom: 0.75rem;
}

.legal-toc--rail {
  display: none;
}
.legal-toc--inline {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.legal-toc--inline summary {
  cursor: pointer;
  padding: 0.25rem 0;
}
.legal-toc--inline ol {
  margin-top: 0.75rem;
}

@media (min-width: 1360px) {
  .legal-toc--inline {
    display: none;
  }
  .legal-toc--rail {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 220px;
    padding-top: clamp(3rem, 6vw, 5rem);
  }
  .legal-toc-inner {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
  }
}

/* ─── Related legal page ─── */
.legal-related {
  margin-top: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-wrap .legal-related p {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ─── Print / save as PDF: plain dark-on-white document ─── */
@media print {
  .site-nav,
  .site-footer,
  [data-include],
  .legal-toc,
  .hero-grid-bg,
  .legal-related,
  [class*="cookie"],
  [id*="cookie"],
  [class*="consent"],
  [id*="consent"] {
    display: none !important;
  }
  html,
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .page-hero {
    background: none !important;
    padding: 0 0 1rem !important;
    border-bottom: 1px solid #999;
  }
  .page-hero *,
  .legal-wrap * {
    color: #000 !important;
    background: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  .legal-wrap {
    max-width: none;
    padding: 1rem 0 0;
  }
  .legal-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #bbb;
  }
  .legal-h2,
  .legal-h3 {
    break-after: avoid;
  }
  .legal-callout,
  .legal-table tr {
    break-inside: avoid;
  }
  .legal-callout,
  .legal-table-wrap,
  .legal-table th,
  .legal-table td {
    border-color: #999 !important;
  }
  .legal-wrap p,
  .legal-wrap li {
    font-size: 10.5pt !important;
    line-height: 1.5;
  }
  .legal-wrap a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }
  .legal-wrap a.legal-xref {
    border: 0;
  }
  .legal-wrap a.legal-xref::after {
    content: none !important;
  }
}
