/* ===========================================================================
   Lexlane Design System — global entry point.
   Consumers link THIS file only. Keep it as @import lines (no rules here).
   ===========================================================================*/

@import url('./tokens/fonts.css');
@import url('./tokens/colors.css');
@import url('./tokens/typography.css');
@import url('./tokens/spacing.css');
@import url('./tokens/effects.css');
@import url('./tokens/base.css');

/* ===========================================================================
   Rechts-Seiten (Impressum, Datenschutz, Terms) — EIN gemeinsames Design.
   Oben der Wolken-Himmel wie auf der Landingpage, der per Verlauf weich in die
   warme Creme-Fläche ausläuft (kein harter Schnitt, kein Kasten). Darunter
   liegt der Text auf Creme. Hero und Textblock teilen sich denselben Container
   (gleiche linke Kante). Terms & Datenschutz nutzen die sticky Sprungmarken-
   Navigation (.lx-legal-toc); kurze Seiten (Impressum) nutzen --solo.
   ===========================================================================*/
.lx-legal-page {
  background-color: var(--surface-page);
  background-image:
    linear-gradient(to bottom,
      rgba(251, 249, 243, 0) 0%,
      rgba(251, 249, 243, 0) 42%,
      rgba(251, 249, 243, 0.75) 68%,
      var(--surface-page) 90%),
    url('/bg-clouds.jpg');
  background-repeat: no-repeat, no-repeat;
  background-position: center top, center top;
  background-size: 100% 560px, 100% 560px;
}
@media (max-width: 640px) {
  .lx-legal-page { background-size: 100% 360px, 100% 360px; }
}

/* Gemeinsamer Container: identische Breite & linke Kante für Hero und Body. */
.lx-legal-container {
  max-width: calc(var(--container-text) + 240px + clamp(32px, 5vw, 72px));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.lx-legal-hero { padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(24px, 3vw, 40px); }
.lx-legal-hero h1 {
  font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.022em;
  font-size: clamp(34px, 5vw, 54px); line-height: 1.06; color: var(--text-strong); margin: 0;
}
.lx-legal-hero .lede {
  margin: 18px 0 0; max-width: 640px;
  font-family: var(--font-ui); font-size: var(--text-md); color: var(--text-muted); line-height: var(--lh-body);
}
.lx-legal-hero .meta {
  margin: 12px 0 0;
  font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-faint);
}

.lx-legal-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(56px, 8vw, 112px);
}
/* Einspaltig (Impressum): kein TOC, schmale Lesespalte. */
.lx-legal-body--solo { display: block; }
.lx-legal-body--solo .lx-legal-content { max-width: var(--container-text); }

.lx-legal-toc { position: sticky; top: 96px; }
.lx-legal-toc__title {
  font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint);
  margin: 0 0 10px 14px;
}
.lx-legal-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lx-legal-toc a {
  display: block; font-family: var(--font-ui); font-size: var(--text-sm); line-height: 1.4;
  color: var(--text-faint); text-decoration: none;
  padding: 8px 0 8px 14px; border-left: 1px solid var(--border-default);
  transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.lx-legal-toc a:hover { color: var(--text-body); }
.lx-legal-toc a.is-active {
  color: var(--text-strong); font-weight: var(--fw-semibold); border-left-color: var(--text-strong);
}

.lx-legal-content { min-width: 0; }
.lx-legal-content h2 {
  font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.018em;
  font-size: clamp(24px, 3vw, 34px); line-height: 1.12; color: var(--text-strong);
  margin-top: clamp(48px, 6vw, 72px); scroll-margin-top: 96px;
  padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--border-strong);
}
.lx-legal-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.lx-legal-content h3 {
  font-family: var(--font-ui); font-weight: var(--fw-semibold);
  font-size: clamp(16px, 1.6vw, 18px); color: var(--text-strong);
  margin-top: clamp(26px, 3vw, 34px); line-height: 1.35; scroll-margin-top: 96px;
}
.lx-legal-content p {
  font-family: var(--font-ui); font-size: var(--text-sm); line-height: var(--lh-body);
  color: var(--text-body); margin-top: 12px;
}
.lx-legal-content p.lx-footnote { font-size: var(--text-xs); color: var(--text-faint); }
.lx-legal-content h3 + p { margin-top: 10px; }
.lx-legal-content ul {
  margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px;
}
.lx-legal-content ul li {
  position: relative; padding-left: 20px;
  font-family: var(--font-ui); font-size: var(--text-sm); line-height: var(--lh-body); color: var(--text-body);
}
.lx-legal-content ul li::before {
  content: ''; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; background: var(--accent);
}
.lx-legal-content a {
  color: var(--text-body); text-decoration: underline;
  text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
.lx-legal-content a:hover { text-decoration-color: var(--text-body); }
.lx-legal-content hr {
  border: none; border-top: 1px solid var(--border-default); margin: clamp(44px, 6vw, 64px) 0 0;
}

.lx-legal-content .lx-table-wrap { margin-top: 16px; overflow-x: auto; }
.lx-legal-content table {
  width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: var(--text-sm);
}
.lx-legal-content th,
.lx-legal-content td {
  text-align: left; vertical-align: top; padding: 11px 14px; line-height: 1.5;
  border-bottom: 1px solid var(--border-default);
}
.lx-legal-content th {
  font-weight: 600; color: var(--text-strong); background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-strong);
}
.lx-legal-content td { color: var(--text-body); }
.lx-legal-content td:first-child { font-weight: 600; color: var(--text-strong); }

