/*列表結果的共用外觀；成果案例、趨勢文章、搜尋頁共用，版面與檢視模式仍由各模組自理*/
.result-card {
  border-color: rgb(148 163 185 / 50%) !important;
  border-radius: 24px;
}

.result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.result-body {
  font-size: .9rem;
}

/*行高必須寫死，固定高度才會剛好等於行數，否則會露出下一行的上緣*/
.result-title,
.result-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
}

.result-title {
  height: 3em;
  font-size: 1.25rem;
  -webkit-line-clamp: 2;
}

.result-description {
  height: 4.5em;
  font-size: 1rem;
  -webkit-line-clamp: 3;
}

.result-tags {
  min-width: 0;
}

.result-tags span {
  color: #1F4F7F;
  margin-right: .5rem;
}

/*三種檢視模式的共用尺寸；各模組只需在外層加上 result-list result-list--<mode>*/
/*用 min-height：寫死 height 時內容放不下，flex 會把標題壓扁成半行*/
.result-list--row .result-card {
  min-height: 17rem;
}

.result-list--row .result-media {
  min-height: 0;
  border-right: 1px solid rgb(148 163 185 / 50%);
}

/*卡片高度交給文字決定，圖片只填滿不撐高*/
.result-list--row .result-media img {
  height: 0;
  min-height: 100%;
}

.result-list--grid .result-card {
  height: 50vh;
  min-height: 24rem;
}

/*資訊區不加底色，只以 backdrop-filter 模糊透出圖片*/
.result-list--grid .result-body {
  background-color: transparent;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.result-list--grid .result-tags {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/*檢視模式切換鈕*/
.result-modes {
  font-size: 1.85rem;
  z-index: 90;
}

.result-modes .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.5rem;
  line-height: 1;
}

.result-modes>.changeBox {
  flex: 0 0 70px;
  width: 70px;
  height: 50px;
  color: black;
  background: #fff;
  border: 1px solid rgb(61 68 79 / 20%);
  -webkit-appearance: none;
}

/*標籤徽章：清單模式排在文字前方，其餘模式掛在卡片左上角*/
.result-list--list .galleryType {
  position: static;
  flex: 0 0 auto;
  margin-right: 1rem;
}

.result-list--list.has-badges .result-item:not(.has-badge)::before {
  content: "";
  flex: 0 0 calc(3rem + 20px);
}

.result-list--row .galleryType,
.result-list--grid .galleryType {
  left: 30px;
}

/*英文站 body 文字色取自 --page-txt，深色模式沒覆寫到，卡片不能靠繼承*/
body.dark-mode .result-card {
  color: var(--page-txt);
}

/*格狀模式的資訊區透出底圖，文字固定用深色才看得清楚*/
body.dark-mode .result-list--grid .result-body {
  color: #212529;
}

@media (max-width: 575.98px) {
  .result-list--list .galleryType {
    position: absolute;
    top: 0;
    left: 12px;
  }

  .result-list--list.has-badges .result-item:not(.has-badge)::before {
    content: none;
  }

  .result-list--list .has-badge .result-title {
    margin-left: calc(3rem + 20px);
  }
}

/*標籤徽章本體。缺口用 clip-path 切出，不再用 :before/:after 掛兩個三角形*/
.galleryType {
  position: absolute;
  top: -15px;
  left: 15px;
  z-index: 1;
  display: inline-block;
  height: 4rem;
  padding: 10px;
  color: #fff;
  background: var(--sub-color);
  font-size: 1rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0% 100%);
}

.galleryType.green {
  background: #12B840;
}

.galleryType.red {
  background: #F74A4A;
}