/**
 * Articles listing: post cards, category filter, sidebar hot widgets.
 */
:root {
  --articles-accent: #0d9488;
  --articles-accent-light: #2dd4bf;
  --articles-accent-blue: #3b82f6;
  --articles-border: #dfe8ec;
  --articles-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  --articles-shadow-hover: 0 14px 32px rgba(13, 148, 136, 0.12);
}

/* ========== Category filter ========== */
.articles-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.articles-category-filter a,
.articles-category-filter button {
  border: 1px solid var(--articles-border);
  background: #fff;
  color: #475569;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.articles-category-filter a span,
.articles-category-filter button span {
  opacity: 0.75;
  font-weight: 500;
  margin-left: 2px;
}

.articles-category-filter a:hover,
.articles-category-filter button:hover {
  border-color: rgba(13, 148, 136, 0.35);
  color: var(--articles-accent);
  background: #ecfdf5;
}

.articles-category-filter a.active,
.articles-category-filter button.active {
  background: linear-gradient(135deg, var(--articles-accent-light), var(--articles-accent));
  border-color: var(--articles-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

/* ========== Post list cards ========== */
#articles-list.cat_list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#articles-list .articles-post-card.list-grid-padding {
  padding: 0;
  margin: 0;
}

#articles-list .articles-post-card .list-item {
  flex-direction: row;
  align-items: stretch;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid var(--articles-border) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: var(--articles-shadow) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#articles-list .articles-post-card .list-item:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 148, 136, 0.28) !important;
  box-shadow: var(--articles-shadow-hover) !important;
}

#articles-list .articles-post-card .media.media-3x2 {
  flex: 0 0 38%;
  max-width: 280px;
  min-height: 168px;
  margin: 0;
  border-radius: 0 !important;
}

#articles-list .articles-post-card .media.media-3x2::after {
  padding-top: 62% !important;
}

#articles-list .articles-post-card .media-content {
  background-size: cover !important;
  background-position: center !important;
  border-radius: 0 !important;
}

#articles-list .articles-post-card .list-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px 20px !important;
}

#articles-list .articles-post-card .list-body {
  flex: 1 1 auto;
}

#articles-list .articles-post-card .articles-post-title {
  display: block;
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

#articles-list .articles-post-card .articles-post-title:hover {
  color: var(--articles-accent);
}

#articles-list .articles-post-card .articles-post-desc {
  margin: 0 0 12px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
}

#articles-list .articles-post-card .list-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(223, 232, 236, 0.9);
}

#articles-list .articles-post-card .articles-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

#articles-list .articles-post-card .articles-post-cat {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.08);
  color: var(--articles-accent);
  font-weight: 600;
  line-height: 1.3;
}

#articles-list .articles-post-card .articles-post-date {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}

/* ========== Sidebar widget shell ========== */
.sidebar .widget.hot_post_img,
.sidebar .widget.cx_tag_cloud {
  overflow: hidden;
  padding: 0 !important;
}

.sidebar .widget.hot_post_img .widgettitle,
.sidebar .widget.cx_tag_cloud .widgettitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--articles-border);
  background: linear-gradient(
    90deg,
    rgba(45, 212, 191, 0.1) 0%,
    rgba(59, 130, 246, 0.06) 100%
  );
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.sidebar .widget.hot_post_img .widgettitle i,
.sidebar .widget.cx_tag_cloud .widgettitle i {
  color: var(--articles-accent);
}

.sidebar .widget.hot_post_img .card-body,
.sidebar .widget.cx_tag_cloud .card-body {
  padding: 12px 14px 14px !important;
}

/* ========== Hot posts ========== */
#articles-hot-posts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#articles-hot-posts .articles-hot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(223, 232, 236, 0.95);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#articles-hot-posts .articles-hot-item:hover {
  border-color: rgba(13, 148, 136, 0.25);
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.08);
  transform: translateY(-1px);
}

#articles-hot-posts .articles-hot-rank {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

#articles-hot-posts .articles-hot-item:nth-child(1) .articles-hot-rank {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #fff;
}

#articles-hot-posts .articles-hot-item:nth-child(2) .articles-hot-rank {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
}

#articles-hot-posts .articles-hot-item:nth-child(3) .articles-hot-rank {
  background: linear-gradient(135deg, #fdba74, #ea580c);
  color: #fff;
}

#articles-hot-posts .articles-hot-thumb {
  flex: 0 0 76px;
  width: 76px;
  height: 56px;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

#articles-hot-posts .articles-hot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#articles-hot-posts .articles-hot-body {
  flex: 1;
  min-width: 0;
}

#articles-hot-posts .articles-hot-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  color: #1e293b;
  text-decoration: none;
}

#articles-hot-posts .articles-hot-title:hover {
  color: var(--articles-accent);
}

#articles-hot-posts .articles-hot-date {
  display: block;
  margin-top: 4px;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: #94a3b8;
}

#articles-hot-posts .articles-hot-empty {
  padding: 8px 0;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* ========== Hot tags ========== */
#articles-hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#articles-hot-tags a {
  display: inline-flex;
  align-items: center;
  margin: 0 !important;
  padding: 5px 12px;
  border: 1px solid var(--articles-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  color: #475569 !important;
  text-decoration: none !important;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

#articles-hot-tags a:hover {
  border-color: rgba(13, 148, 136, 0.35);
  background: #ecfdf5;
  color: var(--articles-accent) !important;
}

@media (max-width: 767.98px) {
  #articles-list .articles-post-card .media.media-3x2 {
    flex: 0 0 34%;
    max-width: 140px;
    min-height: 96px;
  }

  #articles-list .articles-post-card .list-content {
    padding: 12px 14px !important;
  }

  #articles-list .articles-post-card .articles-post-title {
    font-size: 0.9375rem;
  }

  #articles-list .articles-post-card .articles-post-desc {
    display: none;
  }
}
