/* ── FAQ 섹션 공용 스타일 ─────────────────────────────────────────────────────
 * 사이트별 modifier: .faq-section--light (metahoop, axdxrobot, xrvpstudio) / .faq-section--dark (예비)
 * 아코디언 열림/닫힘은 aria-expanded + hidden 으로 관리(faq_section.html 인라인 JS).
 * 배경·테두리·타이포 등 브랜드 색은 modifier 에서 오버라이드.
 * ───────────────────────────────────────────────────────────────────────────── */

/* ── 공통 ─────────────────────────────────────────────────────────────────── */

.faq-section {
  padding: calc(var(--mha-sec-gap, 120px) / 2) var(--mha-sec-x, 60px);
  scroll-margin-top: calc(var(--header-height, 45px) + 46px);
}

.faq-section__inner {
  max-width: var(--mha-wrap-max, 1450px);
  margin: 0 auto;
}

/* ── 섹션 헤더 (news-head 공유 컴포넌트 — 중앙 정렬 + 토글) ─────────────── */

/* 기본값(flex-end)을 중앙 정렬로 재정의 — 제품 섹션(.mha-products/.axprod-section)과 동일 */
.faq-section .news-head      { justify-content: center; margin-bottom: 48px; }
.faq-section .news-title-box { text-align: center; }
.faq-section .news-line      { margin: 0 auto 18px; }

/* 섹션 제목 타이포 — .uiux-section .news-head .news-title + #uiux-operation .news-title 과 동일 토큰 */
/* 변경 시 design-tokens.css 의 --dt-section-title* 토큰만 수정하면 세 사이트 함께 반영 */
.faq-section .news-head .news-title {
  font-size:      var(--dt-section-title, clamp(32px, 2.5vw, 48px));
  font-weight:    var(--dt-section-title-weight, 700);
  letter-spacing: var(--dt-section-title-tracking, -0.04em);
  line-height:    var(--dt-section-title-leading, 1.1);
  margin:         0;
  word-break:     keep-all;
  overflow-wrap:  break-word;
  text-wrap:      balance;
}

