/* Camada de leitura: contraste, ritmo e enquadramento.
   Sobrepõe styles.css sem o substituir. */

:root {
  --leitura: "Segoe UI", Bahnschrift, Candara, sans-serif;
  --gelo: #f4f7fb;
  --gelo-2: #d5deea;
  --noite: #071018;
  --cobre: #e8a15a;
  --ciano: #9cf0e4;
}

html, body {
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--leitura);
  font-size: 1.0625rem;
  color: var(--gelo);
  background-color: var(--noite);
  line-height: 1.7;
}

.logo-mark {
  background: url("../sinal-marca/marca.svg") center / cover no-repeat !important;
  clip-path: none !important;
}

.logo-mark::after { content: none !important; }

.salto-leitura {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--cobre);
  color: #1a1006;
  padding: 0.55rem 0.8rem;
  z-index: 2000;
  font-weight: 700;
}

.salto-leitura:focus { top: 0.6rem; }

h1, h2, h3, h4, .logo, .stat-value, .card h3, .page-hero h1 {
  color: #ffffff;
}

.hero h1 em { color: var(--cobre) !important; }

.hero-text,
.section-lead,
.page-hero p,
.prose p,
.prose li,
.card-body p,
.info-card p,
.info-card a,
.job-card p,
.footer-brand p,
.footer-col a,
.footer-bottom,
.disclaimer,
.acc-content p,
.stat-label,
.card-meta,
th,
.term-popup,
.job-meta {
  color: var(--gelo-2) !important;
}

.section-title span,
.card-tag,
.info-card h3,
.hero-label,
a { color: var(--ciano); }

