/* ============================================
   組件：常見問題 FAQ（faq）
   Locofy 匯出轉寫；原生 details/summary 手風琴 + RWD。全站載入。BEM 前綴：.faq-
   ============================================ */

.faq {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* 標頭已抽為共用 .comp-header（components/shared.css）。 */
.faq__empty {
  margin: 0;
  padding: 32px 0;
  font-size: 16px;
  color: #999;
}

.faq__list {
  width: 100%;
  max-width: 1068px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* 單一 FAQ：問題列白卡 + Q badge（左上突出） + 答案展開 */
.faq-item {
  position: relative;
  padding-left: 28px; /* 容納左側 Q badge 突出 */
}
.faq-item__q {
  position: relative;
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 56px 0 40px;
  box-sizing: border-box;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 0 21.52px rgba(0, 0, 0, 0.25);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); /* 24px */
  font-weight: 500;
  color: #000;
}
.faq-item__q::-webkit-details-marker {
  display: none;
}
/* Q badge：左上、對話泡泡形（背景圖走偽元素）+ 白字 Q 編號 */
.faq-item__badge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -28px;
  margin: auto 0; /* 垂直置中於問題列 */
  z-index: 2; /* 泡泡浮在問題卡之上 */
  width: 49px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #fff;
  font-size: 20px;
  padding-left: 6px;
  font-weight: 700;
  font-style: italic; /* 設計稿 Q1 為斜體 */
}
/* 泡泡底圖：設計稿 SVG（49×44，含右側小尾巴）；badge 自身 z-index 已建立堆疊脈絡，
   故 ::before z-index:-1 墊在編號文字後方、但整顆 badge 仍浮在卡片之上 */
.faq-item__badge::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../../images/components/faq/faq-item__badge-icon.svg")
    center / contain no-repeat;
}
.faq-item__q-text {
  flex: 1;
  color: #5a3b1f;
}
/* 展開 toggle（+ → ×），漸層字 */
.faq-item__toggle {
  position: absolute;
  right: 20px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transform: skewX(-8deg) rotate(0deg); /* 十字轉 45° 成斜的（×） */
}
.faq-item__toggle::before,
.faq-item__toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: linear-gradient(180.23deg, #41220e, #ab7a44);
}
.faq-item__toggle::before {
  width: 100%;
  height: 3px;
}
.faq-item__toggle::after {
  width: 3px;
  height: 100%;
  transition: transform 0.2s ease;
}
.faq-item[open] .faq-item__toggle::after {
  transform: scaleY(0); /* 展開時 + → − */
}
/* 答案 */
.faq-item__a {
  padding: 18px 40px 4px;
  font-size: 16px;
  line-height: 1.7;
  color: #000;
}
.faq-item__a p {
  margin: 0 0 8px;
}

/* ===== RWD ===== */
@media (max-width: 640px) {
  /* 手風琴：列間距縮、問題 14px、答案 13px/22、badge 縮小 */
  .faq {
    gap: 20px;
  }
  .faq__list {
    gap: 24px;
  }
  .faq-item {
    padding-left: 20px;
  }
  .faq-item__q {
    min-height: 24px;
    gap: 10px;
    padding: 4px 36px 4px 28px;
    font-size: 14px;
    border-radius: 8px;
  }
  /* Q badge 縮到 40×36、字 15，垂直置中於問題列 */
  .faq-item__badge {
    left: -20px;
    width: 40px;
    height: 36px;
    font-size: 15px;
  }
  .faq-item__toggle {
    right: 14px;
    width: 14px;
    height: 14px;
  }
  .faq-item__a {
    padding: 12px 14px 4px;
    font-size: 13px;
    line-height: 22px;
  }
}
