/* Blog Styles - Fonia */

/* Grid de artículos del blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

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

/* Tarjetas de artículos */
.blog-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(81, 217, 214, 0.3), 0 10px 10px -5px rgba(81, 217, 214, 0.1);
  border-color: rgba(81, 217, 214, 0.4);
}

.blog-card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-category {
  display: inline-block;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(81, 217, 214, 0.1) 0%, rgba(65, 201, 198, 0.15) 100%);
  color: #41C9C6;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.blog-card:hover .blog-card-category {
  background: linear-gradient(135deg, #51D9D6 0%, #41C9C6 100%);
  color: white;
}

.blog-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: #000000 !important;
  transition: color 0.3s ease;
}

.blog-card-title a {
  color: #000000 !important;
}

.blog-card:hover .blog-card-title,
.blog-card:hover .blog-card-title a {
  color: #000000 !important;
}

.blog-card-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: #2d3748;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.875rem;
  color: #a0aec0;
}

.blog-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-card-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-card-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Artículo completo */
.article-header {
  max-width: 850px;
  margin: 0 auto 3rem;
  text-align: center;
}

.article-category {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, #51D9D6 0%, #41C9C6 100%);
  color: white;
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #1a202c;
}

@media (max-width: 768px) {
  .article-title {
    font-size: 2rem;
  }
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 1rem;
  color: #718096;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.article-featured-image {
  width: 100%;
  max-width: 1200px;
  height: auto;
  border-radius: 24px;
  margin: 3rem auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.article-content {
  max-width: 850px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #2d3748;
}

.article-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: #1a202c;
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: #1a202c;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.75rem;
}

.article-content blockquote {
  border-left: 4px solid #51D9D6;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #4a5568;
  background: rgba(81, 217, 214, 0.05);
  padding: 1.5rem;
  border-radius: 0 12px 12px 0;
}

.article-content code {
  background: #f7fafc;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: #e53e3e;
  font-family: 'Courier New', monospace;
}

.article-content pre {
  background: #2d3748;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 2rem 0;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Filtros de categorías */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  justify-content: center;
}

.category-filter-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 2px solid #e2e8f0;
  background: white;
  color: #4a5568;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-filter-btn:hover,
.category-filter-btn.active {
  border-color: #51D9D6;
  background: linear-gradient(135deg, #51D9D6 0%, #41C9C6 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(81, 217, 214, 0.3);
}

/* Búsqueda */
.blog-search {
  max-width: 600px;
  margin: 0 auto 3rem;
  position: relative;
}

.blog-search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 1.5rem;
  border-radius: 9999px;
  border: 2px solid #e2e8f0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.blog-search-input:focus {
  outline: none;
  border-color: #51D9D6;
  box-shadow: 0 0 0 3px rgba(81, 217, 214, 0.1);
}

.blog-search-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
}

/* Paginación */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 4rem;
}

.blog-pagination-btn {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #4a5568;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-pagination-btn:hover {
  background: #51D9D6;
  color: white;
  border-color: #51D9D6;
  transform: translateY(-2px);
}

.blog-pagination-btn.active {
  background: linear-gradient(135deg, #51D9D6 0%, #41C9C6 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 6px -1px rgba(81, 217, 214, 0.3);
}

.blog-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.blog-pagination-btn:disabled:hover {
  background: white;
  color: #4a5568;
  transform: none;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Tags relacionados */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

.article-tag {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: #f7fafc;
  color: #4a5568;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.article-tag:hover {
  background: #51D9D6;
  color: white;
}

/* Artículos relacionados */
.related-articles {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 2px solid #e2e8f0;
}

.related-articles-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #1a202c;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .blog-card {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .blog-card-title,
  .blog-card-title a {
    color: #000000 !important;
  }

  .blog-card-excerpt {
    color: #cbd5e0;
  }

  .blog-card-meta {
    border-color: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
  }

  .article-title {
    color: #f7fafc;
  }

  .article-content {
    color: #e2e8f0;
  }

  .article-content h2,
  .article-content h3 {
    color: #f7fafc;
  }

  .category-filter-btn {
    background: #2d3748;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .blog-search-input {
    background: #2d3748;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .blog-pagination-btn {
    background: #2d3748;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .article-tag {
    background: #2d3748;
    color: #e2e8f0;
  }
}