a:hover { color: #ffffff; }

.nav-links a { color: var(--gelo-2) !important; font-size: 0.95rem; }
.nav-links a.active,
.nav-links a:hover { color: #ffffff !important; }

.btn-primary {
  background: #9a3412 !important;
  color: #ffffff !important;
  clip-path: none !important;
  border-radius: 2px;
}

.btn-ghost {
  color: #ffffff !important;
  border-color: rgba(244, 247, 251, 0.45) !important;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  padding: 0;
}

.stat-strip {
  margin: 0 !important;
  width: 100%;
  padding: 0 !important;
}

.hero-visual { margin-left: 0 !important; margin-bottom: 0 !important; }
.hero-badge { left: 0.75rem !important; color: #1a1006 !important; background: var(--cobre) !important; }

.filter-tag {
  color: #f4f7fb !important;
  background: #10202c;
  border: 1px solid rgba(244, 247, 251, 0.28);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.filter-tag.active { background: #9a3412 !important; color: #ffffff !important; }

.hero {
  padding-top: 3.5rem;
}

.hero-grid {
  align-items: center;
  gap: 2rem;
}

.hero-copy { padding-right: 0; }

.hero h1 {
  font-size: clamp(2.05rem, 4.6vw, 3.55rem) !important;
  max-width: 14ch;
}

.hero-text { font-size: 1.12rem !important; max-width: 36rem; }

.stat-label { font-size: 0.84rem !important; letter-spacing: 0.04em; }
.stat-value { font-size: clamp(1.8rem, 3vw, 2.4rem); }

/* Início: fichas em fita alternada */
body[data-folha="inicio"] .card-grid {
  display: flex !important;
  flex-direction: column;
  gap: 1.1rem !important;
}

body[data-folha="inicio"] .card {
  display: grid !important;
  grid-template-columns: minmax(140px, 34%) 1fr !important;
  width: min(100%, 920px);
  grid-column: auto !important;
}

body[data-folha="inicio"] .card:nth-child(even) {
  margin-left: auto;
  grid-template-columns: 1fr minmax(140px, 34%) !important;
}

body[data-folha="inicio"] .card:nth-child(even) .card-img { order: 2; }

body[data-folha="inicio"] .card-img,
body[data-folha="inicio"] .card:nth-child(1) .card-img,
body[data-folha="inicio"] .card:nth-child(2) .card-img {
  height: 100%;
  min-height: 168px;
}

/* Análises: mosaico irregular */
body[data-folha="analises"] .card-grid {
  display: grid !important;
  grid-template-columns: 1.15fr 0.85fr !important;
  gap: 1rem !important;
}

body[data-folha="analises"] .card {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  grid-column: auto !important;
}

body[data-folha="analises"] .card:nth-child(1) { grid-row: span 2; }
body[data-folha="analises"] .card:nth-child(4) { grid-column: 1 / -1; }
body[data-folha="analises"] .card:nth-child(1) .card-img { height: 280px; }

.card { cursor: pointer; }
.card h3 { font-size: 1.28rem; line-height: 1.25; }
.card h3 a { color: #ffffff !important; }
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.card-body p { font-size: 1.02rem !important; }
.card-img img { filter: none !important; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
}

.ordenacao-local {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gelo);
  font-size: 0.92rem;
}

.ordenacao-local select,
.calc-field input,
.calc-field select,
.correio-local input,
.correio-local textarea {
  background: #10202c;
  color: var(--gelo);
  border: 1px solid rgba(244, 247, 251, 0.28);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 1rem;
}

.page-hero {
  background:
    linear-gradient(100deg, rgba(7, 16, 24, 0.94) 0%, rgba(7, 16, 24, 0.72) 58%, rgba(7, 16, 24, 0.45) 100%),
    var(--capa) center / cover no-repeat;
  padding: 4.2rem 0 3.2rem;
  margin-bottom: 2rem;
}

body[data-folha="analises"] { --capa: url("../placa-visual/placa-dados.jpg"); }
body[data-folha="glossario"] { --capa: url("../placa-visual/placa-arvore.jpg"); }
body[data-folha="redacao"] { --capa: url("../placa-visual/placa-redacao.jpg"); }
body[data-folha="vagas"] { --capa: url("../placa-visual/placa-recursos.jpg"); }
body[data-folha="pacto"] { --capa: url("../placa-visual/placa-cartas.jpg"); }
body[data-folha="legal"] { --capa: url("../placa-visual/placa-territorio.jpg"); }
body[data-folha="peca"] { --capa: url("../placa-visual/hero-poliedros.jpg"); }

.page-hero h1 { max-width: 18ch; font-size: clamp(2rem, 4vw, 3.1rem) !important; }
.page-hero p { font-size: 1.12rem !important; }

.faixa-noticias .noticia-lista {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 1rem;
}

.noticia {
  border-left: 3px solid var(--cobre);
  padding: 1.1rem 1.2rem 1.2rem;
  background: #0d1a24;
}

.noticia:first-child {
  grid-row: span 2;
  background:
    linear-gradient(180deg, rgba(7, 16, 24, 0.2), rgba(7, 16, 24, 0.82)),
    url("../placa-visual/placa-arvore.jpg") center / cover;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.noticia h3 { margin-bottom: 0.45rem; font-size: 1.25rem; }
.noticia p { color: var(--gelo) !important; font-size: 1.02rem; }
.noticia time { color: var(--cobre); font-size: 0.86rem; letter-spacing: 0.06em; }

.faixa-duvidas .accordion { max-width: 46rem; margin-left: 8vw; }

table { min-width: 0; }
th { font-size: 0.84rem !important; background: #10202c; }
td { color: var(--gelo); font-size: 1rem; }
tr.linha-ativa td { background: rgba(232, 161, 90, 0.16); }

.calc-panel, .info-card, .job-card, .acc-item {
  background: #0d1a24;
}

.calc-result strong { color: #ffffff; font-size: 1.6rem; }

.prose { max-width: 46rem; }
.prose p, .prose li { font-size: 1.08rem !important; }

.correio-local {
  display: grid;
  gap: 0.7rem;
  max-width: 36rem;
  margin-top: 1rem;
}

.correio-local label {
  display: grid;
  gap: 0.35rem;
  color: #f4f7fb;
  text-align: left;
}

.correio-local button {
  justify-self: start;
  background: #9a3412;
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
}

.form-aviso { min-height: 1.4em; color: var(--cobre) !important; }

.peca-grelha { display: grid; gap: 1.6rem; align-items: start; }
.peca-a .peca-grelha { grid-template-columns: 0.78fr 1.22fr; }
.peca-b .peca-grelha { grid-template-columns: 1fr; max-width: 46rem; margin-inline: auto; }
.peca-c .peca-grelha { grid-template-columns: 1.25fr 0.75fr; }
.peca-c .peca-foto { position: sticky; top: 5.2rem; }
.peca-d .peca-grelha { grid-template-columns: 0.7fr 1.3fr; }
.peca-d .peca-foto { order: -1; }
.peca-e .peca-foto { width: min(100%, 38rem); margin: 0 0 1.4rem auto; }
.peca-f .peca-grelha { grid-template-columns: 1fr 1fr; }
.peca-foto img { width: 100%; height: auto; object-fit: cover; }
.peca-kicker { color: var(--cobre); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; font-weight: 700; }
.peca h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; margin: 0.4rem 0 1rem; max-width: 18ch; }
.peca p { margin-bottom: 1rem; color: var(--gelo-2); font-size: 1.08rem; }
.peca-nota {
  border-top: 1px solid rgba(244, 247, 251, 0.2);
  padding-top: 0.8rem;
  color: var(--gelo) !important;
}

.folha-termo {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 12, 0.72);
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.folha-termo[hidden] { display: none; }

.folha-termo-painel {
  width: min(100%, 28rem);
  background: #10202c;
  color: var(--gelo);
  border: 1px solid rgba(244, 247, 251, 0.2);
  padding: 1.3rem 1.3rem 1.15rem;
}

.folha-termo-kicker { color: var(--cobre); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.folha-termo-texto { color: var(--gelo) !important; font-size: 1.05rem; margin: 0.7rem 0 1rem; }
.folha-termo-fechar {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(244, 247, 251, 0.4);
  font: inherit;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.aviso-cookies {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 1.5rem));
  background: #10202c;
  color: var(--gelo);
  border: 1px solid rgba(244, 247, 251, 0.22);
  padding: 0.9rem 1rem;
  z-index: 2500;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.aviso-cookies p { color: var(--gelo) !important; font-size: 0.98rem; margin: 0; }
.aviso-cookies div { display: flex; gap: 0.7rem; align-items: center; flex-shrink: 0; }
.aviso-cookies button {
  background: var(--cobre);
  color: #1a1006;
  border: 0;
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--cobre);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .nav-toggle { display: grid !important; place-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #071018;
    padding: 0.8rem 1rem 1.2rem;
    border-bottom: 1px solid rgba(244, 247, 251, 0.14);
    z-index: 30;
  }
  .nav-links.open { display: flex !important; }
}

@media (max-width: 860px) {
  .hero-grid,
  .faixa-noticias .noticia-lista,
  .peca-a .peca-grelha,
  .peca-c .peca-grelha,
  .peca-d .peca-grelha,
  .peca-f .peca-grelha,
  body[data-folha="analises"] .card-grid,
  .info-grid,
  .footer-grid,
  .calc-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-folha="inicio"] .card,
  body[data-folha="inicio"] .card:nth-child(even) {
    grid-template-columns: 1fr !important;
    width: min(100%, 36rem);
    margin-inline: auto !important;
  }

  body[data-folha="inicio"] .card:nth-child(even) .card-img { order: 0; }

  body[data-folha="analises"] .card,
  body[data-folha="analises"] .card:nth-child(1),
  body[data-folha="analises"] .card:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
    width: min(100%, 36rem);
    margin-inline: auto !important;
  }

  .hero-copy,
  .section-title,
  .section-lead,
  .page-hero h1,
  .page-hero p,
  .prose,
  .peca,
  .faixa-duvidas .accordion,
  .text-center,
  .noticia {
    width: min(100%, 36rem);
    margin-inline: auto;
    text-align: center;
  }

  .section-title { max-width: none; }
  .hero-actions, .filter-bar, .ordenacao-local, .job-meta, .footer-bottom, .aviso-cookies {
    justify-content: center;
  }

  .ordenacao-local { margin-left: 0; width: 100%; }
  .filter-bar { justify-content: center; }
  .peca-c .peca-foto { position: static; }
  .peca-e .peca-foto { margin-inline: auto; }
  .faixa-duvidas .accordion { margin-left: auto; }
  .aviso-cookies { flex-direction: column; text-align: center; }
  .hero-badge { position: static; display: inline-block; margin-top: 0.8rem; }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap td { border-bottom: 1px solid rgba(244, 247, 251, 0.12); text-align: center; }
  .table-wrap td::before {
    content: attr(data-rotulo);
    display: block;
    color: var(--cobre);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
  }
  .table-wrap tr { margin-bottom: 0.8rem; background: #0d1a24; }
}
