/* Legal / contract pages (Terms of Use and Subscription Agreement, etc.)
   Reuses tokens.css + design-system.css; mirrors blog.css's post-hero /
   post-body reading-column proportions so long-form legal text sits inside
   the same visual system as blog posts instead of introducing a new one. */

.legal-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.legal-hero .main-title {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 44px;
}

.legal-hero__desc {
  max-width: 620px;
  color: var(--text-light);
  font-size: 17px;
  line-height: 1.7;
}

.legal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: var(--ink3);
  font-size: 13px;
}

.legal-meta__dot { color: var(--color-neutral-300); }

.legal-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  justify-content: center;
  gap: 56px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 40px 100px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 100px;
}

.legal-toc__label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.legal-toc a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  background: var(--color-bg-secondary);
  color: var(--text);
}

.legal-body {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}

.legal-intro { margin-bottom: 40px; color: var(--text-light); }
.legal-intro p { margin-bottom: 14px; }
.legal-intro p:last-child { margin-bottom: 0; }

.legal-section { margin-bottom: 44px; scroll-margin-top: 100px; }
.legal-section:last-of-type { margin-bottom: 0; }

.legal-section h2 {
  max-width: none;
  margin: 0 0 16px;
  font-size: 26px;
}

.legal-section h3 {
  margin: 24px 0 10px;
  font-size: 18px;
}

.legal-section p { margin-bottom: 14px; }
.legal-section p:last-child { margin-bottom: 0; }

.legal-section ul,
.legal-section ol { margin: 0 0 14px 22px; }
.legal-section li { margin-bottom: 6px; }

.legal-section a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

.legal-definitions {
  display: grid;
  gap: 16px;
  margin: 0 0 8px;
}

.legal-definitions dt { font-weight: 700; color: var(--text); }
.legal-definitions dd { margin: 4px 0 0; color: var(--text-light); }

.legal-footer-note {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.legal-lang-switch {
  display: inline-flex;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 1024px) {
  .legal-shell {
    grid-template-columns: minmax(0, 760px);
    padding-left: 20px;
    padding-right: 20px;
  }
  .legal-toc { display: none; }
}

.legal-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0 28px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--color-bg-surface, #ffffff);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.legal-table th,
.legal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.legal-table th {
  background: var(--color-bg-secondary, #f8f9fa);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

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

.legal-table td {
  color: var(--text);
}

@media (max-width: 640px) {
  .legal-hero { padding: 56px 20px 28px; }
  .legal-hero .main-title { font-size: 32px; }
  .legal-section h2 { font-size: 22px; }
  .legal-table th,
  .legal-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

