/* Blog Styles */
.blog-header {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.blog-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary, #1a202c);
  margin-bottom: 0.5rem;
}

.blog-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary, #718096);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Controles del blog */
.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 0 1rem;
}

.blog-search {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary, #718096);
  pointer-events: none;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-color, #e2e8f0);
  background: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary, #718096);
}

.filter-btn:hover {
  border-color: var(--primary-color, #3b82f6);
  color: var(--primary-color, #3b82f6);
}

.filter-btn.active {
  background: var(--primary-color, #3b82f6);
  border-color: var(--primary-color, #3b82f6);
  color: white;
}

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

.blog-post-card {
  background: white;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-content {
  padding: 1.5rem;
}

.post-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #718096);
}

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

.post-category {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--primary-color, #3b82f6);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-excerpt {
  color: var(--text-secondary, #718096);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.post-read-more:hover {
  color: var(--primary-dark, #2563eb);
}

.post-read-more svg {
  transition: transform 0.2s ease;
}

.post-read-more:hover svg {
  transform: translateX(2px);
}

/* Estado sin posts */
.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary, #718096);
}

.no-posts h3 {
  font-size: 1.5rem;
  color: var(--text-primary, #1a202c);
  margin-bottom: 1rem;
}

.no-posts a {
  color: var(--primary-color, #3b82f6);
  text-decoration: none;
  font-weight: 500;
}

.no-posts a:hover {
  text-decoration: underline;
}

/* Paginación */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
}

.blog-pagination.hidden {
  display: none;
}

.pagination-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color, #e2e8f0);
  background: white;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary, #1a202c);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary-color, #3b82f6);
  color: var(--primary-color, #3b82f6);
}

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

.pagination-info {
  font-weight: 500;
  color: var(--text-secondary, #718096);
}

/* Responsive */
@media (max-width: 768px) {
  .blog-title {
    font-size: 2rem;
  }
  
  .blog-controls {
    padding: 0;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .blog-filters {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .blog-pagination {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .blog-header {
    padding: 2rem 0 1.5rem;
  }
  
  .blog-title {
    font-size: 1.75rem;
  }
  
  .blog-subtitle {
    font-size: 1rem;
  }
  
  .post-content {
    padding: 1rem;
  }
  
  .search-input {
    font-size: 16px; /* Evita zoom en iOS */
  }
}

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

.blog-post-card {
  animation: fadeInUp 0.5s ease forwards;
}

.blog-post-card:nth-child(1) { animation-delay: 0.1s; }
.blog-post-card:nth-child(2) { animation-delay: 0.2s; }
.blog-post-card:nth-child(3) { animation-delay: 0.3s; }
.blog-post-card:nth-child(4) { animation-delay: 0.4s; }
.blog-post-card:nth-child(5) { animation-delay: 0.5s; }
.blog-post-card:nth-child(6) { animation-delay: 0.6s; }

/* Loading skeleton */
.post-skeleton {
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  animation: pulse 1.5s ease-in-out infinite;
}

.post-skeleton .skeleton-image {
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

.post-skeleton .skeleton-content {
  padding: 1.5rem;
}

.post-skeleton .skeleton-line {
  height: 1rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.post-skeleton .skeleton-line:last-child {
  width: 60%;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

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