@import url("home.css");
@import url("textcase-chrome.css");

/* MX Labs legal pages — site header + docs-style layout */

:root {
  --wrap: calc(1100px * var(--mx-wrap-scale, 1));
  --mx-legal-nav-offset: var(--header-height);
  --tc-nav-offset: var(--mx-legal-nav-offset);
  --toc-scroll-clearance: calc(var(--mx-legal-nav-offset) + 1.5rem);
}

html {
  scroll-behavior: smooth;
}

.mx-legal-page .docs-main {
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: var(--space-2xl);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 48px;
  align-items: start;
}

.docs-content {
  order: 1;
  min-width: 0;
}

.docs-toc {
  position: sticky;
  top: calc(var(--mx-legal-nav-offset) + 24px);
  padding: 4px 0;
  order: 2;
}

.docs-toc__label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-toc nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-toc a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.docs-toc a.docs-toc__sub {
  padding-left: 18px;
  font-size: 0.84rem;
  font-weight: 600;
}

.docs-toc a:hover,
.docs-toc a.is-active {
  color: var(--purple);
  background: var(--accent-soft);
}

.docs-intro {
  margin-bottom: calc(var(--space-xl) + 4px);
  padding-bottom: calc(var(--space-lg) + 4px);
  border-bottom: 1px solid var(--line);
}

.docs-intro__eyebrow {
  margin: 0 0 10px;
  color: var(--purple);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-intro h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3.5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.docs-intro__text > p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.docs-intro__meta {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.docs-section a,
.docs-product a {
  color: var(--purple);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.docs-section a:hover,
.docs-product a:hover {
  color: var(--purple-dark);
}

.docs-section,
.docs-product {
  margin-bottom: calc(var(--space-xl) + var(--space-sm));
  scroll-margin-top: var(--toc-scroll-clearance);
}

.docs-section h2 {
  margin: 0 0 14px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.docs-section h3,
.docs-product h3 {
  margin: 26px 0 10px;
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.docs-product:first-of-type h3 {
  margin-top: 18px;
}

.docs-section p,
.docs-section li,
.docs-product p,
.docs-product li {
  color: #3a4258;
  line-height: 1.7;
}

.docs-section p,
.docs-product p {
  margin: 0 0 14px;
}

.docs-section ul,
.docs-section ol,
.docs-product ul,
.docs-product ol {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}

.docs-section li + li,
.docs-product li + li {
  margin-top: 8px;
}

.tc-toc--mobile {
  display: none;
  position: sticky;
  top: calc(var(--mx-legal-nav-offset) + 0.55rem);
  z-index: 20;
  margin: 0 0 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(16, 20, 37, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.tc-toc--mobile.is-hidden {
  transform: translateY(calc(-100% - 1.25rem));
  opacity: 0;
  pointer-events: none;
}

.tc-toc--legal .tc-toc__icon--app {
  display: none;
}

.tc-toc__list .tc-toc__sub a {
  padding-left: 1.35rem;
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    display: none;
  }

  .tc-toc--mobile {
    display: block;
  }
}
