/* ========================================================
   pages/faq.css — FAQ 목록 (FO-CON-01-06-001) — 프리픽스: faq-
   좌측: 카테고리 탭 + 검색 / 우측: 아코디언 + 페이지네이션
   ======================================================== */

/* 타이틀 영역은 공통 컴포넌트 .page-head (영문 타이틀 .page-head__title--eng) 사용.
   고정 GNB 여백은 .page-head 의 padding-top(120)이 겸한다 (GNB 오버레이). */

/* ── 본문 (사이드 + 리스트) ── */
/* padding-bottom 50rem = 스티키 컨테이너(본문 콘텐츠 박스) 하단 = footer 50rem 위.
   원래 디자인의 본문↔footer 간격(240)은 list-wrap 하단 패딩으로 유지. */
.faq__body {
  display: flex;
  align-items: flex-start;
  gap: 80rem;
  padding: 0 var(--side-padding) 50rem;
}

/* 사이드바 — 네이티브 스티키(지연 없음)
   상단 120rem = 고정 GNB 높이 (헤더가 스크롤 다운 시 숨겨져 별도 간격 불필요)
   하단은 본문 콘텐츠 박스 끝(footer 50rem 위)에서 멈춤 */
.faq__aside {
  display: flex;
  flex-direction: column;
  gap: 48rem;
  flex-shrink: 0;
  align-self: flex-start;
  width: 370rem;
  position: sticky;
  top: 120rem;
}
.faq__aside-line {
  width: 100%;
  height: 1px;
  background: var(--color-line-medium);
}

/* 카테고리 탭 */
.faq-nav {
  display: flex;
  flex-direction: column;
  gap: 20rem;
}
.faq-nav__item {
  font-family: var(--font-family-kor);
  font-size: var(--kor-h7); /* 20 */
  font-weight: var(--font-weight-semibold);
  line-height: 1.36;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-default-low);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s var(--ease-out-cubic);
}
.faq-nav__item--active {
  color: var(--color-neutral-black);
}
.faq-nav__item:hover,
.faq-nav__item:focus-visible {
  color: var(--color-text-default-highest);
}

/* 리스트 래퍼 */
.faq__list-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48rem;
  flex: 1;
  min-width: 0;
  /* 본문↔footer 디자인 간격(240) 유지: 본문 padding 50 + 여기 190 = 240 */
  padding-bottom: 190rem;
}

/* ── 아코디언 ── */
.faq-accordion {
  width: 100%;
  border-top: 1px solid var(--color-line-medium);
}
.faq-item {
  border-bottom: 1px solid var(--color-line-medium);
  transition: background-color 0.25s var(--ease-out-cubic),
    border-color 0.25s var(--ease-out-cubic);
}
/* 열림 — 연한 블루 배경 + 하단 다크 라인 */
.faq-item.is-open {
  background: var(--color-bg-secondary-light-level-1); /* #f6fafe */
  border-bottom-color: var(--color-line-highest); /* #1a1a1a */
}

/* 질문 행 (클릭 토글) */
.faq-item__q {
  display: flex;
  align-items: center;
  gap: 24rem;
  width: 100%;
  padding: 40rem 24rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: padding-bottom 0.3s var(--ease-out-cubic);
}
/* 열림 — 질문↔답변 간격 24 (질문 하단 24 + 답변 inner 상단 0) */
.faq-item.is-open .faq-item__q {
  padding-bottom: 24rem;
}
.faq-item__cat {
  flex-shrink: 0;
  width: 126rem;
  font-family: var(--font-family-kor);
  font-size: var(--kor-b3); /* 20 */
  font-weight: var(--font-weight-semibold);
  line-height: 1.6;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-default-highest);
}
.faq-item__question {
  flex: 1;
  min-width: 0;
  font-family: var(--font-family-kor);
  font-size: var(--kor-b3); /* 20 */
  font-weight: var(--font-weight-semibold);
  line-height: 1.6;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-default-highest);
}
.faq-item__icon {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  width: 126rem;
}
.faq-item__icon::after {
  content: "";
  width: 20rem;
  height: 20rem;
  background: url("../../images/ico-accordion-arrow.svg") center / contain no-repeat;
  transition: transform 0.3s var(--ease-out-cubic);
}
.faq-item.is-open .faq-item__icon::after {
  transform: rotate(180deg);
}

/* 답변 패널 — 질문과 좌측 정렬(카테고리 126 + gap 24 + px 24)
   ※ 열고 닫힘은 faq.js 의 jQuery slideDown/slideUp 이 제어(display/height 애니메이션) */
.faq-item__a {
  display: none;
  overflow: hidden; /* 슬라이드 중 내용 클리핑 (padding 은 inner 가 가짐 → 순수 높이 애니메이션) */
}
/* 답변 내용 래퍼 — 좌측 정렬(카테고리 126 + gap 24 + px 24 = 174) */
.faq-item__a-inner {
  padding: 0 24rem 40rem 174rem;
  font-family: var(--font-family-kor);
  font-size: var(--kor-b3); /* 20 */
  font-weight: var(--font-weight-medium);
  line-height: 1.6;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-default-highest);
}

/* 검색/필터 결과 없음 — 공통 .empty 컴포넌트 사용 (.faq-empty 는 JS 훅) */

/* ========================================================
   반응형 — 1024 이하
   ======================================================== */
@media (max-width: 1024px) {
  /* 타이틀 영역(.page-head)의 모바일 여백은 components.css 공통 처리 */
  .faq__body {
    flex-direction: column;
    gap: 40rem;
    padding: 0 var(--side-padding) 120rem;
  }
  /* 모바일 — 사이드바 상단 스택(스티키 해제) */
  .faq__aside {
    width: 100%;
    gap: 24rem;
    position: static;
    top: auto;
  }
  .faq__list-wrap {
    width: 100%; /* 세로 스택(column) + align-items:flex-start 라 폭이 안 잡힘 → 빈 상태(.empty)가 반폭 되는 것 방지 */
    padding-bottom: 0;
  }
  /* 카테고리 — 가로 탭 (아이템 축소·내부 줄바꿈 방지, 넘치면 스크롤) */
  .faq-nav {
    flex-direction: row;
    gap: 24rem;
    overflow-x: auto;
  }
  .faq-nav__item {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 아코디언 — 카테고리 라벨을 질문 위로 + 좌우여백(질문/답변 공통 20, 우측은 아이콘 공간 확보) */
  .faq-item__q {
    position: relative;
    flex-wrap: wrap;
    gap: 8rem;
    padding: 24rem 48rem 24rem 20rem;
  }
  .faq-item__cat {
    width: auto;
    flex-basis: 100%;
    font-size: var(--kor-b6); /* 14 */
    color: var(--color-text-default-low);
  }
  .faq-item__question {
    flex-basis: 100%;
    font-size: var(--kor-b4); /* 18 */
  }
  .faq-item__icon {
    position: absolute;
    top: 24rem;
    right: 20rem; /* 좌우여백만큼 우측에서 띄움 */
    width: auto;
  }
  /* 답변 — 모바일: 좌측 들여쓰기(174) 제거해 질문과 좌측 정렬 + 폰트 축소(질문과 통일) */
  .faq-item__a-inner {
    padding: 0 20rem 24rem 20rem; /* 질문과 동일한 좌우여백 20 */
    font-size: var(--kor-b4); /* 18 */
  }
}
