p {
  font-size: 18px;
}

/** 將底部的footer硬拉成100%的寬度**/ 
#colophon-inside.footer-three .widget-container {
    width: 100% !important;
    max-width: 100% !important;
    display: block; /* 讓元素填滿整行 */
}

/** 將底部的footer硬拉成100%的寬度 end **/ 

/* 將 breadcrumbs 最後一段目前頁面的文字顯示為白色 */
/* #breadcrumbs-container #breadcrumbs-nav .current {
  color: #ffffff;
} */

/* 將 breadcrumbs 最後一段目前頁面的文字顯示為白色 */
#breadcrumbs-container #breadcrumbs-nav {
  color: #ffffff;
}

/* @media (max-width: 767px) {
  .menu-main-search form.searchform {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100vw;
    background: white;
    z-index: 1000;
    padding: 1em;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .menu-main-search.active form.searchform {
    display: block;
  }

  .menu-main-search {
    position: relative;
  }

  .menu-main-search .icon-cancel {
    display: none;
    position: absolute;
    top: 0.5em;
    right: 1em;
    z-index: 1001;
  }

  .menu-main-search.active .icon-cancel {
    display: block;
  }
}
 */


/*處理手機選單時，搜尋框往下掉的問題*/

@media (max-width: 767px) {
  .menu-main-search {
    position: relative !important; /* 取消絕對定位，改為隨選單流動 */
    width: 100%;
		 height: 80px; /* 或你想要的高度 */
  line-height: 80px; /* 垂直置中內容 */
  }

		.menu-main-search form.searchform {
			position: static; /* 讓表單正常流動 */
			width: 100%;
			display: block;
			padding: 0.5em;
		}
		.menu-main-search-wrapper {
		position: relative;
	}

	.menu-main-search {
		position: absolute;
		top: 100%;
		right: 0;
		z-index: 999;
	}
	
	#mega-menu-wrap-primary #mega-menu-primary {
  	margin-top: -50px; /* 或 */
/*   	transform: translateY(-20px); */
	}

}

/* End */


/* ===== 分類列表頁卡片優化（只作用在最新消息、專欄文章、影音分享、EDM 四個分類頁）===== */

/* 卡片網格：桌機 3 欄／平板 2 欄／手機 1 欄 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-posts-container.elementor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: 28px !important;
  row-gap: 32px !important;
}
@media (max-width: 1024px) {
  body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-posts-container.elementor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 20px !important;
  }
}
@media (max-width: 767px) {
  body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-posts-container.elementor-grid {
    grid-template-columns: 1fr !important;
    row-gap: 24px !important;
  }
}

/* 卡片外觀：圓角、細框、等高、滑過微浮起 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__card {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e6e9e1 !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05) !important;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .10) !important;
}

/* 圖片統一 16:9 裁切，滑過微放大 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__thumbnail {
  padding-bottom: 56.25% !important;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__thumbnail img {
  object-fit: cover;
  transition: transform .4s ease;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__card:hover .elementor-post__thumbnail img {
  transform: translate(-50%, -50%) scale(1.04);
}

/* 專欄 Banner 為 1200×630，改用相同比例避免裁到文字 */
body.category-column .elementor-post__thumbnail {
  padding-bottom: 52.5% !important;
}

/* 影音分享、EDM 封面比例不一（多為正方形海報），統一 4:3 框、完整顯示不裁切 */
body:is(.category-video-resources, .category-edm-2) .elementor-post__thumbnail {
  padding-bottom: 75% !important;
  background: #f3f5ef;
}
body:is(.category-video-resources, .category-edm-2) .elementor-post__thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* 文字區 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__text {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  padding: 20px 24px 22px !important;
  margin: 0 !important;
}

/* 分類標籤（需在 Elementor 開啟 Badge 才會出現） */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__badge {
  background: #88B332 !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 12px !important;
  letter-spacing: .05em;
}

/* 標題：黑色粗體、最多 2 行 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__title {
  margin: 0 0 10px !important;
  order: 2;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__title a {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.55 !important;
  color: #222 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
  transition: color .2s ease;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__card:hover .elementor-post__title a {
  color: #4F7A12 !important;
}

/* 日期（需在 Elementor 開啟 Meta Data → Date 才會出現） */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__meta-data {
  order: 1;
  margin: 0 0 6px !important;
  font-size: 13px !important;
  color: #88B332 !important;
  font-weight: 600;
  letter-spacing: .03em;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__card .elementor-post__meta-data {
  border: 0 !important;
  padding: 0 !important;
}

/* 摘要：最多 3 行 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__excerpt {
  order: 3;
  margin: 0 0 16px !important;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__excerpt p {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif !important;
  font-size: 15px !important;
  line-height: 1.8 !important;
  color: #555 !important;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 摘要有多段時只顯示第一段 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__excerpt p:not(:first-child) {
  display: none !important;
}

/* 閱讀更多：固定在卡片底部 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__read-more {
  order: 4;
  margin-top: auto !important;
  align-self: flex-start;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #4F7A12 !important;
  border-bottom: 2px solid #88B332;
  padding-bottom: 2px;
  letter-spacing: .03em;
}

/* 看更多文章按鈕：綠框膠囊 */
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .e-load-more-anchor + .elementor-button-wrapper .elementor-button,
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-button-wrapper .elementor-button:has(.e-load-more-spinner) {
  background: #fff !important;
  color: #4F7A12 !important;
  border: 1.5px solid #88B332 !important;
  border-radius: 999px !important;
  padding: 12px 36px !important;
  font-weight: 600 !important;
  margin-top: 16px;
  transition: background .2s ease, color .2s ease;
}
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .e-load-more-anchor + .elementor-button-wrapper .elementor-button:hover,
body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-button-wrapper .elementor-button:has(.e-load-more-spinner):hover {
  background: #88B332 !important;
  color: #fff !important;
}

/* 手機：內距收窄 */
@media (max-width: 767px) {
  body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__text {
    padding: 16px 18px 20px !important;
  }
  body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-post__title a {
    font-size: 17px !important;
  }
}

/* 2 欄時，最後一張落單的卡片置中 */
@media (min-width: 768px) and (max-width: 1024px) {
  body:is(.category-latest-news, .category-column, .category-video-resources, .category-edm-2) .elementor-posts-container.elementor-grid > article:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 10px);
  }
}