/* ---------------------------------------------------------------------------
   Site público — tokens herdados do DESIGN_SYSTEM.md do projeto (navy
   institucional + dourado contido). Para trocar pelas cores da campanha, mexa
   só neste bloco: todo o resto da folha consome as variáveis.
   --------------------------------------------------------------------------- */
:root {
  /* Paleta extraída do "Sistema Cromático Narrativo" da campanha. Cada cor
     tem significado próprio lá: trabalhadores, infraestrutura, resultado e
     agricultura — e é assim que elas são usadas nas etiquetas de área. */
  --canvas: #f2ede3;          /* off-white da campanha */
  --surface: #ffffff;
  --surface-subtle: #f8f5ef;
  --ink: #062241;             /* navy do sistema; 13,7:1 sobre o off-white */
  --body: #26333f;
  --muted: #5d6b7a;
  --border: #ddd5c8;

  /* O rosa da marca (#e7284d) reprova no contraste com texto branco (4,37).
     O vinho da mesma família passa com 6,15 e mantém a identidade. */
  --brand: #bb223f;
  --brand-strong: #93192f;
  --brand-soft: #f7e2e6;
  --rosa: #e7284d;

  --accent: #bb223f;

  /* Cores narrativas, para as etiquetas de área. Todas com texto navy. */
  --tema-pessoas: #e7284d;
  --tema-infra: #ffa239;
  --tema-futuro: #ffc143;
  --tema-gestao: #4273e3;
  --tema-campo: #c2d337;
  --tema-territorio: #465231;

  --success: #1e7d4f;
  --shadow-md: 0 8px 24px rgba(6, 34, 65, 0.10);
  --shadow-lg: 0 20px 55px rgba(6, 34, 65, 0.16);
  --radius: 10px;
  --radius-lg: 14px;
  --max: 1180px;
  --font-display: "Lora", Georgia, serif;
  --font-body: "Public Sans", "Inter", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0d1a26;
    --surface: #142433;
    --surface-subtle: #1a2d3f;
    --ink: #f2ede3;
    --body: #cfdae5;
    --muted: #93a5b6;
    --border: #24394f;
    --brand: #e7284d;         /* no escuro o rosa da marca tem contraste de sobra */
    --brand-strong: #f2506f;
    --brand-soft: #2a1a24;
    --accent: #ffc143;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --canvas: #0d1a26;
  --surface: #142433;
  --surface-subtle: #1a2d3f;
  --ink: #f2ede3;
  --body: #cfdae5;
  --muted: #93a5b6;
  --border: #24394f;
  --brand: #e7284d;
  --brand-strong: #f2506f;
  --brand-soft: #2a1a24;
  --accent: #ffc143;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }
p { margin: 0; }
a { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 20px; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Marcador de conteúdo que o gabinete precisa substituir. Some com
   `document.documentElement.classList.add('publicado')` ou removendo a classe. */
.preencher {
  background: linear-gradient(transparent 62%, rgba(169, 121, 8, 0.22) 62%);
  border-bottom: 1px dotted var(--accent);
}

/* ---------- topo ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topo .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.marca { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; }
.marca img { height: 34px; width: auto; }
.marca .nome { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); }
.menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a { padding: 8px 12px; border-radius: 8px; color: var(--body); font-size: 15px; text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.menu a:hover { background: var(--surface-subtle); color: var(--ink); }
/* Especificidade acima de `.btn`, que define display e vem depois nesta folha. */
.topo .menu-toggle { display: none; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 15px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primario { background: var(--brand); color: #fff; }
.btn-primario:hover { background: var(--brand-strong); }
.btn-secundario { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secundario:hover { border-color: var(--brand); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ---------- seções ---------- */
section { padding: clamp(48px, 7vw, 88px) 0; }
.secao-cabeca { display: flex; flex-direction: column; gap: 10px; max-width: 62ch; margin-bottom: 32px; }
.secao-cabeca p { color: var(--muted); }

/* ---------- hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); }
.hero .wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero-texto { display: flex; flex-direction: column; gap: 20px; }
.hero-texto p.chamada { font-size: 18px; color: var(--muted); max-width: 52ch; }
.hero-acoes { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-foto { position: relative; }
.hero-foto img, .hero-foto .placeholder-foto { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.placeholder-foto {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: repeating-linear-gradient(135deg, var(--surface-subtle), var(--surface-subtle) 12px, var(--brand-soft) 12px, var(--brand-soft) 24px);
  color: var(--muted);
  font-size: 14px;
}
.mandato { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 8px; border-top: 1px solid var(--border); }
.mandato div { display: flex; flex-direction: column; }
.mandato strong { font-family: var(--font-display); font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mandato span { font-size: 13px; color: var(--muted); }

/* ---------- grades ---------- */
.grade { display: grid; gap: 20px; }
.grade-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
/* Etiquetas de área nas cores narrativas da campanha. Cada par fundo/texto foi
   medido: o rosa #e7284d e o azul #4273e3 reprovam no contraste em texto
   pequeno, então usam os tons escuros das próprias faixas do sistema. */
.card .tema { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--tema, var(--brand-soft)); color: var(--tema-texto, #062241); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tema-pessoas    { --tema: #bb223f; --tema-texto: #fff; }   /* 6,15:1 */
.tema-infra      { --tema: #ffa239; --tema-texto: #062241; } /* 7,98:1 */
.tema-futuro     { --tema: #ffc143; --tema-texto: #062241; } /* 9,87:1 */
.tema-gestao     { --tema: #062241; --tema-texto: #fff; }    /* 16,0:1 */
.tema-campo      { --tema: #c2d337; --tema-texto: #062241; } /* 9,65:1 */
.tema-territorio { --tema: #465231; --tema-texto: #fff; }    /* 8,36:1 */
.card p { color: var(--muted); font-size: 15px; }

/* ---------- sobre ---------- */
.sobre { background: var(--surface); border-block: 1px solid var(--border); }
.sobre .wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
.sobre-texto { display: flex; flex-direction: column; gap: 16px; }
.sobre-texto p { color: var(--body); }

/* ---------- agenda ---------- */
.agenda-lista { display: flex; flex-direction: column; gap: 12px; }
.agenda-item {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.agenda-item.proximo { border-color: var(--brand); box-shadow: var(--shadow-md); }
.agenda-data { display: flex; flex-direction: column; align-items: center; padding: 8px; background: var(--brand-soft); border-radius: 8px; }
.agenda-data strong { font-family: var(--font-display); font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.agenda-data span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.agenda-info h3 { font-size: 18px; }
.agenda-info p { font-size: 14px; color: var(--muted); }
.selo { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 700; }

/* ---------- redes ---------- */
.redes { background: var(--surface); border-block: 1px solid var(--border); }
.rede { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-subtle); text-decoration: none; transition: border-color 150ms ease, transform 150ms ease; }
.rede:hover { border-color: var(--brand); transform: translateY(-2px); }
.rede strong { color: var(--ink); }
.rede span { font-size: 14px; color: var(--muted); }

/* ---------- galeria ---------- */
.galeria { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.galeria > * { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; }
.galeria > *:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.galeria img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- formulário ---------- */
.participe { background: var(--brand); color: #fff; }
.participe h2, .participe .eyebrow { color: #fff; }
.participe .wrap { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
.participe-texto p { color: rgba(255, 255, 255, 0.82); }
.form-caixa { padding: clamp(24px, 3vw, 32px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo.largo { grid-column: 1 / -1; }
.campo label { font-size: 14px; font-weight: 600; color: var(--ink); }
.campo input, .campo select, .campo textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--body);
  font: 15px/1.4 var(--font-body);
}
.campo textarea { min-height: 96px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); outline-offset: 0; }
.campo .erro { font-size: 13px; color: #b3363f; }
.consentimento { display: flex; gap: 10px; align-items: flex-start; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); }
.consentimento input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.consentimento label { font-size: 13px; color: var(--muted); line-height: 1.5; }
.form-retorno { margin-top: 16px; padding: 14px; border-radius: var(--radius); font-size: 14px; }
.form-retorno[data-tom="ok"] { background: #e9f5ee; color: var(--success); border: 1px solid #bfdccd; }
.form-retorno[data-tom="erro"] { background: #fdf0f1; color: #b3363f; border: 1px solid #ebc3c6; }

/* ---------- rodapé ---------- */
.rodape { padding: 48px 0 32px; background: var(--surface); border-top: 1px solid var(--border); }
.rodape .wrap { display: flex; flex-direction: column; gap: 24px; }
.rodape-topo { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.rodape-menu { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; margin: 0; padding: 0; }
.rodape-menu a { color: var(--muted); font-size: 14px; text-decoration: none; }
.rodape-menu a:hover { color: var(--brand); }
.identificacao { padding: 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--muted); }
.identificacao strong { color: var(--ink); }

@media (max-width: 900px) {
  .hero .wrap, .sobre .wrap, .participe .wrap { grid-template-columns: 1fr; }
  .grade-3, .grade-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-foto { order: -1; max-width: 340px; }
  .galeria { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .menu { display: none; }
  .menu.aberto { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .topo .menu-toggle { display: inline-flex; }
  .grade-2, .grade-3, .grade-4, .campos { grid-template-columns: 1fr; }
  .agenda-item { grid-template-columns: 72px 1fr; }
  .agenda-item .selo { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Assinatura "Coragem que move" ao lado do formulário.
   A arte tem CORAGEM em amarelo, QUE em off-white e MOVE em rosa: some tanto
   sobre fundo rosa (MOVE) quanto sobre off-white (QUE). O navy do sistema é o
   único fundo onde as três palavras leem — é para ele que a arte foi desenhada.
   Recolorir o arquivo do designer não é opção; o que muda é a base. */
.assinatura-base { display: inline-block; margin-top: 24px; padding: 18px 22px; border-radius: var(--radius-lg); background: #062241; box-shadow: var(--shadow-md); }
.assinatura { width: 200px; height: auto; }
@media (max-width: 900px) { .assinatura { width: 160px; } }

/* A foto oficial é 4:5. Sem teto de largura ela vira 1200px de altura e
   empurra o texto da primeira tela para fora do campo de visão. */
.hero-foto { justify-self: start; width: 100%; max-width: 420px; }
.hero-foto img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* A marca ocupa o lugar do título no banner. Continua sendo o <h1> da página:
   o texto alternativo carrega o nome para leitores de tela e para a busca. */
.hero-marca { margin: 4px 0 6px; }
.hero-marca img { width: min(100%, 460px); height: auto; }
.hero-texto .eyebrow { letter-spacing: 0.14em; }
@media (max-width: 900px) {
  .hero-foto { order: -1; justify-self: center; max-width: 320px; }
  .hero-marca img { width: min(100%, 380px); }
}

/* Etiquetas no tema escuro.
   O navy da faixa "gestão" e o oliva de "território" são quase o fundo do card
   no escuro — o navy dava contraste 1,01, ou seja, a etiqueta desaparecia e só
   sobrava o texto solto. No escuro eles usam as versões claras das mesmas
   famílias, com texto navy. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tema-gestao     { --tema: #6f9df0; --tema-texto: #062241; } /* 5,9:1 */
  :root:not([data-theme="light"]) .tema-territorio { --tema: #a8bd7f; --tema-texto: #062241; }
}
:root[data-theme="dark"] .tema-gestao     { --tema: #6f9df0; --tema-texto: #062241; }
:root[data-theme="dark"] .tema-territorio { --tema: #a8bd7f; --tema-texto: #062241; }

/* ---------- troca de tema ---------- */
.topo-acoes { display: flex; align-items: center; gap: 8px; }

.tema-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.tema-toggle:hover { border-color: var(--brand); }
/* Sol e lua desenhados em CSS: sem ícone externo, sem fonte extra para baixar. */
.tema-icone { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: box-shadow 150ms ease, transform 150ms ease; }
.tema-toggle[data-tema="light"] .tema-icone { box-shadow: 0 0 0 2px var(--surface) inset; }
.tema-toggle[data-tema="dark"] .tema-icone { background: transparent; box-shadow: inset -5px -3px 0 0 var(--ink); transform: rotate(-25deg); }

/* ---------- foto do banner por tema ----------
   O contraste é invertido de propósito: fundo claro recebe a foto de fundo
   navy, fundo escuro recebe a de fundo branco. Assim o retrato sempre se
   destaca em vez de se dissolver na página. */
.hero-foto .foto-no-escuro { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-foto .foto-no-claro { display: none; }
  :root:not([data-theme="light"]) .hero-foto .foto-no-escuro { display: block; }
}
:root[data-theme="dark"] .hero-foto .foto-no-claro { display: none; }
:root[data-theme="dark"] .hero-foto .foto-no-escuro { display: block; }
:root[data-theme="light"] .hero-foto .foto-no-claro { display: block; }
:root[data-theme="light"] .hero-foto .foto-no-escuro { display: none; }