@media (max-width: 860px) {
  .lx-legal-body { grid-template-columns: 1fr; }
  .lx-legal-toc { position: static; top: auto; margin-bottom: 8px; }
  .lx-legal-toc ul { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; }
  .lx-legal-toc a { border-left: none; border-bottom: 1px solid var(--border-default); padding: 6px 12px; }
  .lx-legal-toc a.is-active { border-left: none; border-bottom-color: var(--text-strong); }
}

/* Story-Sektion (Team-Seite): zwei Spalten am Desktop, gestapelt mobil. */
@media (max-width: 768px) {
  .lx-story-grid { grid-template-columns: 1fr !important; }
  .lx-3p-grid { grid-template-columns: 1fr !important; }
  .lx-pricealt-grid { grid-template-columns: 1fr !important; }
}

/* Mobile: einspaltig stapeln (Hero, Problem-Karten, Final-CTA, Gründer). */
@media (max-width: 900px) {
  .lx-hero-grid { grid-template-columns: 1fr !important; }
  .lx-problem-grid { grid-template-columns: 1fr !important; }
  .lx-core-grid { grid-template-columns: 1fr !important; }
  .lx-cta-grid { grid-template-columns: 1fr !important; }
  .lx-founders-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
  .lx-founders-grid { grid-template-columns: 1fr !important; }
}

/* Alternativen: überlappende Karten mobil untereinander, volle Breite. */
@media (max-width: 860px) {
  .lx-alt-grid { flex-direction: column !important; align-items: stretch !important; gap: 16px; }
  .lx-alt-white, .lx-alt-green { width: 100% !important; margin-right: 0 !important; }
}

/* ProductMock: Schnellaktionen einspaltig, sobald die nowrap-Labels
   in zwei Spalten nicht mehr passen. */
@media (max-width: 560px) {
  .lx-mock-grid { grid-template-columns: 1fr !important; }
}

/* Engerer Seitenrand auf schmalen Screens. */
@media (max-width: 560px) {
  :root { --gutter: 1.25rem; }
}

@media (max-width: 1000px) {
  .lx-docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  .lx-docs-grid { grid-template-columns: 1fr !important; }
}

/* TrustDeep — Linien-Stil. Sticky Header links, Sektionen mit stapelndem Titel rechts.
   Beim Scrollen bleiben die Sektionstitel oben stehen und stapeln sich untereinander
   (durch dünne Linien getrennt); die eingerückten Sub-Bullets scrollen darunter weg
   und werden vom opaken Titel-Hintergrund verdeckt. Der klebende Titel-Stack (top-Offset
   pro Sektion) wird inline in TrustDeep.jsx gesetzt. */
.lx-td-head { position: sticky; top: 96px; }

/* Klebender Sektionstitel — Box exakt so hoch wie der Staffelabstand (120px) und opak,
   damit die gestapelten Titel lückenlos übereinander liegen (kein Durchscheinen der
   dahinter wegscrollenden Bullets). Linie zwischen den Titeln. */
.lx-td-sectitle {
  position: sticky; z-index: 2;
  min-height: 120px;
  display: flex; align-items: center;
  margin: 0; padding: 0;
  background: var(--green-950);
  border-top: 1px solid var(--border-on-brand);
}
.lx-td-sectitle:first-of-type { border-top: none; }

/* Opake Abdeckung oberhalb des ersten klebenden Titels: verhindert, dass
   hochscrollende Bullets im Spalt unter bzw. hinter dem transluzenten Header
   durchscheinen. Die Sektion clippt den Überstand (overflow: clip, inline). */
.lx-td-sectitle:first-of-type::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 140px;
  background: var(--green-950);
}

/* Sub-Bullets: etwas eingerückt, mit eingerückter Trennlinie */
.lx-td-items { margin-left: clamp(0px, 1.6vw, 22px); }
.lx-td-item { padding: clamp(16px, 1.7vw, 20px) 0; }

@media (max-width: 860px) {
  .lx-td-grid { grid-template-columns: 1fr !important; }
  .lx-td-head { position: static !important; }
  .lx-td-sectitle { position: static !important; top: auto !important; min-height: auto; display: block; padding: 22px 0 14px; }
  .lx-td-sectitle:first-of-type::before { display: none; }
}

/* Legal-Seiten (Datenschutz, Nutzungsbedingungen) — lesbare Prosa */
.lx-legal-prose > :first-child { margin-top: 0; }
.lx-legal-prose h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.015em;
  color: var(--text-strong); line-height: 1.2;
  margin: clamp(44px, 5vw, 68px) 0 0;
}
.lx-legal-prose h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.01em;
  color: var(--text-strong); line-height: 1.25;
  margin: clamp(28px, 3vw, 40px) 0 0;
}
.lx-legal-prose h2 + p, .lx-legal-prose h3 + p,
.lx-legal-prose h2 + h3 { margin-top: 14px; }
.lx-legal-prose p {
  font-family: var(--font-ui); font-size: var(--text-md); line-height: 1.7;
  color: var(--text-body); margin: 14px 0 0;
}
.lx-legal-prose ul {
  margin: 14px 0 0; padding-left: 1.3em;
  font-family: var(--font-ui); font-size: var(--text-md); line-height: 1.7; color: var(--text-body);
}
.lx-legal-prose li { margin: 7px 0 0; }
.lx-legal-prose strong { font-weight: 700; color: var(--text-strong); }
.lx-legal-prose a { color: var(--text-link); text-decoration: underline; overflow-wrap: anywhere; }
.lx-legal-prose hr {
  border: none; border-top: 1px solid var(--border-default);
  margin: clamp(36px, 4vw, 56px) 0 0;
}
