/* ===============================
   TCUNC News Module
   專屬前綴：TCUNC_NewsModule
   原則：
   1. 保留 rPage 原生 module / mt-title / mbox 功能
   2. 不改 owl-stage / owl-item / pointer-events
   3. 不隱藏系統模組標題
================================ */

.TCUNC_NewsModule {
  height: 100%;
  margin: 0 auto;
  padding: 34px 34px 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(26, 54, 50, 0.12);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(30, 48, 44, 0.06);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  color: #243f3a;
}

.TCUNC_NewsModule,
.TCUNC_NewsModule * {
  box-sizing: border-box;
}

.TCUNC_NewsModule_Module {
  margin: 0;
  padding: 0;
}

/* ===============================
   保留 rPage 原生模組結構
================================ */

.TCUNC_NewsModule .module,
.TCUNC_NewsModule .module-special,
.TCUNC_NewsModule .mouter {
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
}

/* 不隱藏原本模組標題 */
.TCUNC_NewsModule .module .mt {
  display: block !important;
  margin: 0 0 22px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* 模組標題 */
.TCUNC_NewsModule .module .mt-title {
  margin: 0 !important;
  padding: 0 !important;
  color: #173f4b !important;
  font-size: 30px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.04em !important;
  text-align: left !important;
}

.TCUNC_NewsModule .mt-sub-title {
  padding-left: 15px;
}

/* 內容區 */
.TCUNC_NewsModule .mb {
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
}

/* 詳細內容 */
.TCUNC_NewsModule .mdetail {
  padding: 15px;
}

/* ===============================
   一般列表樣式
================================ */

.TCUNC_NewsModule .listBS {
  position: relative;
  padding: 0;
}

.TCUNC_NewsModule .listBS:not(.listSlide) {
  border-bottom: 1px solid rgba(32, 58, 54, 0.1);
}

.TCUNC_NewsModule .listBS:not(.listSlide):last-of-type {
  border-bottom: none;
}

/* 只處理非輪播列表，避免干擾 Owl Carousel */
.TCUNC_NewsModule .listBS:not(.listSlide) .d-item {
  width: 100%;
  padding: 0;
  float: none;
}

.TCUNC_NewsModule .listBS:not(.listSlide) .mbox {
  position: relative;
  display: block;
  min-height: 58px;
  background: transparent;
  border: 0;
}

/* 標題文字區 */
.TCUNC_NewsModule .d-txt {
  width: 100%;
  padding: 0;
}

/* 清掉 rPage 原本標題背景 */
.TCUNC_NewsModule .d-title .d-txt .mtitle {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 30px;
  background: none !important;
}

/* 左側小圓點 */
.TCUNC_NewsModule .d-title .d-txt .mtitle::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #9aa5a2;
  transform: translateY(-50%);
}

/* 標題 + 日期 */
.TCUNC_NewsModule .d-title .mtitle {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #263f3c;
}

/* 消息標題 */
.TCUNC_NewsModule .d-title .mtitle a {
  flex: 1 1 auto;
  min-width: 0;
  color: #263f3c;
  text-decoration: none !important;
  transition: color 0.2s ease, transform 0.2s ease;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  overflow: hidden;
  text-overflow: ellipsis;
}

.TCUNC_NewsModule .d-title .mtitle a:hover {
  color: #00634b;
  transform: translateX(3px);
}

/* 日期欄位 */
.TCUNC_NewsModule .mdate.after {
  flex: 0 0 auto;
  min-width: 105px;
  margin: 0;
  padding: 0;
  font-style: normal;
  text-align: right;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #53625f;
  white-space: nowrap;
}

/* 去除 rPage 日期可能自帶符號 */
.TCUNC_NewsModule .mdate.after::before,
.TCUNC_NewsModule .mdate.after::after {
  content: none !important;
}

/* ===============================
   圖片 / 影音 / 輪播模組
   只修外觀，不干擾 mbox 點擊
================================ */

.TCUNC_NewsModule .d-img img,
.TCUNC_NewsModule .figBS img {
  width: 100%;
  height: auto;
}

/* webfree 卡片 */
.TCUNC_NewsModule .webfree .d-item .mbox {
  display: flex;
}

/* 補上 TCUNC_NewsModule 前綴，避免影響全站 */
.TCUNC_NewsModule .webfree .h-il-td .mbox,
.TCUNC_NewsModule .webfree .v-id .mbox {
  display: flex !important;
  flex-wrap: nowrap !important;
}

.TCUNC_NewsModule .webfree .h-il-td .mbox .d-txt {
  display: flex !important;
  flex-direction: column-reverse;
}

.TCUNC_NewsModule .webfree .h-il-td .mbox .d-txt .mtitle {
  padding: 18px 28px 30px;
  text-align: right;
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: #56647a;
}

/* 移除 webfree 可能自帶裝飾 */
.TCUNC_NewsModule .webfree .d-item .mbox::before {
  content: none !important;
}

/* 避免影響全站 listSlide */
.TCUNC_NewsModule .listTB:not(.table) tr,
.TCUNC_NewsModule .listSlide tr {
  margin-left: 5px;
  margin-right: 5px;
}

/* ===============================
   輪播 table：桌機版
   桌機保留 rPage 原本 table 多欄排列
================================ */

