:root {
  /* Paleta sóbria (paper-like) */
  --bg: #fbfbfc;
  --surface: #ffffff;
  --ink: #111827;
  --muted: rgba(17, 24, 39, 0.72);
  --line: rgba(17, 24, 39, 0.14);
  --accent: #0f3d6e;
  --accent-2: #0b6b4d;

  /* Tipografia */
  --serif: ui-serif, "Georgia", "Cambria", "Times New Roman", Times, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans",
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Layout */
  --max: 980px;
  --radius: 14px;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  padding: clamp(18px, 3.2vw, 34px) clamp(16px, 3.4vw, 28px);
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

/* Links */
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: #0b2f55; }
a:visited { color: #2a3f63; }

/* Títulos */
h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); letter-spacing: -0.01em; line-height: 1.2; scroll-margin-top: 18px; }
h1 { font-size: clamp(28px, 3.2vw, 40px); margin: 28px 0 10px; }
h2 { font-size: clamp(22px, 2.3vw, 28px); margin: 22px 0 10px; padding-top: 8px; border-top: 1px solid rgba(17, 24, 39, 0.08); }
h3 { font-size: 18px; margin: 18px 0 8px; }
h4 { font-size: 16px; margin: 16px 0 6px; }

p { margin: 12px 0 0; color: rgba(17, 24, 39, 0.88); }

hr { border: 0; height: 1px; background: rgba(17, 24, 39, 0.10); margin: 18px 0; }

ul, ol { margin: 12px 0 0; padding-left: 1.25em; }
li { margin: 6px 0; color: rgba(17, 24, 39, 0.86); }

pre { margin: 14px 0 0; padding: 14px 14px; background: rgba(17, 24, 39, 0.04); border: 1px solid rgba(17, 24, 39, 0.10); border-radius: var(--radius); overflow-x: auto; box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06); }
code { font-family: var(--mono); font-size: 0.95em; background: rgba(17, 24, 39, 0.05); border: 1px solid rgba(17, 24, 39, 0.10); border-radius: 8px; padding: 0.12em 0.32em; }
pre code { background: transparent; border: 0; padding: 0; font-size: 0.92em; line-height: 1.55; display: block; white-space: pre; }

blockquote { margin: 16px 0 0; padding: 12px 14px; border-left: 4px solid rgba(15, 61, 110, 0.55); background: linear-gradient(180deg, rgba(15, 61, 110, 0.06), rgba(11, 107, 77, 0.04)); border-radius: 12px; color: rgba(17, 24, 39, 0.86); }
blockquote p { margin-top: 0; }

table { width: 100%; border-collapse: collapse; margin: 14px 0 0; font-size: 0.96em; background: var(--surface); border: 1px solid rgba(17, 24, 39, 0.12); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
th, td { padding: 10px 12px; border-bottom: 1px solid rgba(17, 24, 39, 0.10); text-align: left; vertical-align: top; }
th { font-family: var(--sans); font-size: 0.92em; letter-spacing: -0.01em; color: rgba(17, 24, 39, 0.86); background: rgba(17, 24, 39, 0.03); }
tr:last-child td { border-bottom: 0; }

img, svg { max-width: 100%; height: auto; }
img { display: block; margin: 14px auto 0; border-radius: 12px; border: 1px solid rgba(17, 24, 39, 0.10); box-shadow: 0 16px 40px rgba(17, 24, 39, 0.10); }

.back-to-sumario { margin-left: 10px !important; font-size: 12px !important; font-family: var(--sans); letter-spacing: 0.02em; text-transform: uppercase; color: rgba(17, 24, 39, 0.60) !important; text-decoration: none !important; border: 1px solid rgba(17, 24, 39, 0.12); padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.65); }
.back-to-sumario:hover { text-decoration: none; color: rgba(17, 24, 39, 0.78) !important; border-color: rgba(15, 61, 110, 0.28); background: rgba(15, 61, 110, 0.06); }

@media print {
  body { background: #ffffff; padding: 0; max-width: none; font-size: 12pt; line-height: 1.55; color: #000; }
  a { color: #000; text-decoration: none; }
  img { box-shadow: none; }
  pre { box-shadow: none; }
}

/* Rodapé (copyright/uso) */
footer.tcc-footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid rgba(17, 24, 39, 0.12); color: rgba(17, 24, 39, 0.72); font-family: var(--sans); font-size: 0.92em; line-height: 1.6; }
footer.tcc-footer a { color: var(--accent); }
footer.tcc-footer .title { font-weight: 700; color: rgba(17, 24, 39, 0.86); margin-bottom: 6px; }

/* Additional print safety block (matches body-level print overrides) */
@media print {
  @page { size: A4; margin: 12mm; }
  body {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
    line-height: 1.45 !important;
  }
  nav, .toc, .sumario-link, .voltar, .actions, .lead-box, .note,
  a[href^="#"] { display: none !important; }
  a { color: #000 !important; text-decoration: none !important; }
  img, figure, table, pre, blockquote { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
}
