/* ===== OJS 3.4 站点首页（indexSite.tpl）三列网格 + 修复 has_thumb 叠层 ===== */

/* 三列网格 */
.page_index_site .journals ul{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  box-sizing: border-box;
  text-align: center;
}

/* 卡片容器（统一用 flex 竖排，避免 has_thumb 浮动叠层） */
.page_index_site .journals ul > li{
  display: flex !important;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  width: 98%;
  height: auto;
}

/* 彻底取消主题对 has_thumb 的 float/宽度干扰 */
.page_index_site .journals ul > li.has_thumb .thumb,
.page_index_site .journals ul > li.has_thumb .body{
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  clear: both !important;
}

/* 容器保证有高度 + 裁切 */
.page_index_site .journals ul > li .thumb{
  position: relative;
  aspect-ratio: 210/297;
  overflow: hidden;          /* 建立BFC并裁切 */
}

/* 链接不必绝对定位，保持普通流或静态 */
.page_index_site .journals ul > li .thumb a{
  position: static;          /* 或直接删掉原来的 absolute */
  display: block;
  height: 100%;
}

/* 关键：直接“点名”img，取消任何浮动并填满容器 */
.page_index_site .journals ul > li .thumb img{
  position: absolute; inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover; object-position: center;
  display: block;
  float: none !important;    /* 干掉主题里可能的 float */
  margin: 0 !important;
}


/* 标题块：100% 宽，内容居中 */
.page_index_site .journals ul > li .body{
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  box-sizing: border-box;
  overflow: visible;
}
.page_index_site .journals ul > li .body h3{
  margin: 0;
  line-height: 1.3;
}
.page_index_site .journals ul > li .body h3 a{
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;             /* 长英文自动换行，不拆单个字母 */
  text-decoration: none;
}

/* 响应式 */
@media (max-width: 1024px){
  .page_index_site .journals ul{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .page_index_site .journals ul{ grid-template-columns: 1fr; }
}
