/* ==========================================================================
   LAR MONTES SORIANO - BASE & RESET (BASE.CSS)
   Acessibilidade WCAG, Tipografia e Normalização Moderna
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-body);
  background-color: var(--color-bg-main);
  background-image: radial-gradient(rgba(67, 118, 184, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--header-height);
}

/* Seleção de Texto Estilizada */
::selection {
  background-color: var(--color-sage-100);
  color: var(--color-forest-900);
}

/* Links Acessíveis */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* Foco Acessível Universal */
:focus-visible {
  outline: 3px solid var(--color-terracotta-500);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Imagens e Mídia Responsiva */
img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Tipografia de Cabeçalhos */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--color-text-title);
  font-weight: 700;
  line-height: var(--line-height-snug);
  letter-spacing: -0.015em;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-body);
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: 600;
  color: var(--color-text-title);
}

/* Botões e Entradas Interativas */
button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
}

button {
  cursor: pointer;
  user-select: none;
}

/* Listas */
ul, ol {
  list-style: none;
}

/* Atalho de Acessibilidade: Skip to Content */
.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--color-forest-700);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 99999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
}

/* Utilitários de Visibilidade Acessível */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
