@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,900;1,9..144,600&family=IBM+Plex+Mono:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap");

:root {
  --paper: #f2ebdd;
  --paper-2: #e7ddca;
  --paper-3: #ded2ba;
  --paper-white: #fffaf0;
  --ink: #101014;
  --edge: #c8bda5;
  --muted: #4f4c44;
  --red: #b5202a;
  --orange: #ef7622;
  --navy: #08275c;
  --green: #06775a;
  --gold: #8a5e00;
  --serif: "Newsreader", Georgia, serif;
  --display: "Fraunces", Georgia, serif;
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1240px;
  --grain: radial-gradient(rgba(16, 16, 20, .05) .5px, transparent .6px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  background-image: var(--grain);
  background-size: 3px 3px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(8, 39, 92, .45); transition: color .18s; }
a:hover { color: var(--red); text-decoration-color: var(--red); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
img { max-width: 100%; }
strong { font-weight: 600; }
h1, h2, h3, h4 { margin: 0; }

.wrap { width: min(var(--maxw), calc(100% - 44px)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 90;
  padding: 10px 16px; background: var(--ink); color: var(--paper-white);
  font-family: var(--sans); font-size: .8rem; font-weight: 700;
  text-decoration: none; transition: top .16s;
}
.skip-link:focus { top: 12px; color: var(--paper-white); }

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: rgba(16, 16, 20, .08); }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--orange)); }

/* ---------- hero ---------- */
.hero {
  padding: clamp(38px, 7vh, 80px) 0 clamp(34px, 5vh, 58px);
  background: var(--paper-2);
  background-image: var(--grain);
  background-size: 3px 3px;
  border-bottom: 2px solid var(--ink);
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--sans); font-weight: 700; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .13em;
}
.brand img { width: 34px; height: 34px; }

.eyebrow {
  font-family: var(--sans); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .13em; color: var(--red);
  display: flex; align-items: center; gap: .6em;
  margin: 26px 0 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; flex: none; }

.hero h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 900;
  font-size: clamp(2.7rem, 6.6vw, 5.6rem);
  line-height: .93;
  letter-spacing: -.028em;
  max-width: 15ch;
}
.hero h1 em { font-style: italic; font-weight: 600; color: var(--red); }

.deck {
  margin: 22px 0 0;
  max-width: 62ch;
  font-size: clamp(1.06rem, 1.5vw, 1.24rem);
  line-height: 1.55;
  color: #2a2822;
}
.hero-back { margin: 24px 0 0; font-family: var(--sans); font-size: .82rem; font-weight: 600; }

/* ---------- shell + sumário ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
  padding: clamp(34px, 5vh, 60px) 0 70px;
}

.toc { position: sticky; top: 22px; }
.toc-inner {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 16px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.toc-title {
  margin: 0 0 12px;
  font-family: var(--sans); font-weight: 800; font-size: .64rem;
  text-transform: uppercase; letter-spacing: .18em; color: var(--red);
}
.toc-group { margin: 14px 0 4px; }
.toc-group a {
  font-family: var(--sans); font-weight: 700; font-size: .76rem;
  line-height: 1.3; text-decoration: none; color: var(--ink);
  display: block; border-bottom: 1px solid transparent;
}
.toc-group a:hover { color: var(--red); border-bottom-color: var(--red); }
.toc ul { list-style: none; margin: 0 0 6px; padding: 0; }
.toc li { margin: 0; }
.toc li a {
  display: block; padding: 3px 0;
  font-family: var(--mono); font-size: .7rem; line-height: 1.35;
  color: var(--muted); text-decoration: none;
}
.toc li a:hover { color: var(--red); }

/* ---------- blocos ---------- */
.doc { min-width: 0; }
.block { margin-bottom: clamp(44px, 6vh, 76px); }
.kicker {
  margin: 0 0 8px;
  font-family: var(--sans); font-weight: 700; font-size: .66rem;
  text-transform: uppercase; letter-spacing: .16em; color: var(--red);
}
.doc h2 {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.02; letter-spacing: -.02em;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}
.block p { margin: 0 0 14px; max-width: 74ch; }
.src { font-family: var(--sans); font-size: .8rem; color: var(--muted); }

