/* ═══════════════════════════════════════════════════════════════════════════
   RWA Regulatory Intelligence — Legal Pages Stylesheet
   Fonts: Open Sans (body) · Inter (UI / headings) · Roboto Mono (code)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Open+Sans:wght@300;400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  --ui:    'Inter', system-ui, sans-serif;
  --body:  'Open Sans', system-ui, sans-serif;
  --mono:  'Roboto Mono', monospace;
  --gray-50:  #fafafa; --gray-100: #f5f5f5; --gray-200: #e5e5e5;
  --gray-300: #d4d4d4; --gray-400: #a3a3a3; --gray-500: #737373;
  --gray-600: #525252; --gray-700: #404040; --gray-800: #262626;
  --gray-900: #171717;
  --blue-50:  #eff6ff; --blue-200: #bfdbfe; --blue-500: #3b82f6;
  --blue-700: #1d4ed8;
  --border:   #e5e5e5;
  --text:     #171717; --text-2: #404040; --text-3: #737373; --text-4: #a3a3a3;
  --r: 6px; --r-md: 8px; --r-lg: 12px;
  --sh1: 0 1px 2px rgba(0,0,0,.05);
  --sh3: 0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
}

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

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--gray-50);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SITE HEADER ─────────────────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--sh1);
}
.site-header .logo {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
}
.site-header .logo-mark {
  width: 30px; height: 30px;
  background: var(--gray-900); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.site-header .logo-name {
  font-family: var(--ui); font-size: 13px; font-weight: 700;
  color: var(--gray-900); letter-spacing: -.01em;
}
.back-link {
  font-family: var(--ui); font-size: 12px; color: var(--text-3);
  text-decoration: none; display: flex; align-items: center; gap: 5px;
  transition: color .14s;
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── PAGE LAYOUT ─────────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── DOC HEADER ──────────────────────────────────────────────────────────── */
.doc-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--gray-200);
}
.doc-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-50); border: 1px solid var(--blue-200);
  border-radius: 20px; padding: 4px 12px;
  font-family: var(--ui); font-size: 11px; font-weight: 600;
  color: var(--blue-700); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 16px;
}
.doc-title {
  font-family: var(--ui); font-size: 32px; font-weight: 800;
  color: var(--gray-900); letter-spacing: -.03em; line-height: 1.15;
  margin-bottom: 12px;
}
.doc-meta {
  font-family: var(--ui); font-size: 12px; color: var(--text-4);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.doc-meta-dot { color: var(--gray-300); }

/* ── DOCUMENT CONTENT ────────────────────────────────────────────────────── */
.doc-content { font-family: var(--body); font-size: 15px; color: var(--text-2); }

.doc-content h2 {
  font-family: var(--ui); font-size: 20px; font-weight: 700;
  color: var(--gray-900); letter-spacing: -.02em;
  margin: 36px 0 12px; padding-top: 36px;
  border-top: 1px solid var(--gray-200);
}
.doc-content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.doc-content h3 {
  font-family: var(--ui); font-size: 16px; font-weight: 600;
  color: var(--gray-800); margin: 24px 0 8px;
}

.doc-content p { margin-bottom: 16px; line-height: 1.75; }
.doc-content p:last-child { margin-bottom: 0; }

.doc-content ul, .doc-content ol {
  margin: 0 0 16px 20px; line-height: 1.75;
}
.doc-content li { margin-bottom: 6px; }

.doc-content strong { font-weight: 600; color: var(--gray-900); }

.doc-content a { color: var(--blue-700); }
.doc-content a:hover { text-decoration: underline; }

.doc-content code {
  font-family: var(--mono); font-size: 13px;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 4px; padding: 2px 6px; color: var(--gray-700);
}

/* ── CALLOUT BOX ─────────────────────────────────────────────────────────── */
.doc-callout {
  background: #fffbeb; border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: var(--r); padding: 14px 18px;
  margin: 20px 0;
  font-size: 13.5px; line-height: 1.65; color: #92400e;
}
.doc-callout.info {
  background: var(--blue-50); border-color: var(--blue-200);
  border-left-color: var(--blue-500); color: #1e40af;
}

/* ── TABLE OF CONTENTS ───────────────────────────────────────────────────── */
.toc {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 24px;
  margin-bottom: 36px; box-shadow: var(--sh1);
}
.toc-label {
  font-family: var(--ui); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-4); margin-bottom: 12px;
}
.toc ol { margin: 0; padding-left: 18px; }
.toc li {
  font-family: var(--ui); font-size: 13px; color: var(--text-3);
  margin-bottom: 5px;
}
.toc a { color: var(--text-3); text-decoration: none; transition: color .14s; }
.toc a:hover { color: var(--blue-700); }

/* ── SITE FOOTER ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 18px 24px;
  text-align: center;
}
.site-footer p {
  font-family: var(--ui); font-size: 11px; color: var(--text-4); margin-bottom: 8px;
}
.site-footer nav { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.site-footer a { font-family: var(--ui); font-size: 11px; color: var(--text-4); text-decoration: none; }
.site-footer a:hover { color: var(--text-2); }
.site-footer .sep { color: var(--gray-300); }

/* ── ADMIN EDIT NOTICE ───────────────────────────────────────────────────── */
.admin-edit-bar {
  background: var(--gray-900); color: #fff;
  padding: 8px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--ui); font-size: 12px;
  display: none;
}
.admin-edit-bar.visible { display: flex; }
.admin-edit-bar a { color: #93c5fd; text-decoration: none; }
.admin-edit-bar a:hover { text-decoration: underline; }
