/* Base: reset, tipografia, layout e utilitários. Mobile-first (docs/RESPONSIVIDADE.md). */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--grafite-900);
  background: var(--areia-50);
  overflow-x: clip;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--verde-900);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }

p, li { max-width: 65ch; }
a { color: var(--verde-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--verde-900); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-menu);
  background: var(--verde-900);
  color: var(--branco);
  padding: var(--space-3) var(--space-4);
}
.skip-link:focus { left: 0; }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section-verde { background: var(--verde-100); }
.section-escura { background: var(--verde-900); }
.section-escura h2, .section-escura h3 { color: var(--branco); }
.section-escura p { color: var(--verde-100); }

.section-head { margin-bottom: var(--space-8); }
.section-head .kicker {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dourado-500);
  margin-bottom: var(--space-2);
}
.section-head p { color: var(--grafite-600); margin-top: var(--space-3); font-size: var(--text-md); }

/* Grades (column drop) */
.grid { display: grid; gap: var(--space-6); }
@media (min-width: 640px) {
  .grid-2-md { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3-lg { grid-template-columns: repeat(3, 1fr); }
  .grid-4-lg { grid-template-columns: repeat(4, 1fr); }
}

/* Botões (touch target ≥44px) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn-primary { background: var(--verde-700); color: var(--branco); }
.btn-primary:hover { background: var(--verde-900); color: var(--branco); }
.btn-secundario { background: transparent; color: var(--verde-700); border-color: var(--verde-700); }
.btn-secundario:hover { background: var(--verde-100); color: var(--verde-900); }
.btn-clara { background: var(--branco); color: var(--verde-900); }
.btn-clara:hover { background: var(--areia-200); color: var(--verde-900); }
.btn-block { width: 100%; }

/* Formulários (16px evita zoom no iOS) */
label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1); color: var(--grafite-900); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--grafite-900);
  background: var(--branco);
  border: 1px solid var(--areia-200);
  border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--verde-700);
  box-shadow: 0 0 0 3px var(--verde-100);
}

/* Tabelas (políticas): scroll no wrapper, nunca na página */
.tabela-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--areia-200); }

/* Reveal no scroll (ADR-0008): só transform e opacity.
   Progressive enhancement: só esconde quando o html tem a classe .js (sem JS, tudo visível). */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
}
.js .reveal.visivel { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
