/* ============================================
   DaneshTan - Archive Page Styles
   ============================================ */

/* ---------- Page Header ---------- */
.page-header {
  padding: 80px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-subtle) 100%);
}

.page-title {
  font-size: var(--font-size-4xl);
  font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Filters Section ---------- */
.filters-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: var(--navbar-height);
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.search-inline {
  position: relative;
  min-width: 280px;
}

.search-inline input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: all var(--transition);
}

.search-inline input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-inline svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.page-btn:hover:not(.disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- No Results ---------- */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.no-results svg {
  margin: 0 auto 20px;
  opacity: 0.4;
}

.no-results h3 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.no-results p {
  font-size: var(--font-size-base);
}

.loading-message {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px;
  grid-column: 1/-1;
}


/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .page-header {
        padding: 48px 0 32px;
    }
    
    .page-title {
        font-size: var(--font-size-3xl);
    }
    
    .page-subtitle {
        font-size: var(--font-size-base);
        padding: 0 16px;
    }
    
    .filters-section {
        top: 64px;
        padding: 16px 0;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .category-filters::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .search-inline {
        min-width: 100%;
    }
    
    .search-inline input {
        font-size: 16px; /* جلوگیری از زوم خودکار در iOS */
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .article-card {
        margin-bottom: 0;
    }
    
    .article-image {
        height: 200px;
    }
    
    .pagination {
        gap: 6px;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: var(--font-size-2xl);
    }
    
    .article-image {
        height: 180px;
    }
    
    .article-body {
        padding: 16px;
    }
    
    .article-body h3 {
        font-size: 16px;
    }
    
    .article-body p {
        font-size: 13px;
    }
}