/**
 * Estilos para Sistema de Link Building
 * Consórcios Fácil - 2025
 */

/* Posts Relacionados */
.related-posts-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 3rem;
}

.related-posts-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .related-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.related-post-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.related-post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #003E8C, #00B07C);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.related-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.15);
}

.related-post-card:hover::before {
  transform: scaleX(1);
}

.related-post-category {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-venda {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.category-problemas {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.category-contemplacao {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.category-transferencia {
  background-color: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
}

.related-post-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0.75rem 0 0.5rem 0;
  line-height: 1.4;
}

.related-post-description {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.related-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.related-post-tags {
  display: flex;
  gap: 0.5rem;
}

.related-post-tag {
  background-color: #f3f4f6;
  color: #374151;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.related-post-link {
  display: inline-flex;
  align-items: center;
  color: #003E8C;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.related-post-link:hover {
  color: #00B07C;
}

.related-post-link svg {
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.related-post-link:hover svg {
  transform: translateX(2px);
}

/* Navegação entre Posts */
.post-navigation {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.post-nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #374151;
  transition: all 0.3s ease;
  padding: 1rem;
  border-radius: 8px;
  max-width: 45%;
}

.post-nav-link:hover {
  background-color: #f9fafb;
  color: #003E8C;
}

.post-nav-link.prev {
  text-align: left;
}

.post-nav-link.next {
  text-align: right;
  margin-left: auto;
}

.post-nav-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.post-nav-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
}

.post-nav-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.2s ease;
}

.post-nav-link.prev:hover .post-nav-icon {
  transform: translateX(-2px);
}

.post-nav-link.next:hover .post-nav-icon {
  transform: translateX(2px);
}

/* CTA Relacionado */
.related-cta {
  background: linear-gradient(135deg, rgba(0, 62, 140, 0.05) 0%, rgba(0, 176, 124, 0.05) 100%);
  border: 1px solid rgba(0, 62, 140, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.related-cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 768px) {
  .related-cta-content {
    flex-direction: column;
    text-align: center;
  }
}

.related-cta-text h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.related-cta-text p {
  color: #6b7280;
  margin: 0;
}

.related-cta-button {
  background: #003E8C;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.related-cta-button:hover {
  background: rgba(0, 62, 140, 0.9);
}

/* Links Contextuais */
.contextual-link {
  position: relative;
  color: #003E8C !important;
  text-decoration: underline;
  text-decoration-color: rgba(0, 62, 140, 0.3);
  text-underline-offset: 2px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.contextual-link:hover {
  color: #00B07C !important;
  text-decoration-color: #00B07C;
  text-decoration-thickness: 2px;
}

.contextual-link:focus {
  outline: 2px solid #003E8C;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Indicador visual sutil para links contextuais */
.contextual-link::after {
  content: '';
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23003E8C'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.6;
  vertical-align: middle;
}

.contextual-link:hover::after {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300B07C'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14'%3E%3C/path%3E%3C/svg%3E");
}

/* Responsividade */
@media (max-width: 640px) {
  .related-posts-section {
    padding: 1.5rem;
    margin-top: 2rem;
  }
  
  .related-post-card {
    padding: 1.25rem;
  }
  
  .post-navigation {
    padding: 1rem;
  }
  
  .post-nav-link {
    padding: 0.75rem;
    max-width: 100%;
    margin-bottom: 1rem;
  }
  
  .post-nav-link.next {
    margin-left: 0;
  }
}

/* Animações */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.related-posts-section,
.post-navigation,
.related-cta {
  animation: fadeInUp 0.6s ease-out;
}

/* Estados de carregamento */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .related-post-card,
  .post-nav-link,
  .contextual-link,
  .related-cta-button {
    transition: none;
  }
  
  .related-posts-section,
  .post-navigation,
  .related-cta {
    animation: none;
  }
}

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
  .related-posts-section {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  }
  
  .related-post-card {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .related-post-title {
    color: #f9fafb;
  }
  
  .related-post-description {
    color: #d1d5db;
  }
  
  .post-navigation {
    background: #374151;
    border-color: #4b5563;
  }
  
  .post-nav-link {
    color: #f9fafb;
  }
  
  .post-nav-link:hover {
    background-color: #4b5563;
  }
}
