/* 保證整個畫面不會有水平滾動 */
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 禁止橫向滾動 */
  width: 100%;
}

.custom-navbar {
  background-color: #b02e21; /* 預設透明 */
}
/* ---------------------------------
   大Binner形象圖
---------------------------------- */

.big-binner {
  width: 100%;
  background-color: #b02e21;
  position: relative;
  overflow: hidden;
  padding-top: 0; /* 無需保留高度，讓圖片等比例顯示 */
  margin-top: 5vh;
}

/* 圖片維持等比例縮放 */
.big-binner-img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 1440px) {
  .big-binner {
    margin-top: 8vh;
  }
}

@media (max-width: 1300px) {
  .big-binner {
    margin-top: 8.5vh;
  }
}

@media (max-width: 1024px) {
  .big-binner {
    margin-top: 5.5vh;
  }
}

@media (max-width: 768px) {
  .big-binner {
    margin-top: 4vh;
  }
}

/* ---------------------------------
   最新消息
---------------------------------- */
.news-content {
  padding-top: 60px;
  padding-bottom: 100px;
  position: relative;
  z-index: 3;
  background-color: #f4f0ee;
  background-image: url("../img/background-index2.png");
  background-repeat: repeat;
  background-size: 50px 50px;
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 90%;
  padding: 0 0;
  margin: 0 auto 2rem;
  font-size: 2rem;
  font-weight: bold;
}

.news-header::before,
.news-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: #333;
  opacity: 0.3;
}

.lamp-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  z-index: 2;
  pointer-events: none; /* 👈 關鍵！讓圖片變成可穿透不阻擋點擊 */
}

.news-header {
  text-align: center;
  margin-bottom: 2rem;
  z-index: 1;
}

.news-header h2 {
  font-size: 2rem;
  color: #333;
  font-weight: bold;
}

.news-list {
  max-width: 80%;
  margin: 0 auto;
}

.news-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-thumbnail {
  width: 100%;
  height: 200px; /* 可依需求調整 */
  overflow: hidden;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 等比填滿並裁切 */
  object-position: center; /* 中心對齊（上下左右） */
  display: block;
}

.news-body {
  padding: 1rem;
  height: 5.9em; /* 1 行標題 + 2 行內文剛好 */
  overflow: hidden;
}

.news-title {
  font-size: 1.25rem;
  font-weight: bold;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* 單行截斷用這個 */
}

.news-summary {
  font-size: 0.9rem;
  color: #333;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 顯示最多兩行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-inner {
  width: 85%;
  margin: 0 auto;
}

/* 原本的按鈕樣式維持不變 */
.news-centnet-link {
  width: 100%;
  margin-top: 1rem;
  background-color: #333 !important;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  padding: 0.6rem 1rem;
  border: none;
  transition: all 0.3s ease;
}

.news-centnet-link:hover {
  background-color: #000;
  transform: scale(1.02);
}

.modal-header.no-border {
  border-bottom: none !important;
}

@media (max-width: 1024px) {
  .news-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .news-summary {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .news-list {
    max-width: 90%;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .lamp-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    z-index: 1;
  }

  .news-list {
    max-width: 95%;
    margin: 0 auto;
  }

  .news-title {
    font-size: 1.3rem;
  }

  .news-summary {
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .lamp-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    z-index: 1;
  }
}

/* ---------------------------------
   Modal 彈出視窗
---------------------------------- */

.custom-modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
}

.custom-modal-header {
  border-bottom: none;
}

.modal-header-bg {
  height: 350px;
  background-size: cover;
  background-position: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

#newsModalTitle {
  text-align: left;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6) !important; /* 半透明黑色 */
  /*z-index: 1040; /* 與 .modal 一致 */
}

@media (max-width: 850px) {
  .modal-header-bg {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .modal-header-bg {
    height: 200px;
  }
}

@media (max-width: 400px) {
  .modal-header-bg {
    height: 150px;
  }
}

/* ---------------------------------
   底部圖片
---------------------------------- */

.bottom-photo {
  position: relative;
  width: 100%;
  background: #f4f0ee url("../img/background-index2.png") repeat;
  background-size: 50px 50px;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
  z-index: 1;
}

.bottom-photo-img {
  width: 100%;
  height: 250px; /* ✅ 高度你可以自定，這裡是示範值 */
  object-fit: cover; /* ✅ 關鍵：裁切並填滿容器 */
  object-position: center; /* ✅ 關鍵：以圖片中心為裁切基準 */
  display: block;
}

.bottom-photo {
  padding-bottom: 0; /* 移除底部空間 */
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .bottom-photo-img {
    height: 200px; /* ✅ 高度你可以自定，這裡是示範值 */
  }
}

@media (max-width: 480px) {
  .bottom-photo-img {
    height: 160px; /* ✅ 高度你可以自定，這裡是示範值 */
  }
}

@media (max-width: 400px) {
  .bottom-photo-img {
    height: 145px; /* ✅ 高度你可以自定，這裡是示範值 */
  }
}

/*  Google 翻譯切換按鈕  */
#translate-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background-color: #333;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#translate-toggle-btn img {
  width: 24px;
  height: 24px;
}

#google_translate_element {
  position: fixed;
  bottom: 80px; /* 調整這裡讓它浮在按鈕上面 */
  left: 20px;
  z-index: 99999;
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.goog-te-gadget {
  font-family: inherit !important;
  font-size: 0 !important;
}

.goog-te-gadget .goog-te-combo {
  font-size: 14px !important;
}
