/* ============================================================
   Nós pela Educação — base compartilhada
   Tokens, reset, tipografia, botões, cabeçalho e rodapé.
   Usado por todas as páginas.
   ============================================================ */

:root {
  /* --- Superfícies --- */
  --paper: #f5f2ed; /* creme — fundo */
  --paper-card: #fcfbf7; /* cartões sobre o creme */
  --petrol: #2c4a52; /* verde-petróleo — tinta principal */
  --petrol-deep: #1f363c; /* petróleo profundo — rodapé e contato */

  /* --- Verdes ---
     sage       = decorativo (bordas, pontos, fundo de chip). NÃO usar em texto.
     sage-ink   = texto de destaque sobre o creme  (contraste 4.9:1 — AA)
     sage-light = texto de destaque sobre o petróleo (contraste 5.2:1 — AA) */
  --sage: #8faf9f;
  --sage-ink: #47725f;
  --sage-light: #a8c6b6;

  /* --- Apoio --- */
  --muted: #5d7175; /* texto de apoio sobre o creme (4.6:1 — AA) */
  --slate: #8a9a9f; /* decorativo — números, traços. NÃO usar em texto pequeno. */
  --line: #dad6cc; /* linhas e bordas */

  /* --- Tipografia --- */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- Layout --- */
  --maxw: 1180px;
  --maxw-texto: 760px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
  --header-h: 68px;

  /* Altura mínima de área clicável (WCAG 2.5.8) */
  --touch: 44px;
}

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

html {
  scroll-behavior: smooth;
  /* Compensa o cabeçalho fixo ao navegar por âncoras (#formacoes etc.) */
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--petrol);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgb(71 114 95 / 0.15);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 460;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
  /* Evita títulos com uma palavra sozinha na última linha no mobile */
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
}

/* O atributo hidden precisa vencer qualquer display definido em classe —
   é o que controla o gate dos textos e o filtro das formações. */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2.5px solid var(--sage-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Só para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Link "pular para o conteúdo" — aparece ao navegar por teclado */
.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--petrol);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.7em 1.2em;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: transform 0.18s ease;
}
.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline-offset: -4px;
}

/* ---------- Sobrescrita (eyebrow) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-ink);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  display: inline-block;
  flex: 0 0 auto;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: var(--touch);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8em 1.5em;
  border-radius: 100px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.2s ease,
    color 0.2s ease;
}
.btn-primary {
  background: var(--petrol);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--petrol-deep);
  transform: translateY(-2px);
}
.btn-ghost {
  border-color: var(--petrol);
  color: var(--petrol);
}
.btn-ghost:hover {
  background: var(--petrol);
  color: var(--paper);
  transform: translateY(-2px);
}
.btn-arrow {
  transition: transform 0.2s ease;
}
.btn:hover .btn-arrow {
  transform: translateX(3px);
}
/* Em telas de toque não existe hover: evita o card/botão "grudar" no estado hover */
@media (hover: none) {
  .btn:hover {
    transform: none;
  }
}

/* ---------- Cabeçalho ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(10px)) {
  header.site {
    background: var(--paper);
  }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.4vw, 1.25rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  color: var(--petrol);
  flex: 0 1 auto;
  min-width: 0;
}
.brand b {
  color: var(--sage-ink);
  font-weight: 560;
}
.brand-mark {
  height: 44px;
  width: auto;
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--petrol);
  position: relative;
  padding-block: 0.3rem;
  white-space: nowrap;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--sage);
  transition: width 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}
.nav-cta .btn-primary {
  white-space: nowrap;
}
/* No celular o botão encurta para "Proposta" — assim o nome do coletivo
   continua visível no cabeçalho em vez de ser escondido. */
.rotulo-curto {
  display: none;
}

/* Link de volta nas páginas de artigo */
.back {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding-inline: 0.2rem;
}
.back:hover {
  color: var(--sage-ink);
}

/* ---------- Menu mobile ---------- */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  background: none;
  border: 1.5px solid var(--petrol);
  border-radius: 10px;
  cursor: pointer;
  color: var(--petrol);
  flex: 0 0 auto;
}
.menu-toggle svg {
  display: block;
}
.menu-toggle .icon-close {
  display: none;
}
.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}
.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--paper);
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-menu.open {
  display: block;
}
.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0.25rem var(--gutter) 1.25rem;
}
.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0.55rem 0;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.mobile-menu li:last-child a {
  border-bottom: 0;
}
.mobile-menu a[aria-current="true"] {
  color: var(--sage-ink);
}

/* ---------- Rodapé ---------- */
footer.site {
  background: var(--petrol-deep);
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  padding-block: 2.5rem 2rem;
  border-top: 1px solid color-mix(in srgb, var(--paper) 12%, transparent);
}
footer.site .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.4rem;
}
footer.site .brand {
  color: var(--paper);
}
footer.site .brand b {
  color: var(--sage-light);
}
.foot-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.foot-links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
}
.foot-links a:hover {
  color: var(--sage-light);
}
.foot-contatos {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  font-size: 0.9rem;
}
.foot-contatos a {
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
}
.foot-contatos a:hover {
  color: var(--sage-light);
}
.foot-note {
  margin: 1.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
}

/* ---------- Separador decorativo ---------- */
.divider {
  display: flex;
  align-items: center;
  opacity: 0.7;
}
.divider svg {
  width: 100%;
  height: 14px;
}

/* ---------- Ponto de virada mobile ---------- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .nav-cta .btn-primary {
    padding: 0.7em 1.05em;
    font-size: 0.875rem;
  }
  footer.site .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }
  .foot-links {
    gap: 0.4rem 1.2rem;
  }
}

@media (max-width: 620px) {
  .rotulo-longo {
    display: none;
  }
  .rotulo-curto {
    display: inline;
  }
  .brand {
    gap: 0.45rem;
  }
}

@media (max-width: 359px) {
  /* Só nas telas mais estreitas o texto da marca sai e fica apenas o selo,
     que já traz a palavra "NÓS". */
  header.site .brand span:not(.sr-only) {
    display: none;
  }
  .nav-cta .btn-primary {
    padding: 0.7em 0.9em;
  }
}

/* ---------- Impressão ---------- */
@media print {
  :root {
    --paper: #fff;
    --paper-card: #fff;
  }
  header.site,
  footer.site,
  .skip-link,
  .mobile-menu {
    display: none !important;
  }
  body {
    font-size: 11pt;
  }
  a {
    text-decoration: none;
    color: #000;
  }
}
