/* ============================================================
   Papelaria Reinel — Legal pages
   Loaded *in addition to* styles.css, which supplies the brand
   tokens (--paper, --ink, --terracotta, fonts, .wrap, .muted…).
   Kept separate so the production landing page stylesheet is
   never touched by legal-page work.

   No inline styles anywhere: the CSP forbids style="" and the
   SHA-256 hash in netlify.toml covers only the <noscript> block.
   ============================================================ */

.legal-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.legal-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.legal-header .brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.legal-back {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terracotta-deep);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.legal-back:hover,
.legal-back:focus-visible {
  border-bottom-color: currentColor;
}

.legal-main {
  padding: 3rem 0 4.5rem;
}
.legal-main .wrap {
  max-width: 46rem; /* ~75 characters: the readable measure for long text */
}

.legal-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}
.legal-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.legal-toc {
  background: var(--paper-deep);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 3rem;
}
.legal-toc h2 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin-bottom: 0.9rem;
}
.legal-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.9rem;
  line-height: 1.9;
}
.legal-toc a {
  border-bottom: 1px solid transparent;
}
.legal-toc a:hover,
.legal-toc a:focus-visible {
  border-bottom-color: var(--terracotta);
}

.legal-main section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 1.5rem;
}
.legal-main h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.legal-main h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 1.75rem 0 0.6rem;
}
.legal-main p,
.legal-main li {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.legal-main p + p {
  margin-top: 0.9rem;
}
.legal-main strong {
  color: var(--ink);
  font-weight: 600;
}

.legal-main ul,
.legal-main ol {
  margin: 0.9rem 0 0;
  padding-left: 1.3rem;
  list-style: disc;
}
.legal-main ol {
  list-style: decimal;
}
.legal-main li + li {
  margin-top: 0.5rem;
}
.legal-main ul ul {
  margin-top: 0.5rem;
  list-style: circle;
}

/* Statutory reference — the law a clause rests on, kept visible so the
   reader can verify it rather than take our word for it. */
.legal-ref {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.6rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
}

/* Clauses the consumer benefits from and that we cannot derogate. */
.legal-note {
  background: var(--paper-deep);
  border-left: 3px solid var(--terracotta);
  border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.35rem;
  margin-top: 1.25rem;
}
.legal-note p {
  color: var(--ink);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.92rem;
}
.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}
.legal-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
}
.legal-table td {
  color: var(--ink-soft);
}
.legal-scroll {
  overflow-x: auto;
}

.legal-id {
  background: var(--paper-deep);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.legal-id strong {
  display: block;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

/* O :not(.btn) e obrigatorio. Sem ele esta regra (especificidade 0,2,1)
   vence .btn-verde do shop.css (0,1,0) e pinta o texto dos botoes de
   terracota sobre fundo verde — 1,20:1, ilegivel. Acontecia no botao
   "Ver os packs" da pagina 404, o unico .btn dentro de .legal-main. */
.legal-main a:not(.legal-back):not(.btn) {
  color: var(--terracotta-deep);
  border-bottom: 1px solid var(--terracotta-soft);
  transition: border-color 0.2s var(--ease);
}
.legal-main a:not(.legal-back):not(.btn):hover,
.legal-main a:not(.legal-back):not(.btn):focus-visible {
  border-bottom-color: var(--terracotta);
}

/* Footer links sit on the terracotta band and inherit the body colour, which
   would leave them indistinguishable from surrounding text — colour alone is
   never a sufficient cue (WCAG 1.4.1). Underline them. */
.site-footer .small a {
  border-bottom: 1px solid rgba(248, 241, 231, 0.45);
  transition: border-color 0.2s var(--ease);
}
.site-footer .small a:hover,
.site-footer .small a:focus-visible {
  border-bottom-color: var(--paper);
}

/* Withdrawal form — printable and copy-pasteable, not a live form:
   submitting it would need form-action beyond 'self'. */
.legal-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  margin-top: 1.5rem;
  font-size: 0.92rem;
  line-height: 2.1;
  color: var(--ink);
  white-space: pre-wrap;
  font-family: var(--font-sans);
}

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

@media (max-width: 640px) {
  .legal-toc ol {
    columns: 1;
  }
  .legal-main {
    padding: 2rem 0 3rem;
  }
}

@media print {
  .legal-header,
  .legal-toc,
  .site-footer {
    display: none;
  }
  .legal-main p,
  .legal-main li {
    color: #000;
  }
}
