/* Terms of Service & Privacy Policy pages (used with site.css + footer.css) */

.legal-hero {
  position: relative;
  z-index: 1;
  padding: 64px 0 36px;
  text-align: center;
}

.legal-hero h1 {
  font-size: 44px;
  margin-bottom: 14px;
}

.legal-hero p {
  font-size: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.legal-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.legal-meta b {
  color: var(--text-body);
  font-weight: 700;
}

.legal-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 20px;
}

/* Table of contents */
.legal-toc {
  position: sticky;
  top: 96px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 16px;
}

.legal-toc h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc;
}

.legal-toc li {
  counter-increment: toc;
}

.legal-toc a {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease;
}

.legal-toc a::before {
  content: counter(toc) ".";
  color: var(--text-muted);
  min-width: 18px;
}

.legal-toc a:hover {
  background: var(--bg-card-hover);
  color: var(--text-heading);
}

/* Document body */
.legal-doc {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  counter-reset: section;
}

.legal-doc section {
  scroll-margin-top: 92px;
  padding: 26px 0;
  border-top: 1px solid var(--border-subtle);
}

.legal-doc section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.legal-doc h2 {
  counter-increment: section;
  font-size: 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.legal-doc h2::before {
  content: counter(section);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.legal-doc h3 {
  font-size: 15px;
  margin: 20px 0 8px;
}

.legal-doc p,
.legal-doc li {
  font-size: 15px;
  line-height: 1.7;
}

.legal-doc p + p,
.legal-doc ul + p,
.legal-doc .legal-table-wrap + p {
  margin-top: 12px;
}

.legal-doc ul {
  margin: 10px 0 0 20px;
}

.legal-doc li + li {
  margin-top: 6px;
}

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

.legal-doc a:hover {
  text-decoration: underline;
}

.legal-doc strong {
  color: var(--text-heading);
}

.legal-doc code {
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-heading);
}

/* "In short" summary box */
.legal-summary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 28px;
}

.legal-summary h3 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.legal-summary ul {
  margin-left: 18px;
}

.callout {
  border-left: 3px solid var(--accent-amber);
  background: rgba(245, 158, 11, 0.07);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-top: 14px;
}

.callout p {
  font-size: 14px;
}

/* Data tables */
.legal-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.55;
}

.legal-table th {
  background: var(--bg-elevated);
  color: var(--text-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* Details the site owner still needs to fill in */
.placeholder {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px dashed rgba(245, 158, 11, 0.6);
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .legal-layout {
    /* minmax(0, ...) lets wide tables scroll inside their box instead of widening the page */
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-toc {
    position: static;
  }

  .legal-toc ol {
    columns: 2;
    column-gap: 12px;
  }
}

@media (max-width: 600px) {
  .legal-hero {
    padding: 40px 0 24px;
  }

  .legal-hero h1 {
    font-size: 32px;
  }

  .legal-doc {
    padding: 24px 18px;
  }

  .legal-toc ol {
    columns: 1;
  }
}
