/* Modern Posts List Styles */
.cd-modern-posts-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  max-width: 1240px;
  margin: 2rem auto;
}

/* Grid Layout */
.cd-posts-grid {
  display: grid;
  gap: 2rem 0.5rem;
  margin-bottom: 3rem;
}

/* Responsive Grid Columns */
.cd-posts-columns-1 {
  grid-template-columns: 1fr;
}
.cd-posts-columns-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
.cd-posts-columns-3 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.cd-posts-columns-4 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Post Card */
.cd-post-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cd-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

/* Post Link */
.cd-post-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.cd-post-link:hover,
.cd-post-link:focus {
  text-decoration: none;
  color: inherit;
}

/* Post Image */
.cd-post-image {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cd-post-thumb {
  width: 100%;
  /* height: 100%; */
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cd-post-card:hover .cd-post-thumb {
  transform: scale(1.05);
}

.cd-post-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cd-post-card:hover .cd-post-overlay {
  opacity: 1;
}

/* No Image Placeholder */
.cd-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.cd-no-image-placeholder {
  width: 60px;
  height: 60px;
  color: rgba(0, 0, 0, 0.3);
}

.cd-no-image-placeholder svg {
  width: 100%;
  height: 100%;
}

/* Post Content */
.cd-post-content {
  padding: 1.5rem;
  height: calc(100% - 240px);
  display: flex;
  flex-direction: column;
}

/* Category */
.cd-post-meta-top {
  margin-bottom: 0.75rem;
}

.cd-post-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 20px;
  transition: transform 0.2s ease;
}

.cd-post-card:hover .cd-post-category {
  transform: translateY(-1px);
}

/* Post Title */
.cd-post-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 1rem 0;
  color: #1a202c;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cd-post-card:hover .cd-post-title {
  color: #667eea;
}

/* Post Excerpt */
.cd-post-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #4a5568;
  margin: 0 0 1rem 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post Meta */
.cd-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #718096;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.cd-post-author,
.cd-post-date {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cd-post-author svg,
.cd-post-date svg {
  opacity: 0.7;
}

/* Pagination */
.cd-pagination {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.cd-pagination .page-numbers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cd-pagination .page-numbers li {
  list-style: none;
}

.cd-pagination .page-numbers a,
.cd-pagination .page-numbers span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: white;
  color: #4a5568;
}

.cd-pagination .page-numbers a:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
}

.cd-pagination .page-numbers .current {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.cd-pagination .page-numbers .prev,
.cd-pagination .page-numbers .next {
  width: auto;
  padding: 0 1rem;
  position: unset;
}

/* No Posts Message */
.cd-no-posts {
  text-align: center;
  padding: 4rem 2rem;
  color: #718096;
}

.cd-no-posts svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cd-no-posts h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #4a5568;
  margin: 1rem 0 0.5rem 0;
}

.cd-no-posts p {
  font-size: 1rem;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cd-modern-posts-container {
    margin: 1rem 0;
  }

  .cd-posts-grid {
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .cd-posts-columns-2,
  .cd-posts-columns-3,
  .cd-posts-columns-4 {
    grid-template-columns: 1fr;
  }

  .cd-post-image {
    height: 200px;
  }

  .cd-post-content {
    padding: 1.25rem;
    height: calc(100% - 200px);
  }

  .cd-post-title {
    font-size: 1.1rem;
  }

  .cd-post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cd-no-posts {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .cd-posts-grid {
    gap: 1rem;
  }

  .cd-post-content {
    padding: 1rem;
  }

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

  .cd-pagination .page-numbers a,
  .cd-pagination .page-numbers span {
    width: 40px;
    height: 40px;
  }
}
