/* =============================================================================
   FONTES — o @import saiu daqui de propósito.
   -----------------------------------------------------------------------------
   Este arquivo começava com:

       @import url('https://fonts.googleapis.com/css2?family=Barlow...');

   Funciona, mas coloca os dois downloads EM FILA: o navegador precisa baixar e
   interpretar este CSS inteiro antes de descobrir que também precisa das fontes.
   Enquanto isso, o texto fica invisível.

   Agora a chamada está no <head> (app/Visoes/layout.php), com preconnect e
   display=swap: os dois downloads começam juntos e o texto aparece de imediato
   na fonte do sistema até a definitiva chegar.

   ⚠️ Se este CSS for reaproveitado em outro lugar sem aquele <head>, as fontes
   NÃO serão carregadas e o site cai para a fonte padrão do navegador.
   ============================================================================= */

:root {
  --green-primary: #279544;
  --green-secondary: #48b44c;
  --green-light: #eaf1ee;
  --silver: #9a9a9a;
  --white: #ffffff;
  --dark: #1a1a1a;
  --gradient-green: linear-gradient(135deg, #279544, #48b44c);

  --bg: #ffffff;
  --bg-section: #f7faf8;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --border: #e0ebe3;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 8px 32px rgba(39, 149, 68, 0.15);
}

[data-theme="dark"] {
  --bg: #121a15;
  --bg-section: #17221b;
  --bg-card: #1f2d24;
  --text-primary: #ffffff;
  /* Títulos agora em branco puro */
  --text-secondary: #c2d6c6;
  /* Textos secundários mais claros e legíveis */
  --border: #2e4235;
  --nav-bg: rgba(18, 26, 21, 0.97);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(39, 149, 68, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  transition: background 0.3s, color 0.3s;
  line-height: 1.6;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}

.nav-logo img {
  height: 38px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green-primary);
  background: var(--green-light);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  background: rgba(39, 149, 68, 0.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-contato {
  background: var(--gradient-green);
  color: white !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-contato:hover {
  opacity: 0.9;
}

.btn-client {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-client:hover,
.btn-client.active {
  border-color: var(--green-primary);
  color: var(--green-primary);
  background: var(--green-light);
}

[data-theme="dark"] .btn-client:hover,
[data-theme="dark"] .btn-client.active {
  background: rgba(39, 149, 68, 0.15);
}

.btn-client svg {
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .btn-client-label {
    display: none;
  }

  .btn-client {
    padding: 6px 10px;
  }
}

.theme-toggle {
  background: var(--bg-section);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

main {
  padding-top: 68px;
}

.section {
  padding: 80px 2rem;
}

.section-alt {
  background: var(--bg-section);
}

.container {
  max-width: 1140px;
  margin: 0 auto;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-primary);
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 20px;
}

.section-title span {
  color: var(--green-primary);
  font-style: italic;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.7;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--green-secondary);
}

.icon {
  width: 48px;
  height: 48px;
  background: var(--green-light);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--green-primary);
}

[data-theme="dark"] .icon {
  background: rgba(39, 149, 68, 0.15);
}

.icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--gradient-green);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);
}

.btn-outline:hover {
  background: var(--green-primary);
  color: white;
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 2rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(72, 180, 76, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(39, 149, 68, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* 
   VÍDEO DE FUNDO DO HERO
   O `position: absolute` é o que faz o vídeo virar FUNDO. Sem ele o <video> é
   um elemento normal e entra como item do flex de .
   O vídeo preenche o .hero inteiro*/
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* cover preenche a área sem distorcer a imagem: sobra é cortada, em vez de
     esticar a fábrica. */
  object-fit: cover;
  /* fica atrás do .hero-content, que tem z-index 1 */
  z-index: 0;
  /* sem isso o vídeo captura o clique dos botões que estão em cima dele */
  pointer-events: none;
}

/* Véu escuro entre o vídeo e o texto.*/
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(8, 20, 12, 0.74) 0%,
      rgba(8, 20, 12, 0.50) 45%,
      rgba(8, 20, 12, 0.80) 100%);
}

/* Sobre o vídeo, o texto é SEMPRE claro — nos dois temas. As variáveis de tema
   dariam cinza escuro no modo claro, ilegível em cima do vídeo. */
.hero .hero-desc {
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}

