/**
 * 最新消息頁面樣式
 *
 * @package mytheme
 */
.news-page {
  color: #53bf6f;
}

/* 最新消息區塊 */
.news-section {
  padding: 48px 0 120px;
}

/* 分類篩選按鈕 */
.news-cat-filter {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  justify-content: center;
}
.news-cat-btn {
  padding: 8px 28px;
  border-radius: 48px;
  border: 1px solid #53bf6f;
  background-color: #fff;
  color: #53bf6f;
  font-family: Inter;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    background-color 0.3s,
    color 0.3s;
  text-decoration: none;
}
.news-cat-btn:hover {
  background-color: #53bf6f;
  color: #fff;
}
.news-cat-btn.active {
  background-color: #53bf6f;
  color: #fff;
}

/* 文章列表 */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 文章卡片 */
.post {
  width: 100%;
  max-width: 1280px;
  background-color: #fff;
  display: flex;
  align-items: stretch;
  padding: 30px 31px;
  box-sizing: border-box;
  gap: 32px;
  text-align: left;
  font-family: Inter;
  color: inherit;
  box-shadow: 0px 4px 28.7px rgba(0, 0, 0, 0.25);
}
.post-image-link {
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.post-image-link:hover {
  filter: brightness(1.1);
}
.post-image-icon {
  height: 169px;
  width: 477px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
.post-image-placeholder {
  background-color: #f0f0f0;
}
.post-head-parent {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  justify-content: space-between;
}

.post-inner-wrap {
  display: flex;
  gap: 12px;
  flex-direction: column;
}
.post-head {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.post-title {
  position: relative;
  color: #53bf6f;
  letter-spacing: 0.1em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-title:hover {
  filter: brightness(1.1);
}
.post-date {
  position: relative;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 14px;
}
.post-excerpt {
  align-self: stretch;
  position: relative;
  letter-spacing: 0.1em;
}
.read-more-btn {
  display: flex;
  align-items: flex-end;
  gap: 23px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  justify-content: flex-end;
}
.read-more-btn:hover .read-more-text {
  color: #53bf6f;
}
.read-more-btn:hover .read-more-icon {
  transform: translateX(2px);
}
.read-more-text {
  position: relative;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}
.read-more-icon {
  height: 25.59px;
  width: 76px;
  position: relative;
  max-height: 100%;
  transition: all 0.3s ease;
}

/* 分頁點 */
.news-pagination-dots {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
}
.news-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #5a8164;
  box-sizing: border-box;
  transition: background-color 0.3s;
  cursor: pointer;
}
.news-dot:hover {
  background-color: rgba(90, 129, 100, 0.4);
}
.news-dot.active {
  background-color: #5a8164;
  border: none;
}

/* 無文章 */
.news-no-posts {
  text-align: center;
  padding: 80px 0;
  font-family: Inter;
  color: #666;
}

/* 手機版 trigger（桌面隱藏） */
.news-filter-mobile-trigger {
  display: none;
}

.news-filter-wrapper {
  position: relative;
}

/* 手機版 ≤480px */
@media (max-width: 480px) {
  .news-section {
    padding: 20px 0 82.7px;
    min-height: 100vh;
  }
  .news-filter-wrapper {
    width: 100%;
    margin-bottom: 24px;
    max-width: 275px;
  }

  .news-filter-mobile-trigger {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #53bf6f;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 201;
    width: 100%;
  }

  .news-filter-mobile-label {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: #5a8164;
    text-align: center;
  }

  .news-filter-mobile-divider {
    width: 1.5px;
    height: 100%;
    min-height: 36px;
    background: #53bf6f;
    flex-shrink: 0;
  }

  .news-filter-mobile-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex: 1;
    flex-shrink: 0;
  }

  .news-filter-mobile-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #53bf6f;
    border-radius: 1px;
    transition: all 0.3s ease;
  }

  /* hamburger → X 動畫 */
  .news-filter-mobile-trigger.active
    .news-filter-mobile-hamburger
    span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }
  .news-filter-mobile-trigger.active
    .news-filter-mobile-hamburger
    span:nth-child(2) {
    opacity: 0;
  }
  .news-filter-mobile-trigger.active
    .news-filter-mobile-hamburger
    span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  /* 分類按鈕：浮動下拉面板 */
  .news-cat-filter {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 200;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    gap: 0;
    margin-bottom: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition:
      max-height 0.4s ease,
      padding 0.3s ease;
  }

  .news-cat-filter.mobile-open {
    max-height: 500px;
    padding: 5px 0;
    overflow-y: auto;
  }

  .news-cat-btn {
    width: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #eee;
    box-shadow: none;
    padding: 12px 20px;
    font-size: 12px;
    text-align: left;
  }

  .news-cat-btn:last-child {
    border-bottom: none;
  }

  .news-cat-btn.active {
    background-color: #53bf6f;
    color: #fff;
  }

  /* 文章列表：2欄3列 grid */
  .news-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 12px;
  }

  .post {
    flex-direction: column;
    padding: 14px 11.5px;
    gap: 12px;
    box-shadow: 2px 2px 10.4px 0 rgba(0, 0, 0, 0.25);
  }

  .post-image-icon {
    width: 100%;
    height: auto;
  }

  .post-head-parent {
    min-height: auto;
    align-items: flex-start;
    gap: 8px;
  }

  .post-head {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .post-title {
    font-size: 12px;
  }

  .post-date {
    font-size: 10px;
    font-weight: 400;
  }

  .post-excerpt {
    font-size: 10px;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .read-more-btn {
    align-items: center;
    gap: 16px;
    align-self: flex-end;
  }

  .read-more-text {
    font-size: 10px;
  }

  .read-more-icon {
    width: 40px;
    height: auto;
  }

  /* 分頁點縮小 */
  .news-pagination-dots {
    margin-top: 24px;
    gap: 8px;
  }

  .news-dot {
    width: 4px;
    height: 4px;
    border-width: 1.5px;
  }
}
