/* Zona Campo Posts - Estilos CSS */

.zonacampo-posts-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

.zonacampo-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

@media (min-width: 1200px) {
  .zonacampo-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .zonacampo-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.zonacampo-post-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e1e5e9;
}

.zonacampo-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.zonacampo-post-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}

.zonacampo-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.5s ease;
}

.zonacampo-post-image img.lazy {
  opacity: 0;
}

.zonacampo-post-image img:not(.lazy) {
  opacity: 1;
}

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

.zonacampo-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.zonacampo-post-content {
  padding: 20px;
}

.zonacampo-post-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #2c3e50;
}

.zonacampo-post-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.zonacampo-post-title a:hover {
  color: #3498db;
}

.zonacampo-post-excerpt {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zonacampo-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #95a5a6;
}

.zonacampo-post-date {
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.zonacampo-no-posts {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-size: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

/* Estilos para el admin */
.zonacampo-admin-preview {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .zonacampo-posts-container {
    padding: 15px;
  }

  .zonacampo-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  .zonacampo-post-content {
    padding: 15px;
  }

  .zonacampo-post-title {
    font-size: 16px;
  }

  .zonacampo-post-image {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .zonacampo-posts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .zonacampo-post-image {
    height: 160px;
  }

  .zonacampo-post-content {
    padding: 12px;
  }

  .zonacampo-post-title {
    font-size: 15px;
  }
}

/* Loading state */
.zonacampo-loading {
  text-align: center;
  padding: 40px;
  color: #6c757d;
}

.zonacampo-loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  border-top-color: #3498db;
  animation: spin 1s ease-in-out infinite;
  margin-left: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error state */
.zonacampo-error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
  margin: 20px 0;
}

/* Category badges */
.zonacampo-category-badge {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 5px;
  margin-bottom: 5px;
}

/* Read more button */
.zonacampo-read-more {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
  margin-top: 10px;
}

.zonacampo-read-more:hover {
  background: #2980b9;
  color: white;
  text-decoration: none;
}
