/* ==========================================================================
   legal.css — the public reading page of the Política de Privacidade, the
   Termos de Uso and the help page «Problemas com a Adalove»
   (static/privacidade.html, static/termos.html, static/ajuda-adalove.html). The tokens, the
   Inter import and the wordmark come from landing.css; this file lays out one
   reading column (~680px) with its contents beside it on wide screens and
   above the text on narrow ones.
   ========================================================================== */

:root {
  --lp-ease-open: cubic-bezier(0.16, 1, 0.3, 1);
  --lp-shadow: 0 1px 0 rgba(30, 41, 59, 0.03), 0 18px 50px -28px rgba(30, 41, 59, 0.16);
  /* rail + gap + column + side padding: the header, the page and the footer
     share this width so the wordmark, the contents and the footer line up. */
  --lp-width: calc(196px + 72px + 680px + 56px);
}

html { background: var(--bg); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body { font-size: 16px; line-height: 1.7; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* The letters are only drawn; the .sr-only "The Companion" is what is read and copied. */
.nav-brand > [aria-hidden="true"] { -webkit-user-select: none; user-select: none; }

.lp-skip {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  padding: 10px 14px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 600;
  transform: translateY(-160%);
}
.lp-skip:focus { transform: none; color: var(--bg); }

.lp-header {
  max-width: var(--lp-width); margin: 0 auto;
  padding: 32px 28px 0;
}
.lp-header .nav-brand { display: inline-flex; }

/* ── Layout: contents rail + reading column ─────────────────────────────── */
.lp {
  max-width: var(--lp-width); margin: 0 auto;
  padding: 72px 28px 104px;
  display: grid;
  grid-template-columns: 196px minmax(0, 680px);
  grid-template-areas:
    "toc head"
    "toc summary"
    "toc body";
  grid-template-rows: auto auto 1fr;
  column-gap: 72px;
}
.lp-head { grid-area: head; }
.lp-summary { grid-area: summary; }
.lp-toc { grid-area: toc; }
.lp-body { grid-area: body; }

/* ── Head ───────────────────────────────────────────────────────────────── */
.lp-head h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.6vw, 52px);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}
.lp-head .lp-updated {
  margin: 18px 0 0;
  font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--text-secondary);
}
.lp-updated time { font-variant-numeric: tabular-nums; }
.lp-head > p:not(.lp-updated) { margin-top: 28px; color: var(--text); }

/* ── "Em resumo": the gist, in a white card ─────────────────────────────── */
.lp-summary {
  margin-top: 32px;
  padding: 28px 32px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-7);
  box-shadow: var(--lp-shadow);
}
.lp-summary h2 {
  margin: 0 0 14px;
  font-family: var(--font);
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}

/* ── Contents ───────────────────────────────────────────────────────────── */
.lp-toc {
  align-self: start;
  position: sticky; top: 32px;
  max-height: calc(100vh - 64px); overflow-y: auto;
  padding-top: 6px;
}
/* --text-secondary, not --text-muted: small text on the paper needs 4.5:1. */
.lp-toc-title {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-secondary);
}
.lp-toc ol { list-style: none; }
.lp-toc a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--border);
  font-size: 13.5px; line-height: 1.4;
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--t-ease), border-color var(--t-fast) var(--t-ease);
}
.lp-toc a:hover { color: var(--text); border-left-color: var(--border-strong); }
.lp-toc a[aria-current] { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }

/* ── Text ───────────────────────────────────────────────────────────────── */
.lp-body h2 {
  margin: 48px 0 16px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: clamp(23px, 2.4vw, 27px);
  font-weight: 700; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--text);
  scroll-margin-top: 8px;
}
.lp-body section:first-child h2 { margin-top: 56px; }
.lp p { margin: 0 0 16px; }
.lp ul { list-style: none; margin: 0 0 18px; }
.lp-summary li, .lp-body li { position: relative; padding-left: 22px; margin-bottom: 10px; }
.lp-summary li::before, .lp-body li::before {
  content: ""; position: absolute; left: 4px; top: 0.72em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}
.lp-summary li:last-child, .lp-summary ul { margin-bottom: 0; }
.lp-summary .lp-summary-note { margin: 16px 0 0; font-size: 14px; color: var(--text-secondary); }
.lp strong { font-weight: 600; color: var(--text); }
.lp em { font-style: italic; }
.lp-head a, .lp-summary a, .lp-body a {
  color: var(--accent);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  overflow-wrap: anywhere;
}
.lp-head a:hover, .lp-summary a:hover, .lp-body a:hover {
  color: var(--accent-strong); text-decoration-color: currentColor;
}
.lp blockquote {
  margin: 4px 0 20px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--border-strong);
  color: var(--text-secondary);
  font-style: italic;
}
.lp blockquote p { margin: 0; }

/* ── The help page: a notice as the Student sees it, then what it means ─── */
.aj-say {
  display: inline-block; margin: 0 0 14px; padding: 5px 12px;
  border-radius: var(--r-3); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 600; color: var(--text);
}
.aj-row + .aj-say { margin-top: 18px; }
.aj-row { display: grid; grid-template-columns: 170px 1fr; gap: 4px 18px; margin: 0 0 12px; }
.aj-row b { color: var(--text-secondary); font-weight: 600; }
@media (max-width: 640px) { .aj-row { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.lp-footer {
  max-width: var(--lp-width); margin: 0 auto;
  padding: 0 28px 44px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-secondary);
}
/* The hairline spans the text, not the padding. */
.lp-footer::before {
  content: ""; display: block; height: 1px; margin-bottom: 26px;
  background: var(--border);
}
.lp-footer-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.lp-footer-links span { color: var(--text-muted); }
.lp-footer-links a { color: var(--text-secondary); font-weight: 600; }
.lp-footer-links a:hover { color: var(--accent); }
.lp-footer-links a[aria-current] { color: var(--text); }
.lp-company { color: var(--text-secondary); }

/* ── Entrance ───────────────────────────────────────────────────────────── */
@keyframes lp-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lp-head, .lp-summary, .lp-toc { animation: lp-rise 0.6s var(--lp-ease-open) both; }
.lp-summary { animation-delay: 0.08s; }
.lp-toc { animation-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  .lp-head, .lp-summary, .lp-toc { animation: none; }
  .lp-toc a { transition: none; }
}

/* ── Narrow screens: contents between the summary and the text ─────────── */
@media (max-width: 1023px) {
  .lp {
    display: block;
    max-width: 736px;
    padding-top: 48px;
  }
  .lp-toc {
    position: static; max-height: none; overflow: visible;
    margin-top: 36px; padding-top: 0;
  }
  .lp-toc ol { columns: 2; column-gap: 28px; }
  .lp-toc li { break-inside: avoid; }
}
@media (max-width: 640px) {
  .lp-header { padding: 22px 20px 0; }
  .lp-header .nav-brand .the, .lp-header .nav-brand .companion { font-size: 20px; }
  .lp { padding: 36px 20px 72px; }
  .lp-summary { margin-top: 32px; padding: 22px 20px 20px; border-radius: var(--r-5); }
  .lp-toc ol { columns: 1; }
  .lp-body h2 { margin-top: 44px; padding-top: 36px; }
  .lp-body section:first-child h2 { margin-top: 52px; }
  .lp-footer { padding: 0 20px 36px; }
}

@media print {
  .lp-skip, .lp-toc, .lp-footer-links { display: none; }
  .lp { display: block; padding: 24px 0; }
  .lp-summary { box-shadow: none; }
  .lp-head, .lp-summary { animation: none; }
  .lp-head a, .lp-summary a, .lp-body a { color: inherit; }
}