.hero .hero-logo {
  /* sombra escura em vez do brilho verde: é o que destaca a logo prateada
     quando o quadro do vídeo está claro */
  filter: drop-shadow(0 6px 26px rgba(0, 0, 0, 0.55));
}

/* O botão vazado era verde sobre verde; sobre o vídeo ele precisa ser branco. */
.hero .btn-outline {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hero .btn-outline:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--green-primary);
}

/* Quem pediu ao sistema para reduzir animações não recebe o vídeo: fica a
   imagem parada no lugar. Também é o que aparece se o navegador bloquear o
   autoplay. */
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }

  .hero {
    background-image: url('../assets/img/fabrica-interna.jpg');
    background-size: cover;
    background-position: center;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  max-width: 720px;
  width: 100%;
  height: auto;
  margin-bottom: 32px;
  filter: drop-shadow(0 8px 32px rgba(39, 149, 68, 0.15));
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats {
  display: flex;
  gap: 64px;
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--green-primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-hero {
  background: var(--gradient-green);
  padding: 64px 2rem;
  color: white;
}

.page-hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
}

.page-hero p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 580px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--green-secondary);
}

.product-card.featured {
  border-color: var(--green-primary);
}

.product-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--green-primary);
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 12px;
}

.product-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-top: 6px;
  margin-bottom: 20px;
}

.product-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.product-features {
  list-style: none;
  margin-bottom: 24px;
  flex-grow: 1;
}

.product-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.product-features li:last-child {
  border-bottom: none;
}

.product-features li svg {
  width: 16px;
  height: 16px;
  color: var(--green-primary);
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.btn-saiba-mais {
  width: 100%;
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: auto;
}

.btn-saiba-mais:hover {
  background: var(--green-primary);
  color: white;
}

.btn-saiba-mais svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s;
}

.btn-saiba-mais:hover svg {
  transform: translateX(3px);
}

footer {
  background: var(--dark);
  color: #ccc;
  padding: 64px 2rem 32px;
}

[data-theme="dark"] footer {
  background: #0d120f;
}

.footer-grid {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 48px;
}

.footer-brand img {
  height: 50px;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: #999;
  max-width: 260px;
}

.footer-col h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  text-decoration: none;
  color: #999;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--green-secondary);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #999;
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  color: var(--green-secondary);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom a {
  color: #666;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--green-secondary);
}

.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 56px;
  height: 56px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  text-decoration: none;
  transition: all 0.2s;
  animation: pulse-wpp 2.5s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: white;
}

@keyframes pulse-wpp {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }

  50% {
    box-shadow: 0 4px 32px rgba(37, 211, 102, 0.65);
  }
}

.divider {
  width: 48px;
  height: 3px;
  background: var(--gradient-green);
  border-radius: 2px;
  margin-bottom: 20px;
}

