.posts-container {
  max-width: 1200px;
  height: 100%;
  margin: 60px auto;
  padding: 20px;
}

.posts-header {
  text-align: center;
  margin-bottom: 50px;
}

.posts-header p {
  color: var(--black);
  font-size: 18px;
  margin: 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 60px;
}

.post-item {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.post-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transform: translateY(-5px);
}

.post-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 10px;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-item:hover .post-image img {
  transform: scale(1.05);
}

.post-content {
  padding: 20px;
}

.post-content h3 {
  font-size: 25px;
  color: var(--color-primary-dark);
  margin-bottom: 0;
  font-weight: 500;
}

.post-content p {
  color: var(--black);
  font-size: 16px;
  line-height: 1.8;
  margin: 0 0 10px 0;
}

.post-date {
  color: var(--color-primary-dark);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-date i {
  color: var(--color-primary-light);
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  display: grid;
  grid-column: -1 / 1;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.no-results {
  padding: 40px;
  color: #999;
  text-align: center;
  display: grid;
  grid-column: -1 / 1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  background-color: #fee;
  color: #c33;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-item,
  .post-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .post-item:nth-child(even) > * {
    direction: ltr;
  }

  .post-image {
    height: 250px;
  }

  .post-content {
    padding: 20px;
  }

  .post-content h2 {
    font-size: 24px;
  }

  .post-content p {
    font-size: 14px;
  }
}
