/*
Theme Name: Sensus Blog
Theme URI: https://sensustec.com.br/blog
Author: Luccas Maia
Description: Tema customizado e otimizado para o blog da Sensus Tecnologia, focado em performance e identidade visual consistente.
Version: 1.1
Text Domain: sensus
*/

/* ─── 1. VARIÁVEIS E CONFIGURAÇÕES GERAIS ─────────────────── */
:root {
  --orange:  #F58220;
  --yellow:  #FDB913;
  --green:   #8CC63F;
  --cyan:    #00A79D;
  --text:    #1A1A1A;
  --muted:   #555555;
  --bg:      #FFFFFF;
  --surface: #F8F9FA;
  --border:  #E5E7EB;
  --grad: linear-gradient(135deg, #F58220 0%, #FDB913 33%, #8CC63F 66%, #00A79D 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 100px 0; }

/* ─── 2. TIPOGRAFIA E UTILITÁRIOS ────────────────────────── */
.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 20px;
}

.section-text {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grad-divider { height: 3px; background: var(--grad); border: none; margin: 0; }

/* ─── 3. BOTÕES ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 12px 28px rgba(0,0,0,0.15); 
  opacity: 0.95; 
}

.btn-gradient { background: var(--grad); color: #fff; }
.btn-cyan { background: var(--cyan); color: #fff; }
.btn-whatsapp {
  background: #25D366; 
  color: #fff;
  border-radius: 50px;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

/* ─── 4. HEADER (MENU FIXO COM BLUR) ─────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

#header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo img { height: 40px; width: auto; }

nav { display: flex; align-items: center; gap: 6px; }

nav a {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

nav a:hover { color: var(--cyan); background: rgba(0,167,157,0.06); }

.nav-cta {
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  background: var(--grad);
  color: #fff !important;
  margin-left: 8px;
}

/* ─── ESTILIZAÇÃO DE LINKS NO CORPO DO TEXTO ──────────────── */

/* Alvos: links dentro do conteúdo do post, exceto botões */
.entry-content a:not(.btn) {
    position: relative;
    font-weight: 700;
    text-decoration: none;
    
    /* Aplicação do Degradê Sensus no Texto */
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* Linha inferior sutil para acessibilidade */
    border-bottom: 2px solid var(--cyan);
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.entry-content a:not(.btn):hover {
    opacity: 0.8;
    border-bottom-color: var(--orange);
}

/* Garante que links em negrito mantenham o estilo */
.entry-content a strong {
    color: inherit;
    background: inherit;
    -webkit-background-clip: inherit;
    -webkit-text-fill-color: inherit;
}

/* ─── 5. BLOG GRID E CARDS ───────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); 
  gap: 24px;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  position: relative; /* Necessário para o link cobrir todo o card */
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

/* Faz o link principal se esticar e cobrir todo o card */
.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.feature-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.feature-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  /* Limita as linhas com css (line-clamp) */
  display: -webkit-box;
  -webkit-line-clamp: 3; /* 3 linhas no PC */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feature-card img {
  border-radius: 8px;
  margin-bottom: 16px;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Estilização do Conteúdo do Post */
.entry-content p {
  margin-bottom: 1.8rem;
  line-height: 1.8;
}
.entry-content h2, .entry-content h3 { margin: 2rem 0 1rem; font-weight: 800; color: var(--text); }
.entry-content ul, .entry-content ol { margin-bottom: 1.5rem; padding-left: 20px; }
.entry-content li { margin-bottom: 0.5rem; }
.entry-content blockquote { 
    border-left: 4px solid var(--cyan); 
    padding: 20px; 
    margin: 2rem 0; 
    background: var(--surface); 
    font-style: italic; 
}

/* ─── 5.1 FILTRO DE CATEGORIAS ───────────────────────────── */
.category-filter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cat-pill:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 167, 157, 0.05);
  transform: translateY(-2px);
}

.cat-pill.active {
  background: var(--cyan);
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 4px 12px rgba(0, 167, 157, 0.2);
}

/* ─── 5.5. NAV DROPDOWN E MENU MOBILE ──────────────────────── */
.nav-dropdown { position: relative; }

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}

.nav-dropdown-btn:hover { color: var(--cyan); background: rgba(0,167,157,0.06); }
.nav-dropdown-btn svg { width: 14px; height: 14px; transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-btn svg,
.nav-dropdown.open .nav-dropdown-btn svg { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  min-width: 180px;
  padding: 6px;
  display: none;
  z-index: 200;
}

.nav-dropdown-menu::before {
  content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; background: transparent;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.nav-dropdown-menu a:hover { color: var(--cyan); background: rgba(0,167,157,0.06); }

/* Ícone Hambúrguer */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s;
}

/* Menu Mobile Fechado por Padrão */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.mobile-nav a:hover { color: var(--cyan); background: rgba(0,167,157,0.06); }

/* ─── 6. FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-brand img { height: 36px; margin-bottom: 16px; }

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 14px; color: rgba(255,255,255,0.55); }
.footer-col ul li a:hover { color: var(--cyan); }

/* ─── 7. WHATSAPP FLUTUANTE ──────────────────────────────── */
.floating-whatsapp {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 32px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── 8. ANIMAÇÕES (REVEAL) ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 9. RESPONSIVIDADE ──────────────────────────────────── */
@media (max-width: 900px) {
  /* 3 colunas rigorosamente iguais no Tablet */
  .features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } 
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  
  /* Oculta apenas o menu desktop e mostra o ícone do mobile */
  .header-inner nav { display: none; } 
  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  .section { padding: 60px 0; }
  
  /* Ajuste perfeito para o Mobile: 2 colunas iguais e respiro pro texto */
  .features-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 16px; 
  }
  .feature-card { 
    padding: 16px; /* Reduz o espaçamento interno para o texto não ficar espremido */
  }
  
  .feature-title { font-size: 15px; } 
  .feature-text { -webkit-line-clamp: 2; } /* 2 linhas de limite no mobile */
  
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}