/* app/assets/stylesheets/02_base.css — reset e elementos semanticos */

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

body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t4);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Regra 4: Cormorant so no h1 de pagina e no numero-destaque. */
h1 {
  font-family: var(--font-display);
  font-size: var(--t7);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h2 { font-size: var(--t5); font-weight: 600; line-height: 1.25; }
h3 { font-size: var(--t4); font-weight: 600; }

p { max-width: var(--measure); }

a {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--accent); }

small { font-size: var(--t2); color: var(--ink-muted); }

/* Tabelas: o esqueleto; a densidade e o desenho de coluna vem do .data-table. */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; }
th, td { padding: var(--s3) var(--s4); }

/* Formularios */
label {
  display: block;
  font-size: var(--t2);
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: var(--s1);
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  padding: var(--s2) var(--s3);
  font-family: inherit;
  font-size: var(--t4);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
textarea { min-height: 6rem; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--ink-faint); }

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* button_to do Rails gera <form><button>: sem isto as acoes inline nao alinham. */
form.button_to { display: inline; margin: 0; }

button, input[type="submit"] {
  font-family: inherit;
  font-size: var(--t3);
  cursor: pointer;
}

legend {
  font-size: var(--t2);
  font-weight: 600;
  color: var(--ink-muted);
  padding: 0;
}

/* Regra 9: nada acima de 200ms, e reduced-motion respeitado. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/* Rotulo que so existe para leitor de tela (coluna de acoes, por exemplo). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
