/* ==========================================================================
   ISAC — Base: reset, tipografia e acessibilidade
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Títulos ------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-primary-dark);
  line-height: var(--leading-tight);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); line-height: var(--leading-snug); }
h4 { font-size: var(--text-md); margin-bottom: var(--space-2); color: var(--color-primary); }
h5, h6 { font-size: var(--text-base); color: var(--color-primary); }

/* --- Texto --------------------------------------------------------------- */

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  text-wrap: pretty;
}

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

strong { font-weight: var(--weight-semibold); color: var(--color-text); }

a {
  color: var(--color-secondary-dark);
  text-decoration: none;
  font-weight: var(--weight-medium);
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary); }

ul, ol { padding-left: var(--space-6); }

/* --- Mídia --------------------------------------------------------------- */

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

/* --- Visibilidade -------------------------------------------------------- */

/* Qualquer regra com display explícito vence o [hidden] do navegador.
   Como os filtros escondem cartões por esse atributo, ele precisa ganhar. */
[hidden] { display: none !important; }

/* --- Formulários --------------------------------------------------------- */

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

/* --- Acessibilidade ------------------------------------------------------ */

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 999;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  color: var(--color-text-inverse);
}

.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;
}

::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

@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;
  }
}

/* --- Revelação ao rolar, aplicada apenas quando o JS está ativo ---------- */

.will-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.will-reveal.is-revealed {
  opacity: 1;
  transform: none;
}
