/* ===== Category Page Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Serif Bengali', serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* Header */
.category-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.3s;
}

.back-btn:hover {
  color: #764ba2;
}

.logo img {
  height: 50px;
  width: auto;
}

.header-placeholder {
  width: 150px; /* Same width as back button for centering */
}

/* Category Banner */
.category-banner {
  position: relative;
  height: 300px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/images/cat_banner.jpg') center/cover;
  opacity: 0.2;
}

.banner-content {
  position: relative;
  text-align: center;
  color: #fff;
  z-index: 1;
}

.category-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.category-description {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.95;
}

/* Filter Bar */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 0;
}

.filter-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-count {
  font-weight: 600;
  color: #666;
  font-size: 1rem;
}

.filter-select {
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-family: 'Noto Serif Bengali', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.3s;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
}

/* Posts Section */
.posts-section {
  padding: 40px 0;
  min-height: 500px;
}

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

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.post-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.post-content {
  padding: 20px;
}

.post-category-tag {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.post-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-excerpt {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
}

.post-views {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #999;
  font-size: 0.9rem;
}

.post-views i {
  color: #667eea;
}

/* Pagination */
.pagination-section {
  padding: 40px 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.page-btn {
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  background: #fff;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Noto Serif Bengali', serif;
  font-weight: 600;
  transition: all 0.3s;
}

.page-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.page-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
}

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


.category-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.category-link {
  display: block;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  transition: all 0.3s;
}

.category-link:hover {
  background: rgba(102, 126, 234, 0.8);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  color: #ddd;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .category-banner {
    height: 200px;
  }

  .category-title {
    font-size: 2rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .header-container {
    padding: 12px 16px;
  }

  .back-btn span {
    display: none;
  }

  .logo img {
    height: 40px;
  }

  .filter-container {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .category-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .post-content {
    padding: 16px;
  }

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

  .category-links {
    grid-template-columns: 1fr;
  }
}
