/* Articles list — search, sort, 3-column grid */

.articles-hero {
  padding-bottom: 1rem;
}

.articles-controls {
  margin-bottom: 1.35rem;
}

/* ── Unified filter panel ── */
.articles-panel {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), rgba(139, 92, 246, 0.02));
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.articles-panel__row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3rem;
}

.articles-panel__divider {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  background: var(--border);
  margin: 0.15rem 0;
}

.articles-search {
  flex: 1 1 auto;
  min-width: 0;
}

.articles-search__field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  height: 3rem;
  padding: 0 0.55rem 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.articles-search__field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.articles-search__icon {
  flex: 0 0 auto;
  color: var(--accent-2);
  display: inline-flex;
}

.articles-search__icon .ico {
  width: 1.05rem;
  height: 1.05rem;
}

.articles-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 0;
}

.articles-search input[type="search"]:focus {
  outline: none;
}

.articles-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.articles-search__clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.articles-search__clear:hover {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-2);
}

.articles-search__clear .ico {
  width: 0.9rem;
  height: 0.9rem;
}

.articles-search__go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.articles-search__go .ico {
  width: 1rem;
  height: 1rem;
}

.articles-search__go:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}

.articles-sort {
  flex: 0 0 auto;
}

.articles-sort__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 3rem;
  margin: 0;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.articles-sort__label:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.articles-sort__ico {
  display: inline-flex;
  color: var(--accent-2);
}

.articles-sort__ico .ico {
  width: 1rem;
  height: 1rem;
}

.articles-sort__text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted-2);
  white-space: nowrap;
}

.articles-sort select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  min-width: 7.5rem;
  color-scheme: dark;
}

.articles-sort select option {
  color: #0f172a;
  background: #f8fafc;
}

.articles-sort select option:checked,
.articles-sort select option:hover {
  color: #fff;
  background: #6366f1;
}

.articles-sort select:focus {
  outline: none;
}

.articles-stats {
  font-size: 0.84rem;
  color: var(--muted-2);
  margin: 0.75rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.articles-stats__sep {
  opacity: 0.55;
}

.articles-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.articles-cats .module-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.articles-cats .module-chip.is-active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.18);
}

.module-chip__count {
  font-size: 0.82em;
  color: var(--muted-2);
  font-weight: 600;
}

.articles-section {
  padding-top: 0;
}

.articles-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card__cover--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(45, 212, 191, 0.06));
  color: var(--accent-2);
}

.post-card__cover--empty .ico {
  width: 2.2rem;
  height: 2.2rem;
  opacity: 0.55;
}

@media (max-width: 1020px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .articles-panel__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .articles-panel__divider {
    display: none;
  }

  .articles-sort__label {
    width: 100%;
    justify-content: space-between;
  }

  .articles-sort select {
    flex: 1;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

.post-card__excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 2.5rem;
}

.articles-page-nums {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.articles-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.articles-page-btn:hover:not(.is-disabled):not(.is-active) {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
}

.articles-page-btn.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.08));
  color: var(--accent-2);
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.2);
}

.articles-page-btn--nav {
  min-width: 4.5rem;
  border-radius: var(--radius);
}

.articles-page-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.articles-page-ellipsis {
  color: var(--muted-2);
  padding: 0 0.15rem;
  user-select: none;
}

.articles-empty {
  min-height: 40vh;
}
