/* ============================================
   news.css — 列表頁 / 內頁 / 活動花絮 共用樣式
   ============================================ */

/* news detail / events detail — content-wrapper 上移 */
main:has(.news-detail__meta) .content-wrapper,
main:has(.events-grid) .content-wrapper {
  margin-top: -48px;
}

/* 手機版 page-content 加大左右 padding */
@media (max-width: 991px) {
  .page-content { padding-inline: 1.5rem; }
}


/* ============================================
   LIST TABLE（桌機版 — 通用列表）
   ============================================ */
.list-table-wrap {
  display: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 2.5rem;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.list-table th,
.list-table td {
  padding: 1rem 2rem;
  font-size: .9375rem;
  border-bottom: 1px solid rgba(106, 55, 212, .08);
  position: relative;
}
.list-table th:not(:last-child)::after,
.list-table td:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: #ccc;
}
.list-table th:not(:last-child)::after { background: #888; }

.list-table thead tr {
  background: #D5CEF3;
}

.list-table th {
  font-weight: normal;
  color: var(--text-dark);
  text-align: center;
}
.list-table th:first-child { border-radius: 10px 0 0 0; }
.list-table th:last-child  { border-radius: 0 10px 0 0; }

.list-table tbody tr:nth-child(odd) {
  background: #fff;
}
.list-table tbody tr:nth-child(even) {
  background: #EEEAF3;
}

.list-table tbody tr:last-child td {
  border-bottom: none;
}
.list-table tbody tr:last-child td:first-child { border-radius: 0 0 0 10px; }
.list-table tbody tr:last-child td:last-child  { border-radius: 0 0 10px 0; }

.list-table__date {
  text-align: center;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-muted);
  width: 160px;
}

.list-table__title {
  text-align: left;
}
.list-table__title a {
  color: var(--primary-color);
  line-height: 1.6;
  transition: opacity var(--transition);
}
.list-table__title a:hover { opacity: .75; }

.list-table__dl {
  text-align: center;
  white-space: nowrap;
}

.list-table__dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  color: #888;
  transition: color var(--transition);
}
.list-table__dl-btn svg { width: 1.125rem; height: 1.125rem; }
.list-table__dl-btn:hover {
  color: var(--text-dark);
}

/* 編號欄 */
.list-table__no {
  text-align: center;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 1rem;
}

/* 標題下方訂定時間 */
.list-table__sub-date {
  display: block;
  margin-top: .35rem;
  font-size: .8125rem;
  color: var(--text-muted);
  font-family: 'Montserrat', 'Noto Sans TC', sans-serif;
}

/* 搜尋區：僅關鍵字滿版 */
.search-filter--keyword-only .search-filter__keyword {
  flex: 1 1 100%;
}


/* ============================================
   EVENTS GRID（活動花絮列表 卡片式）
   ============================================ */
.events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .events-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 992px) {
  .events-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.events-grid__card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
}
@media (min-width: 768px) {
  .events-grid__card {
    padding-bottom: 0;
    border-bottom: none;
  }
}
.events-grid__card:hover .events-grid__img {
  transform: scale(1.05);
}

.events-grid__img-wrap {
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 1rem;
  aspect-ratio: 16 / 10;
}
.events-grid__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.events-grid__date {
  display: inline-flex;
  align-items: center;
  padding: .5rem 1rem;
  background: #E8E2F9;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: .9375rem;
  color: var(--primary-color);
  letter-spacing: .05rem;
  font-weight: 500;
  margin-bottom: .75rem;
}

.events-grid__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.5;
  transition: color var(--transition);
  padding-left: 4px;
}
.events-grid__card:hover .events-grid__title {
  color: var(--primary-color);
}

/* ============================================
   NEWS DETAIL（內頁）
   ============================================ */
