/* Shared styles for the legal pages (public/legal/<locale>/*.html). No build step, no external fonts. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2937;
  --heading: #0f172a;
  --muted: #5b6472;
  --border: #e5e7eb;
  --link: #1d4ed8;
  --link-visited: #6d28d9;
  --header-bg: #1a1a2e;
  --header-text: #ffffff;
  --header-muted: #b0c4de;
  --accent: #7eff7e;
  --accent-text: #0b0b0b;
  --callout-bg: #fef2f2;
  --callout-border: #dc2626;
  --code-bg: #f3f4f6;
  --focus: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --surface: #171a22;
    --text: #e5e7eb;
    --heading: #f8fafc;
    --muted: #a1a8b3;
    --border: #2a2f3a;
    --link: #93b4ff;
    --link-visited: #c4b5fd;
    --callout-bg: #2a1416;
    --callout-border: #f87171;
    --code-bg: #232733;
    --focus: #93b4ff;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #171a22;
  --text: #e5e7eb;
  --heading: #f8fafc;
  --muted: #a1a8b3;
  --border: #2a2f3a;
  --link: #93b4ff;
  --link-visited: #c4b5fd;
  --callout-bg: #2a1416;
  --callout-border: #f87171;
  --code-bg: #232733;
  --focus: #93b4ff;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 18px; /* readable for older users */
  line-height: 1.65;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:visited {
  color: var(--link-visited);
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header: brand + language switcher */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
}

.site-header__inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
}

.brand:visited {
  color: var(--header-text);
}

.brand img {
  border-radius: 50%;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lang-switch a {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  white-space: nowrap;
}

.lang-switch a:visited {
  color: var(--header-muted);
}

.lang-switch a:hover {
  color: var(--header-text);
  border-color: var(--header-text);
}

.lang-switch a[aria-current] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

/* Document tabs */
.doc-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.doc-nav__inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  flex-wrap: wrap; /* wrap rather than side-scroll: hidden tabs are easy to miss */
}

.doc-nav a {
  flex: 0 0 auto;
  padding: 14px 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.doc-nav a:visited {
  color: var(--muted);
}

.doc-nav a:hover {
  color: var(--heading);
}

.doc-nav a[aria-current="page"] {
  color: var(--heading);
  border-bottom-color: var(--header-bg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .doc-nav a[aria-current="page"] {
    border-bottom-color: var(--accent);
  }
}

:root[data-theme="dark"] .doc-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* Document body */
.doc {
  max-width: 52rem;
  margin: 24px auto 40px;
  padding: 28px 16px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

@media (min-width: 640px) {
  .doc {
    padding: 40px 48px 48px;
  }
}

@media (max-width: 639px) {
  .doc {
    margin: 0 0 24px;
    border-radius: 0;
    border-width: 0 0 1px;
  }
}

.doc h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1.2;
}

.doc h2 {
  margin: 36px 0 12px;
  color: var(--heading);
  font-size: 23px;
  line-height: 1.3;
  scroll-margin-top: 64px;
}

.doc h3 {
  margin: 28px 0 8px;
  color: var(--heading);
  font-size: 19px;
  line-height: 1.35;
}

.doc p {
  margin: 0 0 14px;
}

.doc .updated {
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.doc ul {
  margin: 0 0 16px;
  padding-left: 1.3em;
}

.doc li {
  margin: 0 0 10px;
}

.doc li::marker {
  color: var(--muted);
}

.doc strong {
  color: var(--heading);
}

.doc .callout {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--callout-bg);
  border-left: 5px solid var(--callout-border);
  border-radius: 8px;
}

.table-wrap {
  margin: 8px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.doc th,
.doc td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.doc th {
  background: var(--code-bg);
  color: var(--heading);
}

.doc tr:last-child td {
  border-bottom: 0;
}

.doc code {
  padding: 2px 6px;
  background: var(--code-bg);
  border-radius: 4px;
  font-size: 15px;
  white-space: nowrap;
}

/* Footer */
.site-footer__inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--muted);
  font-size: 15px;
}

.site-footer a,
.site-footer a:visited {
  color: var(--link);
}

@media print {
  .site-header,
  .doc-nav,
  .site-footer {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }

  .doc {
    margin: 0;
    padding: 0;
    border: 0;
  }
}
