/*
Theme Name: Flávio Andrade
Theme URI: https://flavioandrade.com.br
Author: Flávio Andrade
Description: Tema leve, sob medida, para notícias e painéis de dados sobre o mercado de trabalho formal brasileiro. Focado em SEO técnico e GEO (respostas para IA).
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: flavioandrade
*/

:root {
  --fa-bg: #FAF7F1;
  --fa-surface: #FFFFFF;
  --fa-surface-2: #F1EDE3;
  --fa-ink: #1E2420;
  --fa-muted: #5E6B60;
  --fa-primary: #16342A;
  --fa-primary-2: #1F4A38;
  --fa-accent: #D9A441;
  --fa-border: #E4DFD1;
  --fa-positivo: #2F8F5B;
  --fa-negativo: #B54B3C;
  --fa-max-width: 1120px;
  --fa-ok-bg: #E6F0EA;
  --fa-ok-text: #1E5B32;
  --fa-erro-bg: #F7E9E6;
  --fa-erro-text: #7A2F1F;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fa-bg: #10140F;
    --fa-surface: #171D17;
    --fa-surface-2: #1D251D;
    --fa-ink: #ECEAE2;
    --fa-muted: #9CA69B;
    --fa-border: #2B342A;
  }
}

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

html { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--fa-bg);
  color: var(--fa-ink);
  font-family: 'Public Sans', Arial, sans-serif;
  line-height: 1.6;
  padding-inline: 20px;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; text-wrap: balance; line-height: 1.2; font-weight: 600; margin: 0 0 .5em; }
a { color: var(--fa-primary); }
a:hover { color: var(--fa-accent); }
p { margin: 0 0 1em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fa-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; top: 10px; }

.fa-container {
  max-width: var(--fa-max-width);
  margin-inline: auto;
}

#conteudo-principal { padding-block-start: 36px; padding-bottom: 56px; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ===== Masthead ===== */
.site-header {
  margin-inline: -20px;
  border-bottom: 3px solid var(--fa-primary);
  background: var(--fa-bg);
}
.site-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px 14px;
  padding-inline: 20px;
  flex-wrap: wrap;
}
.site-logo { display: block; line-height: 0; }
.site-logo img, .site-logo svg { height: 34px; width: auto; display: block; }
.site-tagline {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--fa-muted);
  margin-left: 12px;
}

.site-header-actions { display: flex; align-items: center; gap: 10px; }
.search-toggle, .nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--fa-border);
  border-radius: 4px;
  background: transparent;
  color: var(--fa-ink);
  cursor: pointer;
  padding: 0;
}
.search-toggle:hover, .nav-toggle:hover { border-color: var(--fa-accent); color: var(--fa-accent); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; }
.nav-toggle-bar { width: 16px; height: 2px; background: currentColor; margin-inline: auto; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav-bar { background: var(--fa-primary); }
.primary-nav-list {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0 20px;
  max-width: calc(var(--fa-max-width) - 40px);
  margin-inline: auto;
}
.primary-nav-list > li { position: relative; }
.primary-nav-list > li > a {
  display: inline-block;
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  color: #F2F0E9;
  padding: 12px 14px;
}
.primary-nav-list > li > a:hover,
.primary-nav-list > li > a:focus { background: var(--fa-primary-2); color: #fff; }

.primary-nav-list .sub-menu {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--fa-surface);
  border: 1px solid var(--fa-border);
  box-shadow: 0 10px 24px rgba(22, 52, 42, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}
.primary-nav-list li:hover > .sub-menu,
.primary-nav-list li:focus-within > .sub-menu { display: flex; }
.primary-nav-list .sub-menu a {
  font-size: 14px;
  font-weight: 400;
  color: var(--fa-ink);
  padding: 8px 10px;
  border-radius: 3px;
}
.primary-nav-list .sub-menu a:hover, .primary-nav-list .sub-menu a:focus { background: var(--fa-surface-2); }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .primary-nav { display: none; width: 100%; }
  .primary-nav.is-open { display: block; }
  .primary-nav-list { flex-direction: column; gap: 4px; padding: 10px 20px; max-width: none; }
  .primary-nav-list > li > a { display: block; padding-block: 10px; }
  .primary-nav-list .sub-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    padding-left: 14px;
    min-width: 0;
    background: transparent;
  }
  .primary-nav-list .sub-menu a { color: #D8E0DA; }
  .primary-nav-list li:focus-within > .sub-menu { display: flex; }
}

.header-search {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease;
}
.header-search.is-open { max-height: 90px; border-top: 1px solid var(--fa-border); }
.header-search-form {
  display: flex;
  gap: 10px;
  padding-block: 14px;
  padding-inline: 20px;
}
.header-search-form input[type="search"] {
  flex: 1;
  font: inherit;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid var(--fa-border);
  background: var(--fa-surface);
  color: var(--fa-ink);
}
.header-search-form button {
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background: var(--fa-primary);
  color: #fff;
  cursor: pointer;
}

/* ===== Hero: saldo do mês ===== */
.fa-hero {
  margin: 8px 0 40px;
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--fa-border);
}
.fa-hero-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--fa-muted);
  margin-bottom: 6px;
}
.fa-hero-numero {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 700;
  font-size: clamp(52px, 10vw, 108px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 0 0 10px;
}
.fa-hero-numero.fa-positivo { color: var(--fa-positivo); }
.fa-hero-numero.fa-negativo { color: var(--fa-negativo); }
.fa-hero-contexto { font-size: 16px; color: var(--fa-muted); max-width: 60ch; margin-bottom: 14px; }
.fa-hero-link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ===== Split: notícias + ranking de setores ===== */
.fa-split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  margin: 40px 0;
}
@media (max-width: 780px) {
  .fa-split { grid-template-columns: 1fr; gap: 32px; }
}
.fa-secao-titulo {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid var(--fa-primary);
  padding-bottom: 8px;
  margin-bottom: 18px;
}