.check-list {
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.check-list li:last-child {
  border-bottom: none;
}

.check-list li svg {
  width: 18px;
  height: 18px;
  color: var(--green-primary);
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  flex-shrink: 0;
  margin-top: 2px;
}

.plain-list {
  list-style: none;
}

.plain-list li {
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.plain-list li:last-child {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--green-light);
  color: var(--green-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[data-theme="dark"] .badge {
  background: rgba(39, 149, 68, 0.2);
}

.process-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s;
}

.process-step:hover {
  border-color: var(--green-secondary);
  transform: translateX(4px);
}

.process-step-number {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--green-primary);
  font-style: italic;
  line-height: 1;
  min-width: 56px;
}

.process-step-content h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.process-step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 16px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-stats {
    gap: 32px;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 60px 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============ ANIMATIONS ============ */

body {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

body.page-loaded {
  opacity: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

nav {
  transition: height 0.3s ease, background 0.3s, box-shadow 0.3s;
}

nav.nav-scrolled {
  height: 58px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] nav.nav-scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

nav.nav-scrolled .nav-logo img {
  height: 32px;
  transition: height 0.3s ease;
}

.nav-logo img {
  transition: height 0.3s ease;
}

.card,
.product-card,
.contact-info-card,
.progress-card,
.process-step {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

.hero-logo {
  animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.btn,
.btn-saiba-mais,
.btn-contato {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover::after {
  left: 100%;
}

.icon {
  transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover .icon {
  transform: scale(1.08);
}

.section-label {
  position: relative;
  padding-left: 0;
  transition: padding-left 0.4s ease;
}

.section-label.reveal-visible {
  padding-left: 0;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: var(--green-primary);
  border-color: var(--green-primary);
  color: white;
  transform: translateY(-3px);
}

.footer-social a svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.scroll-top {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 998;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--green-primary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--green-primary);
  color: white;
  border-color: var(--green-primary);
  transform: translateY(-3px);
}

.scroll-top svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-logo {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.blog-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

.blog-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}

.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 15px;
  border-radius: 8px;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.3s ease;
}

.blog-card-img {
  height: 200px;
  background-size: cover;
  background-position: center;
}

.blog-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.blog-card h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.blog-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.read-more {
  margin-top: auto;
  color: var(--green-secondary);
  font-weight: bold;
  text-decoration: none;
  font-size: 14px;
}

.read-more:hover {
  color: var(--green-primary);
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  width: 100%;
}

.widget-cta {
  border-color: var(--green-primary);
}

.sidebar-widget h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-categories li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.widget-popular ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-popular li {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.widget-popular a {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-decoration: none;
}

.widget-popular span {
  font-size: 11px;
  color: var(--text-secondary);
}

.widget-newsletter input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button.active {
  background: var(--green-primary);
  border-color: var(--green-primary);
  color: white;
}

@media (max-width: 992px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ CUSTOM TOAST NOTIFICATION ============ */
#custom-toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-green);
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(39, 149, 68, 0.4);
  z-index: 9999;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: max-content;
  max-width: 90%;
}

#custom-toast svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

#custom-toast.show {
  bottom: 40px;
  opacity: 1;
  visibility: visible;
}

/* =============================================================================
   ESTILOS COMPARTILHADOS  (promovidos dos CSS de página)
   -----------------------------------------------------------------------------
   Estas regras estavam repetidas, IDÊNTICAS, em dois ou mais arquivos de página.
   Foram centralizadas aqui para existirem em um lugar só.
   Ficam no fim do arquivo de propósito: assim continuam com o mesmo peso na
   cascata que tinham antes. Os CSS de cada página carregam depois deste e
   seguem podendo sobrescrever o que precisarem.
   ============================================================================= */

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
}

.form-field {
  margin-bottom: 18px;
}

.feedback-msg.sucesso {
  display: block;
  background: rgba(39, 149, 68, 0.15);
  border: 1px solid var(--green-primary);
  color: #48b44c;
}

.feedback-msg.erro {
  display: block;
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid #dc3545;
  color: #ff6b6b;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-full {
  grid-column: 1 / -1;
}

.form-group input:focus {
  outline: none;
  border-color: var(--green-primary);
}

.form-group select:focus {
  outline: none;
  border-color: var(--green-primary);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--green-primary);
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   NOTIFICAÇÃO POR TIPO (usado por notificar() no shared.js)
   Substitui o alert() do navegador: aparece por cima da página sem travá-la.
   ============================================================================= */

#custom-toast.toast-erro {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.4);
}

#custom-toast.toast-aviso {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
}

#custom-toast.toast-info {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
}

/* Respeita quem configurou o sistema para reduzir animações */
@media (prefers-reduced-motion: reduce) {
  #custom-toast {
    transition: opacity 0.01ms;
  }
}

/* =============================================================================
   LISTA DE CATEGORIAS DO BLOG
   Os nomes vêm do banco (os mesmos cadastrados no painel admin).
   Quando há muitas, a lista é encurtada e um botão "Ver mais" a expande.
   ============================================================================= */

.widget-categories .categoria-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 8px 10px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.widget-categories .categoria-item:hover {
  color: var(--green-primary);
  background: var(--bg-section);
}

/* Indica visualmente qual filtro está aplicado */
.widget-categories .categoria-item.ativa {
  color: var(--green-primary);
  font-weight: 700;
  background: var(--green-light);
}

[data-theme="dark"] .widget-categories .categoria-item.ativa {
  background: rgba(39, 149, 68, 0.15);
}

/* Acessibilidade: contorno visível ao navegar pelo teclado */
.widget-categories .categoria-item:focus-visible,
.widget-categories .categoria-ver-mais:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

.widget-categories .categoria-nome {
  flex: 1;
  /* nome longo não quebra o layout da barra lateral */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-categories .categoria-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Botão Ver mais / Ver menos */
.widget-categories .categoria-ver-mais {
  display: block;
  margin-top: 12px;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-primary);
  background: var(--bg-section);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.widget-categories .categoria-ver-mais:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

[data-theme="dark"] .widget-categories .categoria-ver-mais:hover {
  background: rgba(39, 149, 68, 0.15);
}

/* -----------------------------------------------------------------------------
   Hero centralizado (usado na listagem do blog)
   Modificador: só afeta quem tiver a classe, as outras páginas seguem iguais.
   ----------------------------------------------------------------------------- */
.page-hero-centralizado {
  text-align: center;
}

.page-hero-centralizado p {
  margin-left: auto;
  margin-right: auto;
}

/* =============================================================================
   "MERCADO AO VIVO"
   QUATRO caixas translúcidas independentes, lado a lado e centralizadas sobre o
   fundo verde do hero. Cada indicador é um card próprio — assim o espaçamento
   entre eles é nosso (grid) e não depende do widget de terceiros.
   Compactas de propósito: a informação é acessória, não pode competir com o
   título da página.
   ============================================================================= */

/* No blog-interno não existe hero verde: esta seção cria o fundo. */
.mercado-faixa-verde {
  background: var(--gradient-green);
  padding: 22px 2rem 16px;
}

/* Só no blog há um hero para as caixas sobreporem. No blog-interno elas são o
   próprio topo da página: sem anular a margem negativa invadiriam o menu. */
.mercado-faixa-verde .mercado-area {
  margin-top: 0;
}

.mercado-area {
  /* 880px em vez de 1000: as caixas ficam mais justas ao conteúdo, o que dá
     mais respiro ao título da página, que é o protagonista do hero.
     Cada caixa fica com (880 - 3x10) / 4 = 212px. */
  max-width: 880px;
  /* margem superior negativa: puxa o bloco para perto do menu */
  margin: -22px auto 30px;
}

.mercado-selo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* As 4 caixas. minmax(0,1fr) impede que um valor longo estoure a coluna. */
.mercado-grade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mercado-box {
  position: relative;
  display: flex;
  flex-direction: column;
  /* justify-content centraliza na vertical (é uma coluna);
     align-items centraliza na horizontal. Precisa dos dois. */
  justify-content: center;
  align-items: center;
  /* As 4 caixas têm SEMPRE o mesmo tamanho:
     - largura: o grid acima divide 880px em 4 colunas iguais;
     - altura: min-height fixo, e o conteúdo é dimensionado para caber dentro
       dele (11 + 23 + 10px de texto + margens = 59,75px; + 6px de padding em
       cima e embaixo = 71,75px). Por isso o texto pôde crescer sem a caixa
       mudar de tamanho — o padding vertical caiu de 8 para 6px. */
  min-height: 72px;
  padding: 6px 12px;
  /* Vidro escuro sobre o verde. O gradiente vai de um preto levemente
     esverdeado no topo para um preto neutro embaixo — o toque de verde evita
     que a caixa pareça um bloco estranho colado no hero.
     Continua translúcido: o fundo aparece por trás, só que escurecido, o que
     dá bem mais contraste para os números em branco. */
  background: linear-gradient(150deg,
      rgba(4, 24, 13, 0.68) 0%,
      rgba(0, 0, 0, 0.54) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* sombra discreta: separa a caixa do verde sem virar relevo */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  text-align: center;
}

/* Título do indicador. Mesma altura nas quatro caixas — é o que faz os valores
   caírem todos na mesma linha de base. */
.mercado-box-titulo {
  display: block;
  /* Com align-items:center o item encolhe até o tamanho do texto. Sem este
     max-width ele passaria da borda da caixa em vez de cortar com reticências. */
  max-width: 100%;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  /* Opacidades um pouco maiores que antes: sobre o vidro escuro, o cinza claro
     precisa de mais presença para manter a mesma legibilidade que tinha sobre
     o fundo claro. */
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* O valor. É a informação principal da caixa, então domina o tamanho.
   tabular-nums trava a largura dos dígitos: sem isso o número "dança" na
   horizontal a cada atualização, porque 1 é mais estreito que 8. */
.mercado-box-numero {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Variação do dia, ao lado do valor. */
.mercado-box-var {
  margin-left: 7px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
}

/* Tons claros de propósito: sobre o vidro escuro, um verde/vermelho saturado
   perderia legibilidade. Estes passam no mínimo de contraste da WCAG. */
.mercado-box-var.em-alta {
  color: #7ef2a8;
}

.mercado-box-var.em-baixa {
  color: #ffc2c2;
}

/* Unidade e origem do dado. */
.mercado-box-rodape {
  max-width: 100%;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mercado-box-rodape a {
  color: inherit;
  text-decoration: none;
}

.mercado-box-rodape a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Valor e variação na mesma linha, alinhados pela BASE do texto — não pelo
   centro. Sem este wrapper eles seriam dois itens do flex-column da caixa e
   apareceriam um embaixo do outro. */
.mercado-box-linha {
  display: flex;
  align-items: baseline;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
}

.mercado-pulso {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: mercadoPulso 2s infinite;
}

@keyframes mercadoPulso {
  70% {
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* O widget oficial do Cepea carrega FORA DA TELA. Dele o js/mercado.js lê a
   cotação e a exibe no mesmo formato das outras caixas — era a única forma de
   alinhar os quatro valores, já que o HTML do widget é de terceiros e muda.
   O crédito exigido pela licença fica visível no rodapé da caixa.
   clip-path + tamanho 1px: some da tela mas continua sendo renderizado (com
   display:none o widget não preencheria). */
.mercado-cepea-fonte {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mercado-indisponivel {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.mercado-nota {
  max-width: 1000px;
  margin: 18px auto 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  /* centralizado junto com a caixa acima. No blog isso já vinha por herança do
     hero; no blog-interno não há hero, então precisa ser explícito. */
  text-align: center;
}

/* Quatro colunas só cabem no desktop. Abaixo disso as caixas vão quebrando
   em 2 e depois em 1, sempre mantendo o mesmo visual. */
@media (max-width: 900px) {
  .mercado-grade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .mercado-grade {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Com a faixa de mercado no topo, o hero precisa de menos respiro em cima */
.page-hero-centralizado {
  padding-top: 34px;
}

/* =============================================================================
   CAPA DO ARTIGO
   Mostra a imagem INTEIRA, sem cortar. Como cada capa enviada tem uma proporção
   diferente, a área é fixa em 16:9 e a imagem se ajusta dentro dela (contain).
   As sobras nas laterais são preenchidas por uma cópia desfocada da própria
   imagem — evita as tarjas cinza que apareceriam com um fundo chapado.
   ============================================================================= */

.capa-artigo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 460px;
  overflow: hidden;
  background: var(--bg-section);
  border-radius: 14px;
  isolation: isolate;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

/* camada de trás: mesma imagem ampliada e desfocada, só para preencher */
.capa-artigo::before {
  content: '';
  position: absolute;
  inset: -24px;
  z-index: -2;
  background-image: var(--capa);
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.75) saturate(1.1);
}

/* camada da frente: a imagem inteira, sem corte */
.capa-artigo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--capa);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Brilho verde suave ao passar o mouse */
.capa-artigo:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(72, 180, 76, 0.55),
    0 0 18px 2px rgba(72, 180, 76, 0.35),
    0 8px 26px rgba(0, 0, 0, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .capa-artigo {
    transition: none;
  }

  .capa-artigo:hover {
    transform: none;
  }
}

/* Mesmo brilho nos cartões da listagem do blog, para manter a coerência */
.blog-card {
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(72, 180, 76, 0.5);
  box-shadow:
    0 0 0 1px rgba(72, 180, 76, 0.45),
    0 0 16px 2px rgba(72, 180, 76, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   BANNER DE CONSENTIMENTO (LGPD)
   As duas opções têm o MESMO peso visual de propósito: dificultar a recusa
   caracteriza consentimento viciado e é apontado em fiscalização.
   ============================================================================= */

#banner-cookies {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 140%);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 18px;
  width: calc(100% - 32px);
  max-width: 980px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#banner-cookies.visivel {
  transform: translate(-50%, 0);
}

.cookies-texto {
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cookies-texto strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-primary);
}

.cookies-texto a {
  color: var(--green-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookies-acoes {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookies-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cookies-btn-recusar {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.cookies-btn-recusar:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.cookies-btn-aceitar {
  background: var(--gradient-green);
  border: 1px solid transparent;
  color: #ffffff;
}

.cookies-btn-aceitar:hover {
  opacity: 0.92;
}

.cookies-btn:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  #banner-cookies {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .cookies-acoes {
    justify-content: stretch;
  }

  .cookies-btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #banner-cookies {
    transition: none;
  }
}

/* Linha de consentimento dos formulários (LGPD).
   Fica visível e sem pré-marcação: consentimento tem de ser um ato da pessoa. */
.consentimento-linha {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  cursor: pointer;
}

.consentimento-linha input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--green-primary);
  cursor: pointer;
}

.consentimento-linha a {
  color: var(--green-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* rótulo visível só para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* ---------------------------------------------------------------------------
   Isca anti-robô dos formulários
   ---------------------------------------------------------------------------
   Some da tela sem usar display:none nem visibility:hidden — há robô que ignora
   campo com essas duas propriedades justamente porque são a pista óbvia de
   armadilha. Tirar de posição com left negativo é menos evidente.

   aria-hidden no HTML e tabindex="-1" no campo mantêm o leitor de tela e a
   navegação por Tab longe dele: quem usa teclado ou leitor de tela não pode
   cair numa isca feita para robô.
   --------------------------------------------------------------------------- */
.campo-isca {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* =============================================================================
   ACRÉSCIMOS DA VERSÃO PHP
   -----------------------------------------------------------------------------
   Tudo abaixo desta linha foi acrescentado na migração para PHP + MySQL. Nada
   acima foi alterado, com uma única exceção documentada no topo do arquivo (o
   @import das fontes, que saiu daqui e foi para o <head>).

   Cada bloco diz qual elemento novo ele atende e por que aquele elemento existe.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   1. Link que virou botão — "Gerenciar privacidade", no rodapé
   -----------------------------------------------------------------------------
   Era <a href="#" onclick="abrirGerenciadorConsentimento(event)">. O `onclick`
   inline obriga a Content-Security-Policy a liberar atributo de evento em TODAS
   as páginas do site (a diretiva `script-src-attr 'unsafe-inline'`), e um <a>
   sem destino real também confunde leitor de tela — que anuncia "link" para algo
   que não navega.

   Virou <button id="gerenciar-privacidade">, ligado pelo consentimento.js. Esta
   regra faz o botão parecer exatamente o link que ele substituiu.
   -------------------------------------------------------------------------- */
.link-como-botao {
  /* Zera a aparência de botão que o navegador aplica por padrão. */
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom .link-como-botao:hover {
  color: var(--green-primary);
}

.link-como-botao:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 3px;
  border-radius: 3px;
}


/* -----------------------------------------------------------------------------
   2. Capa dos cartões do blog: <img> em lugar de background-image
   -----------------------------------------------------------------------------
   A listagem antiga desenhava a capa como style="background-image: url(...)".
   Com isso o navegador não sabe as dimensões antes de baixar (a página "salta"
   quando a imagem chega) e não pode adiar o download do que está fora da tela.

   Agora é um <img loading="lazy"> com width/height — mas a classe
   .blog-card-img continua a mesma, para o resto do CSS não precisar mudar.
   Estas duas regras adaptam a classe ao novo elemento.
   -------------------------------------------------------------------------- */
img.blog-card-img {
  display: block;
  width: 100%;
  height: 200px;
  /* cover reproduz o efeito que o background-size fazia: preenche a área sem
     distorcer, cortando o excesso. */
  object-fit: cover;
  object-position: center;
}

.blog-card-img-link {
  display: block;
  line-height: 0;   /* remove o espaço fantasma abaixo da imagem inline */
}


/* -----------------------------------------------------------------------------
   3. Aviso de filtro ativo na listagem do blog
   -----------------------------------------------------------------------------
   A busca e o filtro por categoria agora estão na URL e são feitos no servidor.
   Esta linha diz quantos artigos casaram e oferece o caminho de volta — sem ela,
   quem filtra e não encontra nada não sabe que existe um filtro aplicado.
   -------------------------------------------------------------------------- */
.blog-filtro-ativo {
  margin: 0 0 20px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.blog-filtro-ativo a {
  margin-left: 8px;
  font-weight: 600;
  color: var(--green-primary);
}


/* -----------------------------------------------------------------------------
   4. "Ver mais" das categorias com <details>
   -----------------------------------------------------------------------------
   Antes era um <li role="button"> com dois ouvintes de evento em JavaScript.
   O <details> abre e fecha sozinho, é acessível por teclado por padrão e
   funciona com o script desligado.

   As regras reaproveitam a aparência de .categoria-ver-mais, que já existia.
   -------------------------------------------------------------------------- */
.widget-categories .categorias-ver-mais > summary {
  display: block;
  margin-top: 12px;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-primary);
  background: var(--bg-section);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  list-style: none;   /* esconde o triângulo padrão do navegador */
  transition: background 0.2s ease;
}

/* O triângulo do Safari e do Chrome antigo precisa deste seletor específico. */
.widget-categories .categorias-ver-mais > summary::-webkit-details-marker {
  display: none;
}

.widget-categories .categorias-ver-mais > summary::after {
  content: " \25BC";
}

.widget-categories .categorias-ver-mais[open] > summary::after {
  content: " \25B2";
}

.widget-categories .categorias-ver-mais > summary:hover {
  background: var(--green-light);
}

[data-theme="dark"] .widget-categories .categorias-ver-mais > summary:hover {
  background: rgba(39, 149, 68, 0.15);
}

.widget-categories .categorias-ver-mais > summary:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

.widget-categories .categorias-ver-mais ul {
  margin-top: 10px;
  padding: 0;
  list-style: none;
}

/* O item da lista virou um <a> por dentro (era um <li> clicável com JavaScript).
   Isto faz o link ocupar a linha inteira, mantendo a área de clique de antes. */
.widget-categories .categoria-item > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}


/* -----------------------------------------------------------------------------
   5. Aviso de pré-visualização de rascunho
   -----------------------------------------------------------------------------
   Só o admin logado consegue abrir um artigo ainda pendente pela URL real do
   blog. O aviso existe para ele não confundir a pré-visualização com a página
   publicada — e sair divulgando um endereço que o público recebe como 404.
   -------------------------------------------------------------------------- */
.aviso-rascunho {
  margin: 24px 0 0;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #7c5a00;
  background: #fff8e1;
  border: 1px solid #f0d488;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
}

[data-theme="dark"] .aviso-rascunho {
  color: #fbbf24;
  background: #2a1f00;
  border-color: #7c5a00;
}

.aviso-rascunho a {
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
}


/* -----------------------------------------------------------------------------
   6. "Leia também" no fim do artigo
   -----------------------------------------------------------------------------
   A página do artigo terminava só com "Voltar para todos os artigos": quem
   acabava de ler saía do site. Estes cartões oferecem outros textos da mesma
   categoria.
   -------------------------------------------------------------------------- */
.relacionados-grade {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.relacionado-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  text-decoration: none;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.relacionado-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-primary);
}

.relacionado-categoria {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--green-primary);
}

.relacionado-titulo {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.relacionado-data {
  font-size: 12px;
  color: var(--text-secondary);
}


/* -----------------------------------------------------------------------------
   7. Página 404
   -----------------------------------------------------------------------------
   O site não tinha uma: endereço errado caía na página cinza do Apache, sem menu
   e sem saída. Para um endereço de artigo que saiu do ar — o caso mais provável —
   isso é perder a visita.
   -------------------------------------------------------------------------- */
.erro-atalhos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}


/* -----------------------------------------------------------------------------
   8. Formulário de busca do blog
   -----------------------------------------------------------------------------
   O <input> virou um <form method="get">, para o resultado ter endereço próprio.
   A caixa .search-box já era estilizada; falta só o <form> não introduzir
   espaçamento próprio.
   -------------------------------------------------------------------------- */
form.search-box {
  margin: 0;
  padding: 0;
}

/* O botão "Buscar" fica escondido (.sr-only) porque a tecla Enter já envia o
   formulário — mas leitor de tela e navegação por teclado precisam dele. */
form.search-box input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}


/* -----------------------------------------------------------------------------
   9. Aviso de sessão do painel
   -----------------------------------------------------------------------------
   A sessão do admin agora vive num cookie HttpOnly com prazo conferido no
   servidor (8 horas no total, 2 horas de inatividade). Esta faixa avisa quando a
   sessão cai — antes o painel simplesmente mostrava listas vazias, e o admin
   achava que havia perdido os dados.
   -------------------------------------------------------------------------- */
.faixa-sessao {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #b45309;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
