/* base.css - reset, typography, body */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

html {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: var(--leading-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;       /* explicito: filhos esticam cross-axis (horizontal) */
  letter-spacing: var(--tracking-base);
}

/* main: flex item do body + container flex column proprio (hierarquia).
   Largura vem do body (= tela), nao do conteudo. Filhos esticam horizontal. */
main {
  flex: 1;
  width: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

h1, h2, h3, h4 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-3xl); }
}

p { color: var(--color-text); }

a:hover { color: var(--color-primary); }

::selection { background: var(--color-primary-soft); color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--space-6); }
}

.hide-mobile { display: none; }
@media (min-width: 768px) {
  .hide-mobile { display: initial; }
  .hide-desktop { display: 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;
}

/* WCAG 2.4.1 Bypass Blocks - skip-link audit 2026-05-18 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.skip-link:focus {
  left: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* WCAG 2.4.11 Focus Not Obscured (Min) - header sticky offset */
html { scroll-padding-top: calc(var(--header-h, 56px) + 16px); }
:focus-visible { scroll-margin-top: calc(var(--header-h, 56px) + 16px); }