main:has(.news-detail__meta) .page-hero,
main:has(.events-grid) .page-hero {
  min-height: 410px;
}
@media (min-width: 992px) {
  main:has(.news-detail__meta) .page-hero__title {
    max-width: 840px;
    margin-bottom: 7rem;
  }
}
.news-detail__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}
.news-detail__date {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  background: #E8E2F9;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: var(--text-base);
  letter-spacing: .05rem;
  font-weight: 500;
}
.news-detail__tools {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.news-detail__tool-btn--print {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 .875rem;
  height: 2rem;
  border: 1px solid #4D4D4D;
  border-radius: 8px;
  background: transparent;
  color: var(--text-base);
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.news-detail__tool-btn--print:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}
.news-detail__font-size {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.news-detail__font-size-label {
  font-size: .875rem;
  color: var(--text-base);
  margin-right: .25rem;
}
.news-detail__font-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: transparent;
  color: #ccc;
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.news-detail__font-btn.is-active {
  background: #ccc;
  color: #888;
}
.news-detail__font-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

@media (min-width: 768px) {
  .news-detail__meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* 文章本體 */
.news-detail__body {
  font-size: 18px;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(106, 55, 212, .08);
}
.news-detail__figure,
.news-detail__body figure {
  margin: 0 0 30px;
  text-align: center;
}
.news-detail__img,
.news-detail__body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
}
.news-detail__subtitle {
  font-size: inherit;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
  color: var(--text-dark);
  margin-bottom: .75rem;
}
.news-detail__body p {
  font-size: inherit;
  line-height: 1.8;
  letter-spacing: 0.12em;
  color: var(--text-base);
  text-align: justify;
  margin-bottom: 30px;
}

/* Gallery inside article */
.news-detail__body .events__wrapper {
  margin-bottom: 0;
}
@media (min-width: 768px) {
  .news-detail__body .events__wrapper {
    margin-bottom: 2rem;
  }
}
.news-detail__body .events__dots {
  margin-bottom: 2rem;
}

/* 返回上一頁 */
.news-detail__back {
  text-align: center;
  padding: 1.5rem 0 2rem;
}
.news-detail__back-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: 1rem;
  color: var(--primary-color);
  font-weight: 500;
  transition: opacity var(--transition);
}
.news-detail__back-link:hover {
  opacity: .7;
}

/* ============================================
   手機也顯示 table（卡片式）
   ============================================ */
.list-table-wrap--always { display: block; }

@media (max-width: 767px) {
  .list-table--card-mobile thead { display: none; }
  .list-table--card-mobile,
  .list-table--card-mobile tbody { display: block; }
  .list-table--card-mobile { min-width: 0; }
  .list-table--card-mobile tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
  }
  .list-table--card-mobile tr:nth-child(odd) { background: #fff; }
  .list-table--card-mobile tr:nth-child(even) { background: #E8E2F9; }
  .list-table--card-mobile tr:first-child { border-radius: 15px 15px 0 0; }
  .list-table--card-mobile tr:last-child { border-radius: 0 0 15px 15px; border-bottom: none; }
  .list-table--card-mobile td {
    display: block;
    padding: 0;
    border: none;
  }
  .list-table--card-mobile td::after { display: none; }
  .list-table--card-mobile .list-table__no,
  .list-table--card-mobile .list-table__date {
    grid-column: 1;
    grid-row: 1;
    font-size: .875rem;
    margin-bottom: .25rem;
    text-align: left;
    width: auto;
  }
  .list-table--card-mobile .list-table__title {
    grid-column: 1;
    grid-row: 2;
    font-size: 1rem;
    line-height: 1.6;
  }
  .list-table--card-mobile .list-table__title a {
    color: var(--primary-color);
  }
  .list-table--card-mobile .list-table__sub-date {
    margin-top: .35rem;
  }
  .list-table--card-mobile .list-table__dl {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    padding-left: 1rem;
  }
  .list-table--card-mobile .list-table__dl-btn svg {
    width: 23px;
    height: 23px;
  }
}

/* ============================================
   RWD：768px+ 切換 table
   ============================================ */
@media (min-width: 768px) {
  .list-table-wrap { display: block; }
}
