/* ------------------------ 網頁基本設定 ------------------------ */
body {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  background-color: #fdf6dc;
  color: #333;
}

a {
  text-decoration: none;
}

/* ------------------------ 導覽列 Header ------------------------ */
header {
  background-color: #fdf6dc;
  padding: 10px 30px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* ✅ 從 center 改為三欄分散 */
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 0 40px;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 36px;
}
.navbar-links {
  flex: 1.5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 50px;
  padding-left: 275px;
}

nav a {
  font-size: 20px;
  text-decoration: none;
  color: #887d00;
  font-weight: bold;
  padding: 6px 12px;
}

nav a:hover {
  color: #2a8491;
  text-decoration: underline;
  transition: 0.3s;
}

.buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.buttons a {
  padding: 6px 12px;
  border-radius: 6px;
  background-color: #f0c837;
  color: white;
  text-decoration: none;
  font-size: 14px;
}

.buttons a:hover {
  background-color: #b9953d;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: 0.3s;
}

/* ------------------------ Logo 共用樣式 ------------------------ */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 75px;
  width: auto;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  text-align: left;
}

.logo-title {
  font-size: 30px;
  font-weight: bold;
  display: inline-block;
  white-space: nowrap; /* ✅ 防止換行 */
  letter-spacing: 0;    /* ✅ 可選：緊密 */
  gap: 0px;
}

.logo-blue {
  color: #418693;
}

.logo-orange {
  color: #f37c3a;
}

.logo-subtitle {
  font-size: 20px;
  color: #21414C;
  margin-top: 2px;
  font-weight: bold;
}

/* ------------------------ Hero 區塊 ------------------------ */
.hero {
  position: relative;
  height: 750px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slides-wrapper {
  display: flex;
  width: 600%;
  height: 100%;
  transition: transform 1s ease-in-out;
  will-change: transform;
  backface-visibility: hidden;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-bottom {
  object-position: center bottom;
}

.hero-overlay {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.4);
  inset: 0;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  font-size:35px;
  font-weight: bold;
  color: white;
  line-height: 1.6;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6);
}

.hero-content.show {
  opacity: 1;
}

.hero-content::after {
  content: "|";
  animation: blink 1s infinite;
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  z-index: 3;
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.hero-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background-color 0.3s, background-image 0.3s;
}

.hero-dots .dot.active {
  background: white;
}

html {
  scroll-behavior: smooth;
}

/* ------------------------ 標題區塊 ------------------------ */ 
h2.section-title {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 0px;
  font-size: 26px;
  font-weight: bold;
}

/* ------------------------ 卡片區塊 ------------------------ */
.cards {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 30px;
}

.card {
  flex: 1 1 30%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: none; /* 不使用直接背景，讓 ::before 繼承 HTML 的背景圖 */
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
  font-size: 100px;
  font-weight: bold;
  text-align: left;
  z-index: 1;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1);
  transition: transform 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.card:hover::before {
  transform: scale(1.08);
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(100, 80, 20, 0.4); /* ✅ 遮罩顏色 */
  z-index: 2;
}

.card span {
  position: relative;
  z-index: 3;
}

/* .card:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
} */

@media (max-width: 768px) {
  .card {
    flex: 1 1 100%;
  }
}

/* ✅ 單卡片區塊包裹層寬度設為與上方一致，讓卡片能放寬 */
.wide-card-section {
  max-width: 1500px;         /* 約等於 3 個 450px 卡片 + 2 × 40px 間距 */
  margin: 0 auto;
  padding: 30px;
  display: flex;
  justify-content: center;
}

/* ✅ 卡片本身變寬變高 */
.card.tall-wide-card {
  width: 100%;
  height: 500px;             /* 你可以自己調整高度 */
  max-width: none;
  flex: none;
  aspect-ratio: unset;
}

/* ✅ RWD 時變回跟其他一樣 */
@media (max-width: 768px) {
  .wide-card-section {
    padding: 30px;
  }

  .card.tall-wide-card {
    width: 100%;
    height: auto;
    flex: 1 1 100%;
    aspect-ratio: 1 / 1;
  }
}

/* ------------------------ 卡片按鈕 區塊 ------------------------ */
.single-card-carousel {
  position: relative;
  max-width: 1650px;
  margin: 40px auto;
  padding: 0 60px; /* 給按鈕留空間 */
  box-sizing: border-box;
}

