.news-page {
  position: relative;
}

.news-page__photo {
  position: relative;
  min-height: 500px;
  border-radius: 60px 60px 0 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 0 56px 56px;
}


.news-page__title {
  position: relative;
  z-index: 1;
  font-size: 56px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 1rem;
}

.news-page__panel {
  position: relative;
  z-index: 33;
  background: #fff;
  border-radius: 70px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .06);
  padding: 40px 48px 5rem;
  margin: -60px auto 0;
}
.news-page__panel.news-detail {
  padding: 40px 48px 56px;
}

/* ---------------- news-page__toolbar ---------------- */
.news-page__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid #ececec;
}

.news-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.news-filter__item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 16px;
  color: #4d4a49;
  user-select: none;
}

.news-filter__item input {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid #4d4a49;
  border-radius: 50%;
  margin: 0;
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  transition: border-color .2s ease;
}

.news-filter__item input:checked {
  border-color: var(--ink-soft);
}

.news-filter__item input:checked::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: url('../img/checked-icon.png') no-repeat center / cover;
}

.news-filter__item:has(input:checked) {
  color: var(--ink-soft);
  font-weight: 400;
}

.news-sort {
  position: relative;
  flex: 0 0 auto;
}

.news-sort__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 4px;
}

.news-sort__dot {
  background-image: url(../img/news-by-year-plus.png);
  background-size: cover;
  background-position: center;
  width: 15px;
  height: 15px;
  display: inline-block;
}

.news-sort__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #f1f1f1;
  border-radius: 10px;
  min-width: 170px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 5;
}

.news-sort.open .news-sort__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.news-sort__option {
  background: none;
  border: none;
  text-align: left;
  font-size: 16px;
  color: #727171;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.news-sort__option:hover {
  background: #e9eaed;
}

.news-sort__option.is-active {
  color: #727171;
  font-weight: 400;
  background: #eaf6fd;
}

/* ---------------- 卡片格狀列表 ---------------- */
.news-page__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.news-card__img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-card__img--placeholder img {
  width: 100%;
  border-radius: 15px;
}

/* ---------------- news-pagination ---------------- */
.news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 80px;
}

.news-pagination__arrow,
.news-pagination__page {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: #4d4a49;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  text-decoration: none;
}

.news-pagination__page.is-active {
  /* background: var(--ink-soft); */
  color: var(--ink-soft);
  font-weight: 400;
  text-decoration: underline;
}

.news-pagination__page:hover:not(.is-active) {
  background: #f0f0f0;
  color: var(--ink-soft);
}

.news-pagination__arrow:hover {
  color: var(--ink-soft);
}

.news-pagination__ellipsis {
  color: #b3b3b3;
  padding: 0 4px;
  letter-spacing: 1px;
}


@media (max-width: 991px) {
  .news-page__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-page__photo {
    min-height: 280px;
    padding: 0 28px 32px;
    border-radius: 40px 40px 0 0;
  }

  .news-sort__menu{
    right: auto;
    left: 0;
  }

  .news-page__title {
    font-size: 34px;
  }

  .news-page__panel {
    padding: 28px 0.5rem 50px;
    margin-top: -40px;
    border-radius: 28px;
  }

  .news-page__toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .news-pagination{
    padding-bottom: 0;
    margin-top: 2rem;
  }
}

@media (max-width: 767px) {
  .news-page__grid {
    grid-template-columns: 1fr;
  }

.news-filter {
  gap: 9px;
}
}


@media (max-width: 575px) {
  .news-page__photo {
    min-height: 210px;
  }
}
/* ==========================================================
   消息卡片
   （與首頁的消息輪播共用同一組樣式，index.css 亦有一份；
     news 列表頁只載入 news.css，故在此保留一份）
========================================================== */

.news-card {
  display: block;
  background: #E3E4EA;
  border-radius: 30px;
  overflow: hidden;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
  padding: 1.4rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .08);
}

.news-card__img {
  background: #dcdae2;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
}

.news-card__body {
  padding-top: 1rem;
  position: relative;
}

.news-group {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.tag-handson {
    background: #8EC31F;
}

.tag-webinar {
    background: #9F9FA0;
}

.tag-exhibition {
    background: #00A1E9;
}

.news-tag {
  display: inline-block;
  position: relative;
  top: 0;
  padding: 2px 10px;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 400;
  color: #fff;
}

.news-card__body time {
  display: block;
  font-size: 16px;
  color: #4d4a49;
  margin-bottom: 6px;
  margin-top: 16px;
}

.news-card__body h3 {
  font-size: 22px;
  font-weight: 800;
  color: #4d4a49;
  margin: 0 0 12px;
  line-height: 1.4;
}

.news-card__body p {
  font-size: 16px;
  line-height: 1.8;
  color: #87888e;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 80px;
}

.read-more {
  color: var(--ink);
  font-weight: 300;
  font-size: 15px;
  text-decoration: none;
}

@media (max-width:991px) {
  .news-group {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    margin-bottom: 1rem;
  }
  .news-card__body h3 {
    font-size: 20px;
  }
  .news-card__body p {
    font-size: 16px;
  }
  .news-card__body time {
    margin: 0;
  }
}