/* ---------- fatos ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 24px 0 18px;
}
.fact {
  padding: 18px 18px 16px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(16, 16, 20, .1);
}
.fact strong {
  display: block; margin-bottom: 10px;
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: .95; letter-spacing: -.03em; color: var(--red);
}
.fact p { margin: 0; font-size: .92rem; line-height: 1.5; }

/* ---------- quadro comparativo ---------- */
.table-wrap { overflow-x: auto; margin: 22px 0 6px; border: 1.5px solid var(--ink); background: var(--paper-white); }
table.compare { width: 100%; min-width: 640px; border-collapse: collapse; }
.compare th, .compare td { padding: 13px 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--edge); }
.compare thead th {
  font-family: var(--sans); font-weight: 800; font-size: .64rem;
  text-transform: uppercase; letter-spacing: .13em;
  background: var(--ink); color: var(--paper-white); border-bottom: none;
}
.compare tbody th {
  width: 19%;
  font-family: var(--sans); font-weight: 700; font-size: .84rem; line-height: 1.3;
}
.compare td { font-size: .9rem; line-height: 1.48; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: none; }
.compare .now { color: var(--muted); width: 33%; }
.compare .new { border-left: 3px solid var(--green); background: rgba(6, 119, 90, .045); }
.ref {
  display: block; margin-top: 7px;
  font-family: var(--mono); font-size: .67rem; letter-spacing: .02em; color: var(--gold);
}

