/* SPDX-License-Identifier: LicenseRef-Relocat-Proprietary
   Copyright (C) 2025-2026 Ruslan Zykun. All rights reserved.

   Document pages of relocat.org: the nine legal pages, the imprint and the
   error pages. Loaded after tokens.css and shell.css by every page except
   the landing (spec 2026-09-16-public-shell-design.md).

   The panel spans the full container; the text inside it is capped at a
   46rem measure and centred, while tables and preformatted blocks use the
   panel's full width. The legal HTML is markdown output — plain h2/h3/p/ul/
   table with no classes — so these rules style elements, not classes. */

.prose {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 48px;
}

/* The reading measure. Tables and <pre> deliberately stay outside it. */
.prose > :where(h1, h2, h3, h4, p, ul, ol, dl, blockquote, hr),
.prose > .imprint-block,
.prose > .error-page {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

/* ============================================================
   Headings
   ============================================================ */

.prose h1 {
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-wrap: balance;
}

/* Version / last-updated / effective-from lines: <p><em>…</em></p> under the
   title in the legal templates. Only the <em> is restyled, so an ordinary
   first paragraph on another page keeps its normal look. */
.prose h1 + p em,
.prose h1 + p + p em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text-secondary);
}

.prose h2 {
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 44px auto 12px;
  text-wrap: balance;
}

.prose h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 28px auto 8px;
}

.prose h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px auto 8px;
}

/* ============================================================
   Body copy
   ============================================================ */

.prose p,
.prose li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.prose p { margin: 0 auto 16px; }
.prose strong { color: var(--text-primary); font-weight: 600; }

.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }

.prose ul, .prose ol { margin: 0 auto 16px; padding-left: 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--text-secondary); }

.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.prose pre {
  margin: 0 0 16px;
  padding: 16px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.prose pre code {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.prose blockquote {
  margin: 0 auto 16px;
  padding-left: 16px;
  border-left: 2px solid var(--accent-border);
  color: var(--text-secondary);
}

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px auto; }

/* ============================================================
   Tables — the v7 legal pages render 15 of them on /privacy/ alone
   ============================================================ */

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14px;
}
.prose th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary);
  text-align: left;
  vertical-align: bottom;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
}
.prose td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.55;
}

/* ============================================================
   Imprint definition lists
   ============================================================ */

.prose .imprint-block { margin-bottom: 32px; }
.prose dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0 auto 16px;
}
.prose dt { color: var(--text-primary); font-weight: 600; }
.prose dd { margin: 0; color: var(--text-secondary); }

/* ============================================================
   Error pages
   ============================================================ */

.prose .error-page { text-align: center; padding: 24px 0 8px; }
.prose .error-page .code {
  font-family: var(--font-mono);
  font-size: 64px;
  line-height: 1;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 860px) {
  .prose { padding: 28px; }
  /* The TABLE scrolls, not the panel: the scrollbar lands directly under the
     table, so a reader can see that more columns exist, and swiping the table
     does not drag the rest of the page sideways. Owner decision 2026-09-16;
     the cost is that display:block can drop the table's implicit semantics in
     some screen readers, which was weighed against three GDPR columns being
     hidden with no cue. */
  .prose table { display: block; overflow-x: auto; }
  .prose th, .prose td { min-width: 9rem; }
}

@media (max-width: 480px) {
  .prose { padding: 20px; }
  .prose dl { grid-template-columns: 1fr; gap: 2px 0; }
  .prose dd { margin-bottom: 10px; }
  .prose .error-page .code { font-size: 48px; }
}
