/* Shared styles for the legal pages (privacy policy, EN + ES). No external fonts or assets. */

:root {
  --bg: #f6f5f2;
  --fg: #1b1b1f;
  --muted: #5c5c66;
  --surface: #ecebe6;
  --line: #d8d6cf;
  --link: #2a52be;
  --accent: #2a52be;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121216;
    --fg: #ececf1;
    --muted: #a0a0ab;
    --surface: #1c1c22;
    --line: #2e2e36;
    --link: #93b1ff;
    --accent: #93b1ff;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Top bar: wordmark + language switch */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}
.lang-switch { font-size: 0.9375rem; }

/* Title block */
header.doc-header { padding: 40px 0 8px; }
h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.meta {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}
.meta li { margin: 2px 0; }

/* Headings and text */
h2 {
  margin: 56px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  scroll-margin-top: 16px;
}
h3 {
  margin: 32px 0 8px;
  font-size: 1.125rem;
  line-height: 1.35;
  scroll-margin-top: 16px;
}
p, ul, ol { margin: 0 0 16px; }
ul, ol { padding-left: 1.4em; }
li { margin: 4px 0; }
li > ul { margin: 4px 0 0; }
strong { font-weight: 650; }

/* The short version */
.summary {
  margin: 32px 0 0;
  padding: 20px 20px 4px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 4px 12px 12px 4px;
}
.summary h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
}

/* Table of contents */
nav.toc {
  margin: 32px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
nav.toc h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
nav.toc ol { margin: 0; columns: 2 16rem; column-gap: 32px; }
nav.toc li { margin: 2px 0; break-inside: avoid; }

/* Tables: scroll inside their own box on narrow screens */
.table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table {
  width: 100%;
  min-width: 18rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}
caption {
  padding: 10px 12px;
  text-align: left;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}
th, td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
thead th { background: var(--surface); font-weight: 650; }
tbody th { font-weight: 650; width: 32%; }
tr:last-child > * { border-bottom: 0; }
td ul { margin: 4px 0 8px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  background: var(--surface);
  border-radius: 4px;
}

/* Changelog */
dl.changelog { margin: 0 0 16px; }
dl.changelog dt { font-weight: 650; }
dl.changelog dd { margin: 0 0 12px; color: var(--muted); }

footer.doc-footer {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

@media print {
  :root {
    --bg: #fff;
    --fg: #000;
    --muted: #333;
    --surface: #f2f2f2;
    --line: #bbb;
    --link: #000;
    --accent: #000;
  }
  body { font-size: 11pt; }
  .topbar, nav.toc { display: none; }
  .page { max-width: none; padding: 0; }
  h2 { break-after: avoid; }
  table, .summary { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
}
