/*
 * 產品型號與規格：slider 按鈕群 + 蓋版 QA modal
 *
 * 【為何獨立成一支 CSS 而不併入 main.scss】
 * 本資料夾沒有 SCSS build 工具（main.css 是外包端用 Dreamweaver 編譯的，
 * 專案內沒有 package.json / gulpfile）。重新編譯 main.css 會因編譯器版本差異
 * 產生大量非預期 diff，風險高於收益，因此這支手寫純 CSS 獨立維護。
 * home.html / home_cn.html / home_en.html 皆需 <link> 本檔。
 *
 * 命名刻意避開 .popup-div：main.css 有 `.body-popup-active .popup-div { display: flex }`，
 * 只要沿用該 class，開啟聯絡我們 popup 時會連帶把本 modal 一起顯示出來。
 *
 * 配色取自頁面既有規範：
 *   #FCB32A 主視覺黃（頁面全部 hover 態）
 *   #36464E 內文深色
 *   #153373 標題深藍（abstracts/_define.scss 的 $primary01）
 */

/* ================================================================== *
 * 觸發按鈕群（渲染於每張 slide 的 .info 最底下）
 * ================================================================== */

.qa-btns {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 沒有對應資料時不留下空白間距 */
.qa-btns:empty {
  display: none;
}

.qa-btn {
  min-height: 48px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px; /* 全圓角 pill */
  background-color: #FCB32A;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  transition: 0.5s ease; /* 對齊 abstracts/_global.scss 的全站 transition */
}

.qa-btn:hover,
.qa-btn:focus-visible {
  background-color: #36464E;
}

/* ================================================================== *
 * 蓋版 modal
 * ================================================================== */

.body-qa-active {
  overflow: hidden;
}

.qa-modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 120; /* 高於 header(88) / .overlap(98) / .popup-div(99) / .toggle-btn(100) */
}

.qa-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qa-modal__backdrop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(51, 51, 51, 0.7);
  cursor: pointer;
}

.qa-modal__box {
  position: relative;
  width: 1100px;
  max-width: calc(100% - 80px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 76px 30px 30px;
  border-radius: 16px;
  background-color: #F4F5F7;
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.15);
}

.qa-modal__close {
  position: absolute;
  right: 24px;
  top: 22px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-image: url(./../images/icon_close.svg);
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: 0.5s ease;
}

.qa-modal__close:hover {
  opacity: 0.6;
}

.qa-modal__body {
  overflow: hidden;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.qa-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 4px; /* 讓卡片陰影不被裁掉 */
}

/* ================================================================== *
 * QA 項目（手風琴）
 * ================================================================== */

.qa-item {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.qa-item:last-child {
  margin-bottom: 0;
}

.qa-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  border: 0;
  background-color: transparent;
  text-align: left;
  cursor: pointer;
}

.qa-item__arrow {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #E4E9F2;
  position: relative;
  transition: 0.3s ease;
}

/* 圓形徽章內的三角形 */
.qa-item__arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: -2px 0 0 -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6E7F9E;
}

.qa-item.is-open .qa-item__arrow {
  background-color: #C9D6EA;
  transform: rotate(180deg);
}

.qa-item__title {
  color: #153373;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.qa-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.qa-item.is-open .qa-item__a {
  max-height: 1200px;
}

.qa-item__a-inner {
  padding: 0 28px 26px 70px; /* 左側對齊標題文字（箭頭 26px + gap 16px + padding 28px） */
  color: #36464E;
}

/* ------------------------------------------------------------------ *
 * 展開後的內容區塊
 * ------------------------------------------------------------------ */

.qa-section + .qa-section {
  margin-top: 24px;
}

.qa-section__label {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

/* 分隔線符號放在樣式而非資料，i18n 字串才能維持乾淨 */
.qa-section__label::after {
  content: " ｜";
}

.qa-section__line {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

.qa-section__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qa-section__list li {
  position: relative;
  padding-left: 18px;
  font-size: 16px;
  line-height: 1.7;
}

.qa-section__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #36464E;
}

/* ================================================================== *
 * 響應式（沿用頁面既有斷點）
 * ================================================================== */

@media all and (max-width: 1100px) {
  .qa-modal__box {
    max-width: calc(100% - 40px);
    padding: 68px 20px 20px;
  }

  .qa-item__q {
    padding: 18px 20px;
    gap: 12px;
  }

  .qa-item__a-inner {
    padding: 0 20px 22px 58px;
  }
}

@media all and (max-width: 640px) {
  .qa-btns {
    margin-top: 24px;
    gap: 10px;
  }

  .qa-btn {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
  }

  .qa-modal__box {
    max-width: calc(100% - 24px);
    max-height: 88vh;
    padding: 60px 14px 14px;
    border-radius: 12px;
  }

  .qa-modal__close {
    right: 12px;
    top: 12px;
    width: 32px;
    height: 32px;
    background-size: 24px;
  }

  .qa-item__q {
    padding: 16px;
    gap: 10px;
    align-items: flex-start;
  }

  .qa-item__arrow {
    margin-top: 2px;
  }

  .qa-item__title {
    font-size: 16px;
  }

  .qa-item__a-inner {
    padding: 0 16px 18px 42px;
  }

  .qa-section__label,
  .qa-section__line,
  .qa-section__list li {
    font-size: 14px;
  }
}