.fa-noticias-lista { display: flex; flex-direction: column; gap: 22px; }
.fa-noticia-item { display: block; text-decoration: none; color: inherit; }
.fa-noticia-item h3 { font-size: 20px; margin: 4px 0 6px; }
.fa-noticia-item:hover h3 { color: var(--fa-accent); }
.fa-noticia-item p { color: var(--fa-muted); font-size: 14.5px; margin: 0; }
.fa-noticia-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fa-primary);
  text-decoration: none;
}
.fa-noticia-eyebrow:hover { color: var(--fa-accent); }
.fa-noticia-data { font-size: 12.5px; color: var(--fa-muted); margin-left: 8px; }

.fa-ranking { display: flex; flex-direction: column; }
.fa-ranking-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--fa-border);
  text-decoration: none;
  color: inherit;
}
.fa-ranking-item:hover { color: var(--fa-accent); }
.fa-ranking-nome { font-size: 14.5px; font-weight: 500; }
.fa-ranking-valor { font-family: 'Newsreader', Georgia, serif; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fa-ranking-valor.fa-positivo { color: var(--fa-positivo); }
.fa-ranking-valor.fa-negativo { color: var(--fa-negativo); }

/* ===== Grade de setores ===== */
.fa-setores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--fa-border);
  border: 1px solid var(--fa-border);
  margin: 24px 0;
}
.fa-setor-card {
  background: var(--fa-surface);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.fa-setor-card:hover { background: var(--fa-surface-2); }
.fa-setor-card h3 { font-size: 16.5px; margin: 0 0 6px; }
.fa-setor-card p { font-size: 13.5px; color: var(--fa-muted); margin: 0; }

/* ===== Blocos de conteúdo (painel/artigo) ===== */
.fa-resumo-direto {
  border-left: 3px solid var(--fa-accent);
  background: var(--fa-surface-2);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 15.5px;
  border-radius: 0 4px 4px 0;
}

.fa-faq { margin: 28px 0; }
.fa-faq details {
  border-bottom: 1px solid var(--fa-border);
  padding: 14px 0;
}
.fa-faq summary { font-weight: 600; cursor: pointer; font-family: 'Newsreader', Georgia, serif; font-size: 17px; }
.fa-faq details p { margin-top: 10px; }

.fa-table-scroll { overflow-x: auto; margin: 16px 0; }
.fa-data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fa-data-table caption { text-align: left; font-size: 12.5px; color: var(--fa-muted); margin-bottom: 6px; }
.fa-data-table th, .fa-data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--fa-border);
  font-variant-numeric: tabular-nums;
}
.fa-data-table th { font-family: 'Newsreader', Georgia, serif; font-weight: 600; }