/* ---------- minutas ---------- */
.minutas { margin-bottom: clamp(44px, 6vh, 76px); }
.minutas-h {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.02; letter-spacing: -.02em;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.minutas-note { margin: 14px 0 0; max-width: 74ch; font-family: var(--sans); font-size: .8rem; color: var(--muted); }

/* seções injetadas do laudo: neutraliza o chrome do dossiê */
.minutas .chapter { padding: 34px 0 0; }
.minutas .wrap { width: 100%; }
.minutas .chapter-head { display: flex; align-items: baseline; margin-bottom: 4px; padding: 0; border: none; }
.minutas .chapter-head .eyebrow { margin: 0; }
.minutas .section-head h2 {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.06; letter-spacing: -.018em; margin: 10px 0 0;
  padding: 0; border: none;
}
.minutas .section-head .deck { margin: 12px 0 0; font-size: 1rem; line-height: 1.55; max-width: 74ch; }

.law {
  margin-top: 22px; padding: clamp(20px, 3vw, 34px);
  border: 2px solid var(--ink); background: var(--paper-white); color: var(--ink);
  box-shadow: 6px 6px 0 rgba(16, 16, 20, .12);
}
.law-title { padding-bottom: 16px; margin-bottom: 8px; border-bottom: 3px double var(--ink); }
.law-title h3 {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 900; font-size: clamp(1.2rem, 2vw, 1.6rem);
  text-transform: uppercase; letter-spacing: -.01em; line-height: 1.1;
}
.law-title p { margin: 10px 0 0; font-size: .95rem; }
.law h4 {
  margin-top: 30px; padding-top: 4px;
  font-family: var(--sans); font-weight: 800; font-size: .95rem;
  color: var(--navy); text-transform: uppercase; letter-spacing: .05em;
  scroll-margin-top: 20px;
}
/* Medida de leitura curta: texto normativo é lido palavra a palavra, não varrido. */
.law p { margin: 11px 0; font-size: .97rem; line-height: 1.62; max-width: 76ch; }
.law ol, .law ul { margin: 8px 0 8px 26px; max-width: 74ch; }
.law li { margin: 7px 0; font-size: .97rem; line-height: 1.6; }
.law-title p { max-width: 70ch; }
.law-note {
  margin-top: 24px; padding: 16px 18px; max-width: 82ch;
  border-left: 5px solid var(--gold); background: var(--paper-3);
  font-family: var(--sans); font-size: .86rem; line-height: 1.55;
}

/* ---------- uso ---------- */
.links { margin: 18px 0 0; padding: 0; list-style: none; }
.links li { margin: 0; border-top: 1px solid var(--edge); }
.links li:last-child { border-bottom: 1px solid var(--edge); }
.links a {
  display: block; padding: 11px 0;
  font-family: var(--sans); font-size: .86rem; font-weight: 600; text-decoration: none;
}
.links a::after { content: " →"; color: var(--red); }
.links a:hover { color: var(--red); }
.nota-agentes {
  margin: 22px 0 0; padding: 14px 16px;
  border-left: 5px solid var(--gold); background: var(--paper-3);
  font-family: var(--sans); font-size: .84rem; line-height: 1.55;
}

/* ---------- rodapé ---------- */
footer {
  padding: 44px 0 56px;
  background: var(--ink);
  color: #cfcabd;
  border-top: 2px solid var(--ink);
}
footer p { margin: 0 0 12px; max-width: 78ch; font-size: .9rem; line-height: 1.55; }
footer strong { color: #fbf7ee; }
footer a { color: #ffc178; text-decoration-color: rgba(255, 193, 120, .45); }
footer a:hover { color: #ffd9a8; }
.foot-brand {
  display: flex; align-items: center; gap: 11px; margin-bottom: 16px;
  font-family: var(--sans); font-weight: 700; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .13em; color: #fbf7ee;
}

/* ---------- responsivo ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc-inner { max-height: none; border-left: none; border-top: 2px solid var(--ink); padding: 14px 0 0; }
  .toc ul { columns: 2; column-gap: 22px; }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .wrap { width: calc(100% - 32px); }
  .hero h1 { max-width: none; }
  .law { box-shadow: 3px 3px 0 rgba(16, 16, 20, .12); }
  .fact { box-shadow: 3px 3px 0 rgba(16, 16, 20, .1); }
  .toc ul { columns: 1; }
}

/* ---------- impressão ---------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }

  html { scroll-behavior: auto; }
  body {
    background: #fff; background-image: none;
    color: #000; font-size: 10.5pt; line-height: 1.45;
  }
  .progress, .skip-link, .toc, .hero-back, .minutas-note, .links, .src { display: none !important; }

  a { color: #000; text-decoration: none; }
  .law-note a, .block a { text-decoration: underline; }
  /* URLs externas ficam legíveis no papel; links internos, não. */
  .block a[href^="http"]::after,
  .law a[href^="http"]::after { content: " <" attr(href) ">"; font-family: var(--mono); font-size: 7.5pt; word-break: break-all; }

  .hero {
    padding: 0 0 10mm; margin-bottom: 8mm;
    background: none; border-bottom: 1.5pt solid #000;
  }
  .hero h1 { font-size: 26pt; max-width: none; }
  .hero h1 em { color: #000; }
  .deck { font-size: 10.5pt; max-width: none; }
  .eyebrow { color: #000; margin: 12pt 0 6pt; }
  .kicker { color: #000; }

  .wrap { width: 100%; }
  .shell { display: block; padding: 0; }
  .doc h2, .minutas-h { font-size: 16pt; border-bottom: 1pt solid #000; }
  .block, .minutas { margin-bottom: 8mm; }
  .block p { max-width: none; }

  .facts { display: block; }
  .fact {
    border: .75pt solid #000; box-shadow: none; background: none;
    padding: 3mm 4mm; margin-bottom: 3mm;
    break-inside: avoid;
  }
  .fact strong { color: #000; font-size: 15pt; }

  /* Borda no <table>, não no wrapper: assim ela termina onde as linhas terminam
     e não deixa um retângulo vazio no pé da página quando uma linha quebra. */
  .table-wrap { overflow: visible; border: none; background: none; }
  table.compare { min-width: 0; border: .75pt solid #000; }
  .compare thead { display: table-header-group; }
  .compare thead th { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .compare tr { break-inside: avoid; }
  .compare .new { background: none; border-left: 1.5pt solid #000; }
  .compare .now { color: #333; }
  .ref { color: #000; }

  .minutas .chapter { padding: 0; }
  /* Sem quebra forçada entre as duas minutas: o título de cada peça já as separa,
     e forçar página deixava folhas quase em branco no meio do calhamaço. */
  .minutas .chapter + .chapter { margin-top: 8mm; }
  .minutas .section-head { break-inside: avoid; break-after: avoid; }
  .minutas .section-head h2 { font-size: 13pt; }
  .law {
    border: 1pt solid #000; box-shadow: none; background: none;
    padding: 4mm 0 0; margin-top: 4mm; border-width: 0;
    border-top: 1pt solid #000;
  }
  .law-title { break-after: avoid; }
  .law h4 { color: #000; break-after: avoid; margin-top: 5mm; }
  .law p, .law li { font-size: 10pt; orphans: 3; widows: 3; }
  /* A nota é longa: deixá-la fluir entre páginas evita folha órfã quase vazia. */
  .law-note { background: none; border-left: 2pt solid #000; font-size: 9pt; orphans: 3; widows: 3; max-width: none; }

  footer {
    background: none; color: #000;
    border-top: 1pt solid #000; padding: 6mm 0 0;
    break-inside: avoid;
  }
  footer strong, footer a { color: #000; }
  footer p { max-width: none; font-size: 8.5pt; }
  .foot-brand { color: #000; }
}
