/* ── Blog list page ─────────────────────────────────── */

.article-list-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.article-list-page main {
  flex: 1;
}

.blog-section {
  padding: 36px 0;
}

/* ── Part 1: Featured slider ───────────────────────── */
.featured-slider {
  position: relative;
  width: 100%;
}

.featured-slider-viewport {
  width: 100%;
  overflow: hidden;
}

.featured-slider-track {
  display: flex;
  gap: 16px;
  transition: transform 0.5s ease;
  will-change: transform;
}

.featured-slide {
  flex: 0 0 calc((100% - 32px) / 3);
  min-width: 0;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.featured-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  height: 44px;
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.featured-slider-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.featured-slider-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.featured-slider-prev {
  /* 侧边距 = (100vw - min(1200px,92vw))/2；保证按钮不超出屏幕 */
  left: max(-72px, calc(26px - 50vw + min(600px, 46vw)));
}

.featured-slider-next {
  right: max(-72px, calc(26px - 50vw + min(600px, 46vw)));
}

.featured-slide:hover {
  background: #f4faf8;
  border-color: #c6d8d2;
  box-shadow: none;
}

.featured-slider-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.featured-page-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  padding: 0;
  overflow: visible;
  background: #d4dcd6;
  cursor: pointer;
  transition: width 0.18s ease, background-color 0.18s ease;
}

.featured-page-dot.active {
  width: 34px;
  height: 6px;
  background: #c8d6d2;
  overflow: hidden;
}

.featured-page-dot-progress {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.08s linear;
}

.featured-page-dot:not(.active) .featured-page-dot-progress {
  width: 0 !important;
}

/* ── Part 2: list + sidebar ──────────────────────────── */
.blog-body {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: start;
}

.current-tag-label {
  margin-left: 0.35em;
  font-weight: 400;
  font-size: 1rem;
  color: var(--muted);
  display: inline-block;
  vertical-align: middle;
}

/* Article list (left) */
.article-list {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article-row {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
}

.article-row:last-child {
  border-bottom: none;
}

.article-row:hover {
  background: #f4faf8;
}

.article-row-thumb {
  flex-shrink: 0;
  width: 100px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #ecf6f4 0%, #fff3d7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-row-thumb span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.article-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.article-row-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}

.article-row-excerpt {
  font-size: 0.875rem;
  color: var(--muted);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-row-meta {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--primary-strong);
  font-weight: 600;
}

.article-list-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

/* ── Tags sidebar (right) ────────────────────────────── */
.tags-sidebar {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.tags-sidebar h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-strong);
  margin-bottom: 14px;
}

.tag-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 4px;
}

.tag-link:hover {
  background: #e8f5f3;
  color: var(--primary);
}

.tag-link.active {
  background: var(--primary);
  color: #fff;
}

.tag-count {
  font-size: 0.78rem;
  opacity: 0.7;
}

.tag-all {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  padding-bottom: 10px;
}

/* ── Pagination ──────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.pagination a,
.pagination span {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.pagination a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .pg-current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .pg-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .featured-slide {
    flex-basis: calc((100% - 16px) / 2);
  }

  .blog-body {
    grid-template-columns: 1fr;
  }

  .tags-sidebar {
    order: -1;
  }
}

@media (max-width: 640px) {
  .featured-slider-btn {
    height: 36px;
    width: 36px;
  }

  .featured-slide {
    flex-basis: 100%;
  }
}