.carousel-wrapper {
  position: relative;
  overflow: visible;
}

/* 新增的遮罩層 */
.carousel-mask {
  overflow: hidden;
  width: 100%;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  flex-direction: row; /* ⬅️ 加這行確保橫向排列 */
  width: 100%;
  transition: transform 0.5s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  position: relative;
  height: 500px;
  overflow: hidden;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

/* ✅ 圖片hover微微放大 */
.carousel-slide:hover img {
  transform: scale(1.05);
}

/* ✅ 加上遮罩 */
.carousel-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(100, 80, 20, 0.4);
  z-index: 1;
}

/* ✅ 字清楚在上面 */
.carousel-slide span {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
  font-size: 100px;
  font-weight: bold;
  z-index: 2;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
}

/* ✅ 按鈕 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: #ffd43a;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 26px;
  color: white;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.carousel-btn.left {
  left: -65px;
}

.carousel-btn.right {
  right: -65px;
}

.carousel-btn:hover {
  background-color: #f3c040;
}

.carousel-slide .slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* 為了讓 <a> 裡面包住圖片、span、overlay 有效果 */
.carousel-slide a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
  color: inherit;
}

/* ------------------------ Footer 區塊 ------------------------ */
.site-footer {
  background-color: #b4b4b4;
  color: #333;
  padding: 30px 20px 10px;
  font-size: 14px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo img {
  height: 70px;
  width: auto; /* ✅ 改這裡：保持原比例 */
  border-radius: 0; /* ✅ 可選：如果你不要裁成圓形 */
  object-fit: contain; /* ✅ 防止扭曲 */
}

.footer-links a {
  display: block;
  color: #424242;
  text-decoration: none;
  margin: 4px 0;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-contact p {
  margin: 4px 0;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid #999;
  padding-top: 10px;
  font-size: 12px;
  color: #666;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-links .link-row {
  display: flex;
  gap: 20px;
  justify-content: center; /* 可選：讓連結置中 */
  flex-wrap: wrap;
}


/* ------------------------ 回到最上面箭頭樣式 ------------------------ */
#backToTopBtn {
  position: fixed;
  bottom: 40px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #f0c837;
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  font-size: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#backToTopBtn:hover {
  background-color: #b9953d;
}


/* ------------------------ RWD 響應式設計 ------------------------ */

/* ✅ 手機尺寸：小於等於 768px */
@media (max-width: 768px) {
  h2.section-title {
    font-size: 22px;
  }

  .hero-content {
    font-size: 16px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  nav a {
    display: inline-block;
    margin: 8px;
  }

  header {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .buttons {
    margin-top: 10px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-links {
    align-items: center;
  }

  .footer-contact {
    margin-top: 10px;
  }

  .logo img {
    height: 60px;
  }

  .logo-title {
    font-size: 22px;
  }

  .logo-subtitle {
    font-size: 14px;
  }

  .navbar-links {
    flex-direction: column;
    padding-left: 0;
    gap: 20px;
    align-items: center;
  }
}

/* ✅ 平板尺寸：769px ~ 1024px */
@media (max-width: 1024px) {
  .logo img {
    height: 65px;
  }

  .logo-title {
    font-size: 24px;
  }

  .logo-subtitle {
    font-size: 16px;
  }

  .navbar-links {
    padding-left: 100px;
    gap: 30px;
  }

  .buttons a {
    padding: 5px 10px;
    font-size: 14px;
  }
}

/* ✅ 小筆電尺寸：1025px ~ 1280px */
@media (max-width: 1280px) {
  .navbar-links {
    padding-left: 160px;
    gap: 40px;
  }

  .logo img {
    height: 70px;
  }
}

/* ✅ 超大桌機：大於 1600px */
@media (min-width: 1600px) {
  .navbar-container {
    max-width: 1600px;
    padding: 0 60px;
  }

  .logo img {
    height: 90px;
  }

  .logo-title {
    font-size: 34px;
  }
}

@media (max-width: 480px) {
  .carousel-btn.left {
    left: 6px;
  }

  .carousel-btn.right {
    right: 6px;
  }

  .carousel-slide {
    height: 300px;
  }

  .carousel-slide span {
    font-size: 28px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@media (max-width: 1024px) {
  .carousel-btn.left {
    left: 10px;
  }

  .carousel-btn.right {
    right: 10px;
  }

  .single-card-carousel {
    padding: 0 20px;
  }
}