/**
 * LinkX Legal / CMS static pages redesign — CoralBold
 * Scoped under .lx-dc-legal — cream / coral / teal / Bricolage system
 * Matches Claude Design Legal + bio/marketing marketing pages
 */

.lx.lx-dc-legal {
  --coral: #FF6B4A;
  --coral-ink: #E85535;
  --teal: #14806E;
  --bg: #FAF6F1;
  --paper: #fff;
  --ink: #2A211C;
  --muted: #756A60;
  --line: rgba(42, 33, 28, 0.08);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 0) 0 0 / 24px 24px,
    var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 24px;
}

[data-scheme="dark"] .lx.lx-dc-legal {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 0) 0 0 / 24px 24px,
    var(--bg);
  color: var(--ink);
}

.lx-dc-legal ::selection {
  background: var(--coral);
  color: #fff;
}

.lx-dc-legal a {
  color: var(--coral-ink);
  text-decoration: none;
}

.lx-dc-legal a:hover {
  color: var(--coral);
}

.lx-dc-legal .lx-lg-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---- Hero ---- */
.lx-dc-legal .lx-lg-hero {
  padding: clamp(128px, 16vh, 160px) 0 12px;
}

.lx-dc-legal .lx-lg-eyebrow {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin: 0 0 16px;
}

.lx-dc-legal .lx-lg-h1 {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.03;
  margin: 0 0 16px;
  color: var(--ink);
  text-wrap: pretty;
}

.lx-dc-legal .lx-lg-lead {
  font-size: 19px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 640px;
  text-wrap: pretty;
}

.lx-dc-legal .lx-lg-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.lx-dc-legal .lx-lg-meta-sep {
  opacity: 0.4;
}

/* ---- Tabs ---- */
.lx-dc-legal .lx-lg-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 24px 0 0;
}

.lx-dc-legal .lx-lg-tab {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lx-dc-legal .lx-lg-tab:hover {
  color: var(--ink);
  border-color: rgba(42, 33, 28, 0.18);
}

.lx-dc-legal .lx-lg-tab.is-active {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.lx-dc-legal .lx-lg-tab.is-active:hover {
  color: #fff;
  filter: brightness(1.05);
}

/* ---- Body grid ---- */
.lx-dc-legal .lx-lg-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 36px 0 24px;
}

/* When TOC is empty it is display:none — without this the article
   occupies the first 240px track and prose wraps to a few characters. */
.lx-dc-legal .lx-lg-body.is-single,
.lx-dc-legal .lx-lg-body:has(> .lx-lg-toc.is-empty) {
  grid-template-columns: minmax(0, 1fr);
}

.lx-dc-legal .lx-lg-toc {
  position: sticky;
  top: 96px;
}

.lx-dc-legal .lx-lg-toc-label {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 16px;
}

.lx-dc-legal .lx-lg-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--line);
}

.lx-dc-legal .lx-lg-toc-nav a {
  font-size: 14px;
  color: var(--muted);
  padding: 7px 0 7px 16px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  line-height: 1.35;
}

.lx-dc-legal .lx-lg-toc-nav a:hover,
.lx-dc-legal .lx-lg-toc-nav a.is-active {
  color: var(--coral);
  border-left-color: var(--coral);
}

.lx-dc-legal .lx-lg-toc-nav a.nav-link-sub {
  padding-left: 28px;
  font-size: 13px;
}

.lx-dc-legal .lx-lg-toc.is-empty {
  display: none;
}

/* ---- Prose (CMS HTML) ---- */
.lx-dc-legal .lx-lg-article {
  font-size: 17px;
  line-height: 1.72;
  color: #3A322C;
  min-width: 0;
}

.lx-dc-legal .lx-lg-content {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.lx-dc-legal .lx-lg-content > *:first-child {
  margin-top: 0;
}

.lx-dc-legal .lx-lg-content h2,
.lx-dc-legal .lx-lg-content h3 {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--ink);
  scroll-margin-top: 88px;
}

.lx-dc-legal .lx-lg-content h2 {
  font-size: 26px;
  margin: 40px 0 14px;
}

.lx-dc-legal .lx-lg-content h3 {
  font-size: 20px;
  margin: 28px 0 12px;
}

.lx-dc-legal .lx-lg-content p {
  margin: 0 0 20px;
}

.lx-dc-legal .lx-lg-content ul,
.lx-dc-legal .lx-lg-content ol {
  margin: 0 0 20px;
  padding-left: 20px;
}

.lx-dc-legal .lx-lg-content li {
  margin-bottom: 9px;
}

.lx-dc-legal .lx-lg-content a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lx-dc-legal .lx-lg-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 15px;
}

.lx-dc-legal .lx-lg-content th,
.lx-dc-legal .lx-lg-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.lx-dc-legal .lx-lg-content th {
  background: rgba(42, 33, 28, 0.04);
  font-weight: 700;
}

.lx-dc-legal .lx-lg-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* ---- Contact card ---- */
.lx-dc-legal .lx-lg-contact {
  margin-top: 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: 0 20px 44px -40px rgba(42, 33, 28, 0.5);
}

.lx-dc-legal .lx-lg-contact-title {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}

.lx-dc-legal .lx-lg-contact-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.lx-dc-legal .lx-lg-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.lx-dc-legal .lx-lg-contact-link {
  font-weight: 700;
  font-size: 15px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .lx-dc-legal .lx-lg-wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  .lx-dc-legal .lx-lg-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .lx-dc-legal .lx-lg-toc {
    position: static;
  }

  .lx-dc-legal .lx-lg-h1 {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lx-dc-legal .lx-lg-tab {
    transition: none;
  }
}
