/* 元福首頁第二段（2026-11-19）：商品三頁籤同列等高、圖框 1:1；知識傳承 10 篇排滿 */

/* ===== 商品三頁籤（推薦／熱賣／最多人看）共用 ===== */
.container > .product-list .tabs-content > .row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.container > .product-list .tabs-content > .row::before,
.container > .product-list .tabs-content > .row::after {
  content: none;
  display: none;
}
.container > .product-list .tabs-content > .row > .col {
  float: none;
  width: auto;
  min-width: 0;
  display: flex;
}
.container > .product-list .tabs-content > .row > .col > a {
  display: flex;
  flex-direction: column;
  width: 100%;
}
/* 圖框一律正方形；直式、橫式商品圖完整放進框內不裁切、不變形 */
.container > .product-list .tabs-content > .row > .col > a > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain;
  background: #fff;
}
/* 品名固定兩行高，超過以省略號收尾 */
.container > .product-list .tabs-content > .row > .col > a > h2 {
  padding: 10px 8px 0;
  line-height: 1.5;
  height: 3em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  box-sizing: content-box;
}
/* 價格貼齊卡片底部，同列在同一條水平線 */
.container > .product-list .tabs-content > .row > .col > a > .price {
  margin-top: auto;
}

/* ===== 知識傳承（首頁 10 篇）===== */
.knowledge.index .row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.knowledge.index .row::before,
.knowledge.index .row::after,
.knowledge.index .row > div.mobile {
  content: none;
  display: none;
}
.knowledge.index .row > .col {
  float: none;
  width: auto;
  min-width: 0;
  display: flex;
}
.knowledge.index .row > .col > a {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.knowledge.index .row > .col > a > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4 !important;
  object-fit: cover;
  background: #fff;
}
.knowledge.index .row > .col > a > h2 {
  padding-bottom: 0;      /* 下內距會露出被截掉的第 4 行，改用外距 */
  margin-bottom: 5px;
  line-height: 1.5;
  height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  box-sizing: content-box;
}
/* 摘要沿用站上原本 6 行截斷（頁首共用樣式），這裡只讓「繼續閱讀」貼底 */
.knowledge.index .row > .col > a > p:last-child {
  margin-top: auto;
}

/* 平板與手機：兩欄（10 篇／10 件剛好 5 列） */
@media only screen and (max-width: 1199px) {
  .container > .product-list .tabs-content > .row,
  .knowledge.index .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