.fa-chart { width: 100%; height: auto; color: var(--fa-ink); }

.fa-breadcrumbs { font-size: 13px; color: var(--fa-muted); margin-block: 16px; }
.fa-breadcrumbs a { color: var(--fa-muted); }

.fa-source-note {
  font-size: 13px;
  color: var(--fa-muted);
  border-top: 1px solid var(--fa-border);
  padding-top: 12px;
  margin-top: 24px;
}

.fa-ver-tambem {
  margin: 28px 0;
  padding: 18px 20px;
  background: var(--fa-surface-2);
  border-left: 3px solid var(--fa-primary);
}
.fa-ver-tambem h2 { font-size: 14px; margin: 0 0 10px; }
.fa-ver-tambem ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ===== Rodapé ===== */
.site-footer {
  margin-inline: -20px;
  margin-top: 64px;
  background: var(--fa-primary);
  color: #D8E0DA;
}
.site-footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  padding-block: 44px;
  padding-inline: 20px;
}
.footer-col--brand { grid-column: 1 / -1; max-width: 320px; }
@media (min-width: 700px) {
  .footer-col--brand { grid-column: auto; }
}
.footer-col--brand svg, .footer-col--brand img { height: 30px; width: auto; margin-bottom: 14px; }
.footer-col--brand p { font-size: 13.5px; color: #B9C4BC; max-width: 32ch; margin: 0 0 6px; }
.footer-col h2 {
  font-family: 'Public Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #A9B6AE;
  margin: 0 0 14px;
}
.footer-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-nav-list a { font-size: 13.5px; color: #D8E0DA; text-decoration: none; }
.footer-nav-list a:hover { color: var(--fa-accent); }

.site-footer-bottom {
  border-top: 1px solid rgba(216, 224, 218, 0.15);
  padding-block: 16px;
  padding-inline: 20px;
  font-size: 12.5px;
  color: #9CA89F;
}
.site-footer-bottom p { margin: 0; }

@media (max-width: 480px) {
  .site-header-inner { justify-content: center; text-align: center; }
}

/* Formulário de contato */
.fa-form { max-width: 520px; margin: 24px 0; display: flex; flex-direction: column; gap: 4px; }
.fa-form p { margin: 0; }
.fa-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fa-form input[type="text"],
.fa-form input[type="email"],
.fa-form textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--fa-border);
  border-radius: 4px;
  background: var(--fa-surface);
  color: var(--fa-ink);
}
.fa-form textarea { resize: vertical; }
.fa-form button {
  align-self: flex-start;
  font: inherit;
  font-weight: 600;
  background: var(--fa-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 11px 22px;
  cursor: pointer;
  margin-top: 6px;
}
.fa-form button:hover { background: var(--fa-accent); color: var(--fa-ink); }
.fa-form-honeypot { position: absolute; left: -9999px; }
.fa-form-status { padding: 12px 16px; border-radius: 4px; font-size: 14px; margin: 20px 0; }
.fa-form-status--ok { background: var(--fa-ok-bg); color: var(--fa-ok-text); }
.fa-form-status--erro { background: var(--fa-erro-bg); color: var(--fa-erro-text); }
.fa-contato-direto { font-size: 14px; color: var(--fa-muted); }

/* Mapa do Site */
.fa-mapa-secao { margin: 40px 0; }
.fa-mapa-secao > p { color: var(--fa-muted); margin-top: 0; }
.fa-mapa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px 32px;
  margin-top: 20px;
}
.fa-mapa-bloco h3 { font-size: 16px; margin: 0 0 8px; }
.fa-mapa-bloco h3 a { color: var(--fa-ink); text-decoration: none; }
.fa-mapa-bloco h3 a:hover { color: var(--fa-accent); }
.fa-mapa-bloco ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fa-mapa-bloco li a { font-size: 14px; color: var(--fa-muted); text-decoration: none; }
.fa-mapa-bloco li a:hover { color: var(--fa-accent); text-decoration: underline; }
