/* components.css — 組件包共用樣式：收合 Header、FAQ 等 */

/* ==================== 收合 Header（case-studies / reviews / faq 共用） ==================== */
.tc-collapsible {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tc-collapsible__header {
  width: 100%;
  max-width: 1160px;
  min-height: 44px;
  background-color: #fff;
  border: 1px solid #0b2f53;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  color: #0b2f53;
  position: relative;
}

.tc-collapsible__header::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 22px solid #0b2f53;
}

.tc-collapsible__title {
  margin: 0;
  font-weight: 500;
}

.tc-collapsible__toggle {
  min-height: 30px;
  background-color: #0b2f53;
  color: #fff;
  border: none;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.25);
}

.tc-collapsible__toggle-icon {
  display: inline-block;
  transition: transform 0.25s ease;
  transform: rotate(180deg);
}

.tc-collapsible.is-collapsed .tc-collapsible__toggle-icon {
  transform: rotate(0deg);
}

.tc-collapsible__body {
  width: 100%;
  padding: 32px 0 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 各組件的內容寬度上限 */
.tc-case-studies .tc-collapsible__body > * {
  width: 100%;
  max-width: 1160px;
}
.tc-reviews .tc-collapsible__body > * {
  width: 100%;
  max-width: 1150px;
}
.tc-faq .tc-collapsible__body > * {
  width: 100%;
  max-width: 1068px;
}

.tc-collapsible.is-collapsed .tc-collapsible__body {
  display: none;
}

/* ==================== FAQ ==================== */
.tc-faq {
  padding: 48px 0;
}

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

.tc-faq__item {
  width: 100%;
  position: relative;
}

.tc-faq__question {
  width: 100%;
  min-height: 44px;
  background-color: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 21.52px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px 0 49px;
  box-sizing: border-box;
  cursor: pointer;
  text-align: left;
  color: #000;
}

.tc-faq__tag {
  position: absolute;
  top: 0;
  left: -14px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  background: linear-gradient(0deg, #0b2f53 15%, #1969b9 100%);
  color: #fff;
  font-weight: 700;
  font-style: italic;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  z-index: 1;
}

.tc-faq__tag::after {
  content: "";
  position: absolute;
  right: -6.09px;
  bottom: 0;
  width: 19px;
  height: 11px;
  background-image: url("../../../assets/images/tc-faq__tag-arrow.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.tc-faq__question-text {
  flex: 1;
  min-width: 0;
  line-height: 20px;
  font-size: var(--font-size-xl);
  overflow-wrap: break-word;
  word-break: break-word;
}

.tc-faq__icon {
  font-weight: 700;
  background: linear-gradient(0deg, #0b2f53, #1969b9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  font-size: 20px;
  line-height: 1;
}

.tc-faq__question[aria-expanded="true"] .tc-faq__icon {
  transform: rotate(45deg);
}

.tc-faq__answer {
  width: 100%;
  box-sizing: border-box;
  color: #000;
  overflow-wrap: break-word;
  word-break: break-word;
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.3s ease,
    padding 0.3s ease,
    opacity 0.3s ease;
  padding: 12px 24px 0 49px;
  opacity: 1;
}

.tc-faq__answer > * {
  min-height: 0;
  overflow: hidden;
}

.tc-faq__question[aria-expanded="false"] + .tc-faq__answer {
  grid-template-rows: 0fr;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.tc-faq__empty {
  text-align: center;
  color: #666;
  margin: 0;
}

/* ==================== 平板 (max-width: 1024px) ==================== */
@media (max-width: 1024px) {
  .tc-faq__answer {
    padding-left: 35px;
  }
}

/* ==================== 手機 (max-width: 480px) ==================== */
@media (max-width: 480px) {
  .tc-collapsible__header {
    padding: 0 13.5px 0 34.5px;
    min-height: 31px;
  }

  .tc-collapsible__toggle {
    min-height: 22px;
    padding: 1px 15px;
  }

  .tc-collapsible__header::before {
    left: -4.5px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 18px solid #0b2f53;
  }

  .tc-faq__question-text {
    font-size: 13px;
  }

  .tc-faq .tc-collapsible__body > * {
    max-width: 305px;
  }

  .tc-reviews .tc-collapsible__body > * {
    width: 100%;
    max-width: 1150px;
    font-size: 12px;
  }
}
