/* --- CSS Variables --- */
:root {
  --primary-color: #f15a24; /* 主色 */
  --brand-color: #f7931e; /* 品牌主色 (用於 Hero, 按鈕) */
  --brand-color-dark: #d97910; /* 品牌主色加深 (用於 Hover) */
  --dark-color: #222;
  --text-color: #333;
  --light-gray: #f9f9f9;
  --background-light: #fff5e6;
  --white-color: #fff;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  background: var(--white-color);
  color: var(--text-color);
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* 導覽列 */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent; /* 初始透明 */
  transition: background 0.3s;
  z-index: 1000;
}
nav.scrolled {
  background: var(--dark-color); /* 滾動後變色 */
}
.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
}
.logo {
  font-weight: bold;
  color: var(--white-color);
}

.logo img {
  height: 70px; /* 可依實際大小調整，如 40~70px */
  width: auto;
  display: block;
}

.menu {
  display: flex;
  list-style: none;
}
.menu li a {
  color: var(--white-color);
  padding: 10px 15px;
  text-decoration: none;
  transition: color 0.3s, background 0.3s;
}
.menu li a:hover {
  background: var(--brand-color);
}
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}
.hamburger span {
  height: 3px;
  width: 25px;
  background: var(--white-color);
  margin: 4px 0;
}

/* 首屏 */
#hero {
  background: url("hero-placeholder.jpg") center/cover no-repeat;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white-color);
  background-color: var(--brand-color); /* 確保圖片載入失敗時有背景色 */
}
.hero-content h1 {
  font-size: 2.5rem;
}
.hero-content p {
  margin: 15px 0;
}
.btn-primary {
  background: var(--brand-color);
  color: var(--white-color);
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}
.btn-primary:hover {
  background: var(--brand-color-dark);
}

