/* ===== StableRise — legal.css =====
   Shared stylesheet for privacy.html and terms-of-service.html.
   Legal pages load ONLY this file (never style.css). */

:root {
  --bg: #FBF6EF;
  --bg-soft: #F4EBE0;
  --bg-deep: #2A1D15;
  --surface: #FFFFFF;
  --ink: #241811;
  --ink-soft: #433228;
  --muted: #775F4C;
  --accent: #C05A31;
  --accent-deep: #98431F;
  --accent-soft: #F3DFCE;
  --line: #E8D8C6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-size: 16px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Legal pages define their own body background and text color. */
.legal-page {
  background-color: var(--bg);
  color: var(--ink);
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ===== Legal header (a <header>, never a <section>) ===== */
.legal-header {
  background: linear-gradient(135deg, #2A1D15 0%, #452C1E 55%, #6B3A22 100%);
  padding: 64px 0 56px;
  border-bottom: 4px solid var(--accent);
}

.legal-header-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-brand {
  display: inline-block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #E49A72;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.legal-brand:hover {
  color: #F3B48B;
  text-decoration: none;
}

.legal-header h1 {
  color: #FDF8F0;
  font-size: clamp(30px, 5vw, 46px);
  margin-bottom: 14px;
}

.legal-meta {
  color: #D6C4B2;
  font-size: 15px;
}

/* ===== Legal content ===== */
.legal-content .container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Scope isolation: never let homepage section styling paint over legal text. */
.legal-page .legal-content section {
  background-color: transparent !important;
  color: var(--ink) !important;
}

.legal-content section {
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--line);
}

.legal-content section:last-of-type {
  border-bottom: none;
}

.legal-content h2 {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--accent-deep);
  scroll-margin-top: 24px;
}

.legal-content h3 {
  font-size: 18px;
  margin: 22px 0 10px;
  color: var(--ink);
}

.legal-content p {
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  margin: 0 0 18px 24px;
  color: var(--ink-soft);
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content a {
  font-weight: 500;
}

/* ===== Table of contents ===== */
.legal-toc {
  background-color: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 28px;
  margin-top: 44px;
  margin-bottom: 8px;
}

.legal-toc h2 {
  font-size: 16px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 14px;
}

.legal-toc ol {
  list-style: none;
  margin: 0;
  columns: 2;
  column-gap: 32px;
}

.legal-toc li {
  margin-bottom: 10px;
}

.legal-toc a {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
}

.legal-toc a:hover {
  color: var(--accent-deep);
}

/* ===== Legal footer ===== */
.legal-footer {
  background-color: var(--bg-deep);
  color: #E7D9C8;
  margin-top: 40px;
}

.legal-footer-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 34px 24px 38px;
  text-align: center;
}

.legal-footer p {
  color: #CBB9A6;
  font-size: 15px;
  margin-bottom: 8px;
}

.legal-footer a {
  color: #E49A72;
  font-weight: 600;
}

.legal-footer a:hover {
  color: #F3B48B;
}

.legal-back {
  display: inline-block;
  margin-top: 12px;
  padding: 11px 22px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: #FDF8F0;
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.2s ease;
}

.legal-back:hover {
  background-color: var(--accent);
  color: #FFFFFF;
  text-decoration: none;
}

@media (max-width: 620px) {
  .legal-toc ol {
    columns: 1;
  }

  .legal-content h2 {
    font-size: 21px;
  }
}
