/* File: apps/legal_site/shared/legal_document_styles.css */
/* Purpose: Shared typography, layout, and a11y-focused styles for hosted legal HTML pages. */
/* Notes: Keep paths relative from each page’s directory. [MINDGYM_FILE_DOC] */

:root {
  color-scheme: light dark;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --text: #0f1419;
  --text-muted: #536471;
  --border: #e1e8ed;
  --accent: #1d9bf0;
  --accent-hover: #1a8cd8;
  --focus: #0066cc;
  --max-width: 42rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #16181c;
    --text: #e7e9ea;
    --text-muted: #8b98a5;
    --border: #2f3336;
    --accent: #1d9bf0;
    --accent-hover: #47b3ff;
    --focus: #7cb8ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 0.25rem 0;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  max-width: calc(var(--max-width) + 3rem);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.nav-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.nav-legal a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-legal a:hover {
  color: var(--accent);
}

.nav-legal a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

main {
  max-width: calc(var(--max-width) + 3rem);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.doc-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.doc-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.02em;
}

h2:first-of-type {
  margin-top: 0;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p,
ul {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.35rem;
}

a:not(.brand):not(.skip-link) {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:not(.brand):not(.skip-link):hover {
  color: var(--accent-hover);
}

a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
}

.callout strong {
  color: var(--text);
}

.site-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0 0 0.5rem;
}
