/* =====================================================
   COMPONENTS.CSS — Komponentlar: card, badge, btn, input,
                    pagination, breadcrumb, empty state
   ===================================================== */

/* =====================================================
   TUGMALAR
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-download {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  justify-content: center;
}
.btn-download:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-full { width: 100%; justify-content: center; }

/* =====================================================
   BADGE (kategoriya, teg, tanlangan)
   ===================================================== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}
.badge:hover { opacity: 0.82; }

.badge-category {
  background: var(--color-accent);
  color: #fff;
}

.badge-tag {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.badge-tag:hover { background: var(--color-primary); color: #fff; }

.badge-featured {
  background: #c0392b;
  color: #fff;
}

/* =====================================================
   MAQOLA KARTASI
   ===================================================== */
.article-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-cover-link { display: block; overflow: hidden; aspect-ratio: 16/9; }

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.card-cover-link:hover .card-cover { transform: scale(1.04); }

.card-cover--fallback { object-fit: contain; background: var(--color-bg-alt); }

.card-body {
  padding: 1rem 1.1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-meta-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-year {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.35;
  color: var(--color-primary);
}
.card-title a:hover { color: var(--color-accent); }

.card-author {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.card-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border-light);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}
.card-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* =====================================================
   ARTICLE GRID
   ===================================================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.col-span-all { grid-column: 1 / -1; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  background: #fff;
}
.page-link:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.page-link--current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 700;
  cursor: default;
}

/* =====================================================
   BREADCRUMB
   ===================================================== */
.breadcrumb { margin-bottom: 1.25rem; }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.83rem;
  color: var(--color-text-muted);
}

.breadcrumb-list li { display: flex; align-items: center; }

.breadcrumb-list li:not(:last-child)::after {
  content: '›';
  margin: 0 0.45rem;
  color: var(--color-border);
}

.breadcrumb-list a { color: var(--color-text-muted); }
.breadcrumb-list a:hover { color: var(--color-accent); }
.breadcrumb-list li[aria-current="page"] { color: var(--color-primary); font-weight: 500; }

/* =====================================================
   FILTER INPUT VA SELECT
   ===================================================== */
.filter-input,
.filter-select {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
  -webkit-appearance: none;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.12);
  outline: none;
}

.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
}
.empty-state svg { opacity: 0.35; }
.empty-state p { font-size: 1rem; }

.empty-msg {
  color: var(--color-text-muted);
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.95rem;
}

.text-muted { color: var(--color-text-muted); }

/* =====================================================
   RESULT COUNT VA SEARCH INFO
   ===================================================== */
.result-count,
.search-info {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}
.search-info strong { color: var(--color-text); }

/* =====================================================
   AUTHOR CARD
   ===================================================== */
.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.18s, transform 0.18s;
  text-decoration: none;
  color: inherit;
}
.author-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
}

.author-card-avatar img,
.author-card-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-card-placeholder {
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.author-card-name {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  color: var(--color-primary);
  margin-bottom: 0.15rem;
}

.author-card-count {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* =====================================================
   MUALLIF PROFIL SAHIFASI
   ===================================================== */
.author-profile {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.author-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.author-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.author-bio { font-size: 0.92rem; color: var(--color-text-muted); line-height: 1.6; }

/* =====================================================
   TAG CLOUD
   ===================================================== */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 0;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.9rem;
  color: var(--color-primary);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  text-decoration: none;
}
.tag-cloud-item:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  background: var(--color-bg-alt);
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
}
.tag-cloud-item:hover .tag-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* =====================================================
   STATISTIKA JADVAL
   ===================================================== */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.stat-card-icon { color: var(--color-accent); }

.stat-card-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-card-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.stats-section { margin-bottom: 2.5rem; }

.stats-table-wrap { overflow-x: auto; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.stats-table th, .stats-table td {
  padding: 0.75rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.88rem;
}

.stats-table th {
  background: var(--color-bg-alt);
  font-weight: 700;
  color: var(--color-primary);
}

.stats-table tr:last-child td { border-bottom: none; }
.stats-table td a { color: var(--color-primary); }
.stats-table td a:hover { color: var(--color-accent); }

.top-list {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  counter-reset: top-list;
}

.top-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  counter-increment: top-list;
}
.top-list-item:last-child { border-bottom: none; }

.top-list-item::before {
  content: counter(top-list);
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-list-link {
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-primary);
}
.top-list-link:hover { color: var(--color-accent); }

.top-list-stat {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-weight: 500;
}

/* =====================================================
   BOGLANISH SAHIFASI — yangi kartochka uslubi
   ===================================================== */
.contact-wrap {
  max-width: 700px;
  margin: 0 auto;
}

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.4rem 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-card-icon--phone {
  background: #e8f0fd;
  color: #1d4ed8;
}

.contact-card-icon--email {
  background: #ecfdf5;
  color: #059669;
}

.contact-card-icon--address {
  background: #fef3e2;
  color: #d97706;
}

.contact-card-body { flex: 1; }

.contact-card-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.contact-card-value {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s;
}

.contact-card-value:hover { color: var(--color-accent); }

.contact-social-wrap {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}

.contact-social-heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Eski stiller (boshqa sahifalar uchun saqlanadi) */
.contact-layout { max-width: 600px; }
.contact-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--color-border-light);
}
.contact-icon {
  width: 44px; height: 44px; background: var(--color-bg-alt);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: var(--color-primary); flex-shrink: 0;
}
.contact-label { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.2rem; font-weight: 500; }
.contact-value { font-size: 1rem; color: var(--color-primary); font-weight: 500; }
.contact-social { margin-top: 1.5rem; }
.contact-social-title { font-size: 1rem; margin-bottom: 0.75rem; }

/* =====================================================
   PROSE KONTENT (about sahifasi)
   ===================================================== */
.prose-content {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
}
.prose-content p + p { margin-top: 1rem; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .article-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .authors-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }

  .author-profile {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .article-grid { grid-template-columns: 1fr; }
  .stats-cards { grid-template-columns: 1fr 1fr; }
}
