:root {
  --cf-color-dark: #2d3748;
  --cf-color-text: #4a5568;
  --cf-color-muted: #718096;
  --cf-color-border: #e2e8f0;
  --cf-color-bg: #fff;
  --cf-color-bg-hover: #f7fafc;
  --cf-color-icon: #64748b;
  --cf-radius-pill: 100px;
  --cf-radius-btn: 8px;
  --cf-font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.category-filters {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cf-color-bg);
  margin: 0 auto 1rem;
  padding: 0.5rem 1rem;
  max-width: 1100px;
}

@media (max-width: 1199px) {
  .category-filters {
    max-width: 720px;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .category-filters {
    max-width: 1000px;
  }
}

@media (min-width: 1400px) {
  .category-filters {
    max-width: 1150px;
  }
}

.category-pills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.category-pill {
  padding: 0.5rem 1rem;
  border: 1px solid var(--cf-color-border);
  border-radius: var(--cf-radius-pill);
  background: var(--cf-color-bg);
  color: var(--cf-color-text);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--cf-font-family);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-pill:hover {
  border-color: #a0aec0;
  background: var(--cf-color-bg-hover);
  color: var(--cf-color-dark);
}

.category-pill.active {
  background: var(--cf-color-dark);
  border-color: var(--cf-color-dark);
  color: var(--cf-color-bg);
}

.category-pill.active:hover {
  background: #1a202c;
  border-color: #1a202c;
}

.pill-count {
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.8em;
}

.category-pill.active .pill-count {
  opacity: 0.85;
}

.nav-pills-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

a.category-pill.nav-pill {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

a.category-pill.nav-pill i {
  font-size: 0.75rem;
  color: var(--cf-color-icon);
}

a.category-pill.nav-pill:hover i {
  color: var(--cf-color-dark);
}

.posts-list.loading {
  opacity: 0.6;
  pointer-events: none;
}

.category-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.category-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--cf-color-bg);
  border: 1px solid var(--cf-color-border);
  border-radius: var(--cf-radius-btn);
  color: var(--cf-color-text);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--cf-font-family);
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-pagination-btn:hover:not(:disabled) {
  border-color: #a0aec0;
  background: var(--cf-color-bg-hover);
  color: var(--cf-color-dark);
}

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

.category-pagination-info {
  font-size: 0.875rem;
  color: var(--cf-color-muted);
  font-family: var(--cf-font-family);
}


.no-posts-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--cf-color-muted);
}

.no-posts-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-posts-message p {
  font-size: 1.125rem;
  margin: 0;
}

.scrollable-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scrollable-row::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .category-filters {
    margin: 0 0 1rem;
    padding: 0.5rem 0;
    border-radius: 0;
  }

  .category-pills-container,
  .nav-pills-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.375rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .category-pills-container::-webkit-scrollbar,
  .nav-pills-row::-webkit-scrollbar {
    display: none;
  }

  .category-pills-container {
    padding: 0.375rem 0;
  }

  .nav-pills-row {
    margin-bottom: 0.375rem;
  }

  .category-pill {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    flex-shrink: 0;
  }

  .category-pagination {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .category-pagination-btn {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }

  a.category-pill.nav-pill {
    gap: 0.3rem;
    flex-shrink: 0;
  }

  a.category-pill.nav-pill i {
    font-size: 0.7rem;
  }

  .pill-count {
    font-size: 0.75em;
  }
}
