/* ============================================================
   Base — reset, tipografia base e acessibilidade
   ------------------------------------------------------------
   Depende de: tokens.css
   Define defaults globais. Qualquer página herda estas regras.
   ============================================================ */

/* Reset enxuto (box-sizing, margens, outline focus consistente) */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compensa o header sticky ao usar âncoras (#sobre, etc.) */
  scroll-padding-top: 100px;
}

body {
  background-color: #F6F1EB; /* Off-white quente — fundo padrão de toda a aplicação */
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Títulos assumem serifa por default (identidade da marca) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--weight-regular);
  color: var(--color-text-strong);
  line-height: var(--leading-tight);
}

p { line-height: var(--leading-normal); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-standard);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* Proteção contra arrastar/long-press de imagens (camada CSS).
   Reforçada via js/protect.js nas páginas públicas. */
img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none; /* iOS: bloqueia menu "Salvar imagem" no long-press */
  user-select: none;
  -webkit-user-select: none;
}

/* Foco acessível — nunca remover completamente */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
/* Componentes com estado custom de foco (botões, inputs)
   devem usar a class .focus-ring ou var(--shadow-focus). */

/* Esconder com acessibilidade preservada */
.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;
}

/* hidden attribute sempre ganha (sobrescreve display: flex/grid nas superfícies) */
[hidden] { display: none !important; }

/* Scrollbar discreta nas áreas internas com overflow */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background-color: rgba(124, 106, 93, 0.28);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-track { background: transparent; }

/* Reduz motion para usuários que pediram prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