/* collapsed/expanded 상세도 보강 — 전역 (0,1,0)보다 높은 (0,3,0)으로 확실히 적용 */
.faq-section .news-sub.xrv-ov__desc--collapsed { display: none; }
.faq-section .news-sub.xrv-ov__desc--expanded  {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* 더보기/접기 토글 — light: 제품 섹션 녹색, dark: faq-accent 토큰 */
.faq-section          .xrv-ov__desc-toggle { color: #0B8F7A; font-size: .85rem; font-weight: 600; }
.faq-section--dark    .xrv-ov__desc-toggle { color: var(--faq-accent, #0B8F7A); }

/* ── 아코디언 목록 ─────────────────────────────────────────────────────────── */

.faq-section__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: var(--mha-wrap-max, 1450px);  /* .uiux-wrap 과 동일 토큰 */
  margin: 0 auto;
  padding: 0;
}

/* ── FAQ 항목 ──────────────────────────────────────────────────────────────── */

.faq-item {
  border-radius: 20px;                              /* .uiux-layout 과 동일 (이전 14px) */
  overflow: hidden;
  border: 1px solid var(--faq-item-border, rgba(0, 0, 0, 0.07));
  background: var(--faq-item-bg, var(--bg-card, #fff));
  box-shadow: var(--faq-item-shadow,                /* .uiux-layout 과 동일 */
    0 4px 40px rgba(0, 0, 0, 0.08),
    0 1px  4px rgba(0, 0, 0, 0.04));
  transition: box-shadow .18s;
}

.faq-item__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--faq-q-color, inherit);
  text-align: left;
  transition: background .14s;
}

.faq-item__btn:hover,
.faq-item__btn:focus-visible {
  background: var(--faq-btn-hover, rgba(0, 0, 0, .035));
  outline: none;
}

.faq-item__q-text {
  flex: 1;
  /* .uiux-item__title 과 동일 토큰·값 */
  font-family:    var(--font-family);
  font-size:      var(--faq-q-size, clamp(15px, 1.5vw, 20px));
  font-weight:    var(--font-weight-medium);          /* 500 */
  letter-spacing: -0.025em;
  line-height:    1.25;
  word-break:     keep-all;
  overflow-wrap:  break-word;
}

.faq-item__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 300;
  border-radius: 50%;
  background: var(--faq-icon-bg, #f3f4f6);
  color: var(--faq-icon-color, #374151);
  transition: transform .2s, background .15s;
  user-select: none;
}

.faq-item__btn[aria-expanded="true"] .faq-item__icon {
  transform: rotate(45deg);
  background: var(--faq-icon-open-bg, #e5e7eb);
}

.faq-item__ans {
  margin: 0;
  padding: 0 24px 20px;
  font-size: .95rem;
  line-height: 1.75;
  color: var(--faq-a-color, var(--color-text, #374151));
  border-top: 1px solid var(--faq-item-border, rgba(0, 0, 0, 0.07));
}

.faq-item__ans[hidden] { display: none; }

.faq-item__ans-inner {
  padding-top:    16px;
  font-size:      calc(0.6 * 1.9rem); /* 1.14rem ≈ 18.24px — 2배 적용값(1.9rem)의 60% */
  word-break:     keep-all;
  overflow-wrap:  break-word;
}

/* ── 관련 페이지 링크 ─────────────────────────────────────────────────────── */

.faq__more {
  margin: 12px 0 0;
  padding: 0;
}

.faq__link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--faq-link-color, var(--faq-accent, #0ea5a0));
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}

.faq__link:hover,
.faq__link:focus-visible {
  color: var(--faq-link-hover, var(--faq-accent, #0ea5a0));
  border-bottom-color: currentColor;
  outline: none;
}

.faq__link:focus-visible {
  outline: 2px solid var(--faq-accent, #0ea5a0);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Light variant (metahoop) ──────────────────────────────────────────────── */

.faq-section--light {
  background: var(--section-bg-light, #fff);
  border-top: 1px solid var(--mha-lt-border, #e5e7eb);
  --faq-accent:         #0ea5a0;
  /* faq-item 카드 — .uiux-layout 동일 값 (변경 시 .uiux-layout 과 함께 수정) */
  --faq-item-bg:        var(--bg-card, #fff);
  --faq-item-border:    rgba(0, 0, 0, 0.07);
  --faq-item-shadow:    0 4px 40px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  /* faq-q 글자 — .uiux-item__title(metahoop) 동일 */
  --faq-q-size:         clamp(17px, 1.5vw, 22px);
  --faq-q-color:        var(--color-heading, #111);
  --faq-a-color:        var(--color-text, #374151);
  --faq-icon-bg:        #f3f4f6;
  --faq-icon-color:     #374151;
  --faq-icon-open-bg:   #e5e7eb;
  --faq-btn-hover:      rgba(0, 0, 0, .03);
}

/* ── Dark variant (현재 미사용 — 필요 시 faq_site_cls="faq-section--dark" 로 재활성화) ────── */

.faq-section--dark {
  background: #0a0c12;
  border-top: 1px solid rgba(255, 255, 255, .08);
  --faq-accent:         #0B8F7A;
  /* faq-item 카드 — 白 카드를 다크 배경 위에 배치 */
  --faq-item-bg:        var(--bg-card, #fff);
  --faq-item-border:    rgba(0, 0, 0, 0.07);
  --faq-item-shadow:    0 4px 40px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  /* faq-q 글자 */
  --faq-q-size:         clamp(15px, 1.5vw, 20px);
  --faq-q-color:        var(--color-heading, #111);   /* 白 카드 위 어두운 글자 */
  --faq-a-color:        var(--color-sub, #333);
  --faq-icon-bg:        #f3f4f6;
  --faq-icon-color:     #374151;
  --faq-icon-open-bg:   #e5e7eb;
  --faq-btn-hover:      rgba(0, 0, 0, .03);
  /* 링크 — 白 카드 위 대비 확보 (#2dd4bf on #fff ≈ 1.76:1 부족 → #0B8F7A ≈ 3.98:1) */
  --faq-link-color:     #0B8F7A;
  --faq-link-hover:     #076b5a;
}

/* ── 반응형 ───────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .faq-section {
    padding: calc(var(--mha-sec-gap-md, 80px) / 2) var(--mha-sec-x-md, 24px);
  }
  .faq-section .news-head { margin-bottom: 36px; }
  .faq-item__btn          { padding: 16px 18px; font-size: .95rem; }
  .faq-item__ans       { padding: 0 18px 16px; }
}

@media (max-width: 480px) {
  .faq-item__btn  { padding: 14px 14px; font-size: .9rem; }
  .faq-item__icon { width: 24px; height: 24px; font-size: 1.1rem; }
}

/* ── prefers-reduced-motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .faq-item__icon { transition: none; }
  .faq-item       { transition: none; }
}