/* 關於我們 */
.about-section {
  display: flex;
  gap: 20px;
  padding: 30px 0;
  align-items: center;
}
.about-text {
  flex: 1;
  padding: 10px;
}
.about-image {
  flex: 1;
  padding: 10px;
  max-width: 100%;
}
.about-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.service-card {
  background: var(--white-color);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card h3 {
  margin: 15px 0;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.service-img {
  width: 100%;
  max-width: 300px; /* 控制大小 */
  height: auto;
  border-radius: 10px; /* 圓角效果 */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 陰影 */
}

/* 價值觀 */
#values {
  background: var(--background-light);
  padding: 60px 0;
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: center;
}

.value-item {
  transition: transform 0.3s ease;
}

.value-item:hover {
  transform: translateY(-5px);
}
.icon-placeholder {
  margin-bottom: 10px;
  color: var(--primary-color); /* 讓圖示顏色與標題一致 */
}

.icon-placeholder svg {
  width: 48px;
  height: 48px;
  stroke-width: 1.5; /* 調整線條粗細 */
}

/* 聯絡我們 */
.contact-section {
  padding: 60px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.map-placeholder {
  background: #ddd;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 頁尾 */
footer {
  background: var(--brand-color);
  color: var(--white-color);
  padding: 25px 0;
  text-align: center;
}

/* 響應式 */
@media (max-width: 768px) {
  .about-section {
    flex-direction: column;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .hamburger {
    display: flex;
  }
  .menu {
    display: none;
    flex-direction: column;
  }
  .menu.active {
    display: flex;
  }

  nav {
    background: var(--dark-color); /* 深色背景讓 logo/漢堡按鈕顯眼 */
  }
  .hamburger span {
    background: var(--white-color);
  }
}
.map-container {
  width: 100%;
  max-width: 800px; /* 限制最大寬度 */
  margin: auto;
  border-radius: 10px;
  overflow: hidden; /* 讓地圖也有圓角 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#contact {
  padding: 80px 20px;
  background: var(--light-gray);
  text-align: center;
}

/* --- Section Titles --- */
/* 統一所有區塊標題的樣式，增加一致性 */
#about h2,
#services h2,
#values h2,
#contact h2 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 40px;
}

/* 針對需要置中的標題進行設定 */
#services h2,
#values h2,
#contact h2 {
  text-align: center;
}
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
  max-width: 1100px;
  margin: auto;
}

.contact-info {
  text-align: left;
  background: var(--white-color);
  padding: 25px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-info h3 {
  margin-bottom: 20px;
  color: var(--text-color);
}

.contact-info p {
  margin: 12px 0;
  font-size: 1rem;
  color: #555;
}

.contact-info a {
  color: var(--brand-color-dark);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.map-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 響應式 */
@media (max-width: 768px) {
  .contact-container {
    grid-template-columns: 1fr;
  }
}

/* --- Hero Section 改良 --- */
.hero-sustainability {
  position: relative;
  background-color: #f7931e;
  color: white;
  text-align: center;
  padding-top: 120px; /* 避開固定導覽列 */
  padding-bottom: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  padding: 0 20px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-sustainability h1 {
  font-size: 2.6rem;
  margin-bottom: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero-sustainability p {
  font-size: 1.25rem;
  line-height: 1.6;
  opacity: 0.95;
}

/* --- 永續內容區改善 --- */
.sustainability-content {
  max-width: 950px;
  margin: 80px auto;
  padding: 0 30px;
  line-height: 1.9;
  font-size: 1.05rem;
  color: #333;
}

.sustainability-content section {
  margin-bottom: 70px;
  padding-bottom: 40px;
  border-bottom: 1px solid #eee;
}

.sustainability-content h2 {
  color: #f15a24;
  border-left: 6px solid #f7931e;
  padding-left: 12px;
  margin-bottom: 25px;
  font-size: 1.6rem;
}

.sustainability-content h3 {
  color: #222;
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 600;
}

.sustainability-content p {
  margin-top: 10px;
  text-align: justify;
  color: #444;
}

/* --- 響應式 --- */
@media (max-width: 768px) {
  .hero-sustainability {
    padding-top: 100px;
    padding-bottom: 80px;
  }
  .hero-sustainability h1 {
    font-size: 2rem;
  }
  .hero-sustainability p {
    font-size: 1rem;
  }
  .sustainability-content {
    padding: 0 18px;
    font-size: 0.95rem;
  }
}

/* --- 服務卡片連結按鈕樣式 (空心) --- */
.service-link {
  /* 1. 外觀設定 */
  display: inline-block;
  padding: 8px 18px; /* 內邊距可以稍小一點 */
  margin-top: 15px;
  border: 2px solid #007bff; /* 邊框 (請換成您的品牌主色) */
  color: #007bff; /* 文字顏色 (同品牌主色) */
  background-color: transparent; /* 背景透明 */
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;

  /* 2. 過渡效果 */
  transition: all 0.3s ease;

  /* 3. 滑鼠指標 */
  cursor: pointer;
}

/* 3. 滑鼠懸停 (Hover) 效果 */
.service-link:hover {
  background-color: #007bff; /* 滑鼠移上去時，背景填滿 */
  color: #ffffff; /* 文字變白色 */
}

/* --- 總經理簽名區塊 (永續頁面) --- */
.signature-block {
  display: flex; /* 啟用 Flexbox */
  justify-content: space-between; /* 讓文字和圖片組水平拉開 */
  align-items: flex-end; /* 讓兩者的「底部」對齊 */

  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--light-gray, #eee);
}

.signature-block .final-quote {
  flex: 1; /* 讓文字區塊自動填滿左側 */
  margin: 0;
  text-align: justify;
  color: var(--text-color, #444);
  font-size: 1.1rem;
  font-weight: 600;
  padding-right: 25px; /* 避免文字和圖片黏在一起 */
}

/* 這是新的圖片組容器 */
.signature-image-group {
  display: flex;
  flex-direction: column; /* 讓圖片「垂直堆疊」 */
  align-items: center; /* 讓兩張圖片彼此置中對齊 */
  flex-shrink: 0;
  margin-left: 20px;
}

/* --- 總經理簽名區塊 (永續頁面) --- */
.signature-block {
  display: flex; /* 啟用 Flexbox */
  justify-content: space-between; /* 讓文字和圖片組水平拉開 */
  align-items: flex-end; /* 讓兩者的「底部」對齊 */

  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--light-gray, #eee);
}

.signature-block .final-quote {
  flex: 1; /* 讓文字區塊自動填滿左側 */
  margin: 0;
  text-align: justify;
  color: var(--text-color, #444);
  font-size: 1.1rem;
  font-weight: 600;
  padding-right: 25px; /* 避免文字和圖片黏在一起 */
}

/* 這是新的圖片組容器 (Desktop) */
.signature-image-group {
  display: flex;
  flex-direction: row; /* 1. 改為「水平排列」 */
  align-items: flex-end; /* 2. 讓兩張圖的底部對齊 */
  flex-shrink: 0;
  margin-left: 20px;
}

/* 公司印章圖檔 (Desktop) */
.signature-image-group .company-seal {
  /* 3. 設定印章尺寸 (3x3 比例) */
  height: 80px;
  width: 80px;
  display: block;
  margin-right: 20px; /* 4. 印章和簽名之間的間距 */
}

/* 總經理簽名圖檔 (Desktop) */
.signature-image-group .gm-signature {
  /* 5. 簽名高度為印章一半 (1.5) */
  height: 40px; /* (80px / 2 = 40px) */
  width: auto;
  display: block;
}

/* --- 響應式：當螢幕寬度小於 768px 時 --- */
@media (max-width: 768px) {
  .signature-block {
    flex-direction: column; /* (手機) 讓文字和圖片組改為「垂直堆疊」 */
    align-items: flex-start;
  }

  .signature-block .final-quote {
    padding-right: 0; /* 垂直堆疊時，不需要右邊距 */
  }

  /* (手機) 圖片組的設定 */
  .signature-image-group {
    margin-left: 0; /* 移除左邊距 */
    margin-top: 30px; /* 增加和上方文字的間距 */
    align-self: flex-end; /* (關鍵) 讓整組圖片靠到最右邊 */
  }

  /* (Mobile) 印章尺寸 (維持 1:1) */
  .signature-image-group .company-seal {
    height: 60px;
    width: 60px;
    margin-right: 15px; /* (手機) 水平間距 */
  }

  /* (Mobile) 簽名尺寸 (維持印章一半) */
  .signature-image-group .gm-signature {
    height: 30px; /* (60px / 2 = 30px) */
  }
}
