/* Category Page Styles */

/* Category Header */
.category-header {
  /* background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); */
  background: radial-gradient(circle,rgba(233, 236, 239, 1) 0%, rgba(248, 249, 250, 1) 100%);
  padding: 3rem 0 2rem;
  text-align: center;
}

.category-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.category-title {
  font-size: 3rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 1rem;
  letter-spacing: -1px;
  position: relative;
}

.category-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: #212529;
  border-radius: 2px;
}

.category-description {
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Posts Section */
.posts-section {
  padding: 3rem 0;
  background-color: #f8f9fa;
}

.posts-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* View Toggle */
.view-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.view-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #e9ecef;
  background: #ffffff;
  color: #6c757d;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
  background: #212529;
  color: #ffffff;
  border-color: #212529;
}

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

.posts-grid.list-view {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* Post Card */
.post-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  /* cursor: pointer; */
  position: relative;
}

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

.post-image {
  position: relative;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.post-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #212529;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-content {
  padding: 1.5rem;
}

.post-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.8rem;
  margin-top: 0;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.post-title a {
    color: #1d1d1d; /* or your desired color */
    text-decoration: none;
    transition: color 0.2s;

}
.post-card:hover .post-title {
  color: #2d2d2d;
}

.post-excerpt {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #6c757d;
  flex-wrap: wrap;
}

.post-author {
  font-weight: 600;
}

.post-date,
.post-read-time {
  position: relative;
}

.post-date::before,
.post-read-time::before {
  content: '•';
  margin-right: 0.5rem;
  color: #adb5bd;
}

/* List View Styles */
.posts-grid.list-view .post-card {
  display: flex;
  height: 217px;
}

.posts-grid.list-view .post-image {
  width: 300px;
  flex-shrink: 0;
}

.posts-grid.list-view .post-image img {
  height: 100%;
  width: 100%;
}

.posts-grid.list-view .post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.posts-grid.list-view .post-title {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.posts-grid.list-view .post-excerpt {
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Load More Section */
.load-more-container {
  text-align: center;
  padding: 2rem 0;
}

.load-more-btn {
  background: linear-gradient(135deg, #212529, #495057);
  color: #ffffff;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(33, 37, 41, 0.2);
}

.load-more-btn:hover {
  background: linear-gradient(135deg, #495057, #212529);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 37, 41, 0.3);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.loading-spinner {
  color: #6c757d;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Category-specific colors */
.post-category.tech-section { background: #007bff; }
.post-category.politics-section { background: #dc3545; }
.post-category.entertainment-section { background: #ff6b6b; }
.post-category.finance-section { background: #28a745; }
.post-category.music-section { background: #fd7e14; }
.post-category.life-section { background: #6f42c1; }

/* Responsive Design */
@media (max-width: 992px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
  
  .category-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .category-header {
    padding: 2rem 0 1.5rem;
  }
  
  .category-header .container {
    padding: 0 1rem;
  }
  
  .posts-section .container {
    padding: 0 1rem;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .posts-grid.list-view .post-card {
    flex-direction: column;
    height: auto;
  }
  
  .posts-grid.list-view .post-image {
    width: 100%;
    height: 200px;
  }
  
  .category-title {
    font-size: 2rem;
  }
    .category-description {
    font-size: 1rem;
  }
}

@media (max-width: 580px) {
  .posts-section {
    padding: 2rem 0;
  }
  
  .post-meta {
    gap: 0.5rem;
  }
  
  .post-meta span {
    font-size: 0.8rem;
  }
    .load-more-btn {
    width: 100%;
    max-width: 300px;
  }
}