/* ==========================================================================
   RSAF v2 — "Monografia Clínica" · Base
   Reset enxuto, tipografia do documento, utilitários, superfícies do
   navegador tematizadas pela paleta (seleção, scrollbar, caret, foco).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
figure, figcaption, blockquote { margin: 0; }
html, body { overflow-x: clip; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-700); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--teal-900); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-head);
  text-wrap: balance;
  margin: 0 0 var(--space-s);
  color: var(--ink);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); font-weight: 700; letter-spacing: var(--tracking-tight); }
h4 { font-size: var(--step-1); font-weight: 700; }

p { margin: 0 0 var(--space-s); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
em { font-style: italic; }

::selection { background: var(--teal); color: var(--on-teal); }
input, textarea { caret-color: var(--teal); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}
[data-surface="teal"] :focus-visible { outline-color: var(--on-teal); }

/* Scrollbar tematizada */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-2); border-left: var(--rule); }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border: 3px solid var(--paper-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }
html { scrollbar-color: var(--hairline-strong) var(--paper-2); scrollbar-width: thin; }

/* --------------------------------------------------------------------------
   Estrutura do documento
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - (2 * var(--gutter)), var(--container));
  margin-inline: auto;
}
.container--wide { width: min(100% - (2 * var(--gutter)), var(--container-wide)); }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * 0.62); }
.section + .section { border-top: var(--rule); }

.skip-link {
  position: absolute; left: var(--space-s); top: -100%;
  z-index: 200; padding: var(--space-2xs) var(--space-s);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: var(--step--1);
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus-visible { top: var(--space-s); }

/* --------------------------------------------------------------------------
   Gramática da monografia
   -------------------------------------------------------------------------- */

/* Rótulo em mono — SOMENTE para medida, dado, código e wayfinding decimal.
   Nunca como "eyebrow" decorativo: a numeração carrega a hierarquia. */
.mono {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-3);
}
.mono--teal { color: var(--teal-700); }
.mono--on-teal { color: var(--teal-300); }
.mono--warn { color: var(--burgundy); }

/* Número decimal de seção integrado ao título (wayfinding informacional) */
.sec-head { margin-bottom: var(--space-xl); max-width: 56rem; }
.sec-head h2 { margin-bottom: var(--space-xs); }
.sec-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--teal);
  font-size: 0.5em;
  letter-spacing: 0.04em;
  vertical-align: 0.42em;
  margin-right: 0.5em;
}
.sec-lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }

/* Caixa de bula — o contêiner assinatura do mundo */
.bula {
  border: var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
}
.bula__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-2xs) var(--space-s);
  border-bottom: var(--rule);
  background: var(--paper-2);
}
.bula__body { padding: var(--space-s) var(--space-s) var(--space-m); }
.bula--teal .bula__head { background: var(--teal-050); border-bottom-color: var(--teal-100); }
.bula--warn { border-color: var(--burgundy); }
.bula--warn .bula__head {
  background: var(--burgundy-050);
  border-bottom-color: var(--burgundy);
}

/* Figura-espécime (painel emoldurado com legenda numerada) */
.fig { border: var(--rule); border-radius: var(--radius-s); background: var(--paper); }
.fig__canvas { border-bottom: var(--rule); background: var(--paper-2); overflow: hidden; position: relative; }
.fig__caption {
  display: flex; gap: var(--space-xs); align-items: baseline;
  padding: var(--space-2xs) var(--space-s);
  font-family: var(--font-mono); font-size: var(--step--1);
  color: var(--ink-3); letter-spacing: 0.02em;
}
.fig__caption b { color: var(--teal-700); font-weight: 600; white-space: nowrap; }

/* Tabela de dose / composição — numerais tabulares, leader dots */
.dose { width: 100%; border-collapse: collapse; }
.dose th, .dose td {
  padding: var(--space-xs) var(--space-2xs);
  border-bottom: var(--rule);
  text-align: left; vertical-align: top;
}
.dose th {
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 600;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-3);
}
.dose td:first-child { font-weight: 600; white-space: nowrap; }
.dose tr:last-child td { border-bottom: 0; }
.dose .num, .tnum {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Marcas de registro gráficas (chrome de impressão consciente) */
.reg-mark { position: absolute; width: 14px; height: 14px; pointer-events: none; opacity: 0.55; }
.reg-mark::before, .reg-mark::after {
  content: ""; position: absolute; background: var(--hairline-strong);
}
.reg-mark::before { left: 50%; top: 0; width: 1px; height: 100%; }
.reg-mark::after { top: 50%; left: 0; height: 1px; width: 100%; }

/* Placeholders de conteúdo editável — identificados, nunca disfarçados */
.placeholder {
  font-family: var(--font-mono); font-size: 0.92em; font-weight: 500;
  color: var(--teal-700);
  background: var(--teal-050);
  border-bottom: 1px dashed var(--teal);
  padding-inline: 0.2em; border-radius: 2px;
}
.placeholder__frame {
  display: grid; place-items: center; gap: var(--space-2xs);
  min-height: 100%;
  background:
    repeating-linear-gradient(45deg, transparent 0 11px, rgba(42, 122, 122, 0.06) 11px 12px),
    var(--teal-050);
  border: 1px dashed var(--teal); border-radius: var(--radius-s);
  color: var(--teal-900);
  text-align: center; padding: var(--space-l);
}
.placeholder__frame .mono { color: var(--teal-700); }

/* Utilitários */
.grid, .hero__grid, .about__grid, .anestesia__grid, .safety__grid,
.contact__grid, .cred__grid, .partners__grid, .safety__figs, .channels {
  min-width: 0;
}
.grid > *, .hero__grid > *, .about__grid > *, .anestesia__grid > *,
.safety__grid > *, .contact__grid > *, .cred__grid > *, .partners__grid > *,
.safety__figs > *, .channels > *, .form__row > * {
  min-width: 0;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.flow > * + * { margin-top: var(--space-s); }
.text-2 { color: var(--ink-2); }
.text-3 { color: var(--ink-3); }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
