/* ============================
   LEGAL PAGES — legal.css
   Loaded alongside styles.css
   ============================ */

.legal-hero {
  padding: calc(var(--nav-h) + 56px) 0 56px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.legal-hero-inner {
  max-width: 860px;
}

.legal-hero .section-label {
  margin-bottom: 16px;
}

.legal-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}

.legal-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.legal-meta-item {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.legal-meta-item strong {
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Layout ── */
.legal-body {
  padding: 64px 0 100px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 60px;
  align-items: start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── TOC Sidebar ── */
.legal-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.legal-toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.legal-toc ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc ol li a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.legal-toc ol li a:hover,
.legal-toc ol li a.active {
  color: var(--green);
  border-left-color: var(--green);
  background: var(--green-dim);
}

/* ── Document content ── */
.legal-content {
  min-width: 0;
}

.legal-section {
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-section h2 .sec-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(27,138,92,0.25);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 24px 0 10px;
}

.legal-section p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 14px;
}

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

.legal-section ul,
.legal-section ol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
  padding-left: 4px;
}

.legal-section ul li,
.legal-section ol li {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}

.legal-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.7;
}

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

.legal-section ol li::before {
  content: counter(item) ".";
  counter-increment: item;
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 600;
  font-size: 0.8rem;
}

.legal-section strong {
  color: var(--text);
  font-weight: 600;
}

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

.legal-section a:hover {
  color: var(--green-light);
}

/* Table */
.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.legal-table th {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.legal-table td {
  padding: 12px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

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

.legal-table td a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Callout / highlight box */
.legal-callout {
  background: var(--green-dim);
  border: 1px solid rgba(27,138,92,0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-callout strong {
  color: var(--green);
}

/* Warning callout */
.legal-callout-warn {
  background: rgba(242,194,48,0.08);
  border-color: rgba(242,194,48,0.25);
}

.legal-callout-warn strong {
  color: var(--gold);
}

/* CAPS block (warranties / liability) */
.legal-caps {
  font-size: 0.825rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* Contact card */
.legal-contact-card {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-top: 8px;
}

.legal-contact-card strong {
  color: var(--text);
  font-size: 0.95rem;
}

.legal-contact-card a {
  color: var(--green);
  font-size: 0.875rem;
}

/* Bottom note (italic) */
.legal-note {
  margin-top: 48px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-toc {
    position: static;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .legal-hero {
    padding-top: calc(var(--nav-h) + 36px);
  }

  .legal-section h2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
