/* ========================================
   CARDS ARTIGOS - OTIMIZADO E CORRIGIDO
   Verde padrão: #40c500
   Versão: 2.2 - FIX Desktop
   ======================================== */
.card {
  opacity: 1 !important;
  visibility: visible !important;
}
.artigos-dinamicos {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ar-titulo {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  padding-bottom: 15px;
}

.ar-titulo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: #40c500;
  border-radius: 2px;
}

/* Grid Otimizado */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 25px;
  margin-top: 30px;
}

.card-container[data-colunas="2"] {
  grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
}

.card-container[data-colunas="4"] {
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
}

/* Card Base - CORRIGIDO */
.card {
  background: #ffffff !important;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  /* CORREÇÃO: Removido opacity: 0 inicial */
  opacity: 1;
  /* Animação opcional - mais suave */
  animation: fadeInUp 0.5s ease-out backwards;
  will-change: transform;
  contain: layout style paint;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(64, 197, 0, 0.15);
  border-color: rgba(64, 197, 0, 0.3);
}

/* Link - Acessibilidade */
.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  outline-offset: 2px;
}

.card-link:focus-visible {
  outline: 3px solid #40c500;
  outline-offset: 3px;
}

/* Imagem - Otimizada */
.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #40c500 0%, #2d8f00 100%);
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

/* Reduz animação em dispositivos com prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card-image-wrapper img,
  .btn-card {
    animation: none !important;
    transition: none !important;
  }
  
  .card {
    opacity: 1 !important;
  }
}

.card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

/* Conteúdo */
.card-content {
  padding: 20px;
  flex-grow: 1;
  background: #ffffff !important;
}

.card-content h3 {
  font-size: clamp(17px, 4vw, 19px);
  font-weight: 700;
  margin: 0 0 12px;
  color: #1a1a1a !important;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.card:hover .card-content h3 {
  color: #40c500 !important;
}

.card-content p {
  font-size: 14px;
  color: #666 !important;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botões - Acessíveis e Otimizados */
.card-actions {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  background: #ffffff !important;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.btn-card {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-family: inherit;
  outline-offset: 2px;
}

.btn-card:focus-visible {
  outline: 3px solid #40c500;
  outline-offset: 3px;
}

/* Botão Principal - Verde Padrão */
.btn-primary {
  background: #40c500 !important;
  color: white !important;
  box-shadow: 0 2px 6px rgba(64, 197, 0, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #36a800 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(64, 197, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Botão WhatsApp */
.btn-whatsapp {
  background: #25D366 !important;
  color: white !important;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
  background: #1fb854 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:active {
  transform: translateY(0);
}

.btn-card svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Responsividade Otimizada */
@media (max-width: 1024px) {
  .card-container {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .artigos-dinamicos {
    padding: 0 15px;
    margin: 30px auto;
  }

  .ar-titulo {
    margin-bottom: 25px;
  }

  .card-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card:hover {
    transform: translateY(-3px);
  }

  .card-image-wrapper {
    height: 180px;
  }

  .card-actions {
    flex-direction: column;
  }

  .btn-card {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .card-content {
    padding: 15px;
  }

  .card-actions {
    padding: 12px 15px;
  }
}

/* Print Styles - Remove animações */
@media print {
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    opacity: 1 !important;
  }
  
  .btn-card {
    display: none;
  }
}