.TCUNC_NewsModule .listSlide table {
  width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.TCUNC_NewsModule .listSlide table td,
.TCUNC_NewsModule .listSlide table td:not([width="100%"]) {
  display: table-cell !important;
  float: none !important;
  margin-bottom: 0 !important;
  vertical-align: top !important;
}

/* 影音模組標題不要吃一般公告的 flex 排版 */
.TCUNC_NewsModule .v-it .mtitle,
.TCUNC_NewsModule .v-id .mtitle,
.TCUNC_NewsModule .v-td .mtitle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 0 0;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.TCUNC_NewsModule .v-it .mtitle a,
.TCUNC_NewsModule .v-id .mtitle a,
.TCUNC_NewsModule .v-td .mtitle a {
  color: #263f3c;
  text-decoration: none !important;
}

/* 影片卡片寬度 */
.TCUNC_NewsModule .tcu-video-card,
.TCUNC_NewsModule .tcu-video-wrap,
.TCUNC_NewsModule .meditor {
  width: 100%;
  max-width: 100%;
}

/* ===============================
   更多按鈕
================================ */

.TCUNC_NewsModule .more {
  margin: 26px 0 0 !important;
  padding: 0 !important;
  text-align: left;
}

.TCUNC_NewsModule .more a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  height: 46px;
  padding: 0 28px;
  border: 1px solid rgba(35, 55, 52, 0.45);
  border-radius: 999px;
  background: transparent;
  color: #253c45 !important;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none !important;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.TCUNC_NewsModule .more a:hover,
.TCUNC_NewsModule .more a:focus {
  background: #004b38;
  border-color: #004b38;
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* 等高模組時，更多按鈕可往下推 */
.module-compound > .mouter > .mbox .TCUNC_NewsModule .more {
  margin-top: auto !important;
}

/* ===============================
   手機版
================================ */

@media (max-width: 640px) {
  .TCUNC_NewsModule {
    padding: 28px 22px 26px;
    border-radius: 16px;
  }

  .TCUNC_NewsModule .module .mt {
    margin-bottom: 18px !important;
  }

  .TCUNC_NewsModule .module .mt-title {
    font-size: 26px !important;
    line-height: 1.3 !important;
  }

  .TCUNC_NewsModule .mt-sub-title {
    padding-left: 0;
  }

  /* 手機版：webfree 橫排改為換行 */
  .TCUNC_NewsModule .webfree .h-il-td .mbox,
  .TCUNC_NewsModule .webfree .v-id .mbox,
  .TCUNC_NewsModule .webfree .d-item .mbox {
    flex-wrap: wrap !important;
  }

  /* ===============================
     手機版：輪播項目一欄一個
     只改 slide 內部 table，不改 owl-stage / owl-item
  ================================ */

  .TCUNC_NewsModule .listSlide .listTB {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
  }

  .TCUNC_NewsModule .listSlide .listTB tbody,
  .TCUNC_NewsModule .listSlide .listTB tr {
    display: block !important;
    width: 100% !important;
  }

  .TCUNC_NewsModule .listSlide .listTB td,
  .TCUNC_NewsModule .listSlide .listTB td[width="50%"],
  .TCUNC_NewsModule .listSlide .listTB td:not([width="100%"]) {
    display: block !important;
    width: 100% !important;
    float: none !important;
    clear: both !important;

  }

  .TCUNC_NewsModule .listSlide .listTB td + td {
    margin-top: 28px !important;
  }

  .TCUNC_NewsModule .listSlide .d-item,
  .TCUNC_NewsModule .listSlide .mbox,
  .TCUNC_NewsModule .listSlide .d-txt,
  .TCUNC_NewsModule .listSlide .mdetail,
  .TCUNC_NewsModule .listSlide .meditor,
  .TCUNC_NewsModule .listSlide .tcu-video-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
  }

  .TCUNC_NewsModule .listSlide .tcu-video-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  .TCUNC_NewsModule .listSlide iframe {
    width: 100% !important;
    height: 100% !important;
  }

  .TCUNC_NewsModule .listSlide .mbox {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  .TCUNC_NewsModule .listSlide .mtitle {
    padding: 0 0 10px !important;
  }

  .TCUNC_NewsModule .listSlide .mdetail {
    padding: 0 !important;
  }

  /* 一般列表手機版 */
  .TCUNC_NewsModule .listBS:not(.listSlide) .mbox {
    min-height: auto;
  }

  .TCUNC_NewsModule .d-title .d-txt .mtitle {
    padding: 13px 0 13px 26px;
  }

  .TCUNC_NewsModule .d-title .d-txt .mtitle::before {
    width: 9px;
    height: 9px;
    top: 31px;
    transform: none;
  }

  .TCUNC_NewsModule .d-title .mtitle {
    display: block;
    font-size: 15px;
    line-height: 1.8;
  }

  .TCUNC_NewsModule .d-title .mtitle a {
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
  }

  .TCUNC_NewsModule .mdate.after {
    display: block;
    min-width: 0;
    margin-top: 4px;
    text-align: left;
    font-size: 13px;
    color: #7a8582;
  }

  .TCUNC_NewsModule .more a {
    width: 100%;
  }
}