/* Scoped news-card polish.
   只约束布局与图片比例（多列网格 + 16:9 cover），不强制卡片颜色，
   避免与模板主题（深/浅色）冲突。解决资讯区单列"超级大图"问题。
   覆盖全部引用本文件的模板（资讯动态标签由 news.RenderNewsListHTML 渲染）。 */

/* 多列网格：默认 auto-fill，杜绝单列大图 */
.news-list,
.news-grid,
.news-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.news-card,
.news-item,
.news-list > article,
.news-grid > article,
.news-cards > article {
  min-width: 0;
}

/* 卡片链接纵向布局：图上文下，撑满网格单元 */
.news-card > a,
.news-list > a,
.news-grid > a,
.news-cards > a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 图片容器固定 16:9 宽高比 + cover，防止原图撑爆成超级大图 */
.news-pic {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(128, 128, 128, .12);
}

.news-card img,
.news-item img,
.news-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 资讯文字区 */
.news-info {
  padding: 8px 10px 10px;
  flex: 1 1 auto;
}

.news-title {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  opacity: .7;
}

.news-category,
.news-time {
  white-space: nowrap;
}

.news-card a,
.news-item a {
  word-break: break-word;
}

/* 窄屏退化为 2 列 */
@media (max-width: 540px) {
  .news-list,
  .news-grid,
  .news-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
