/* =========================================================================
   API 투자전략센터 — FAQ
   hero search · category tab filter · accordion list · answer prose/code
   ========================================================================= */

/* ---------- hero — 제목만 둔다(검색·카테고리는 .faq-toolbar 로 내렸다) ---------- */
.faq-hero { padding-top: 113px; padding-bottom: 0px; }

/* ---------- toolbar — 테두리 카드 안에 [가운데 밑줄 검색] + [카테고리 탭] ---------- */
.faq-toolbar { border: 1px solid rgba(117,120,125,0.28); border-radius: var(--r-lg); background: var(--surface); padding: 20px; }
.faq-toolbar__search { display: flex; justify-content: center; width: 100%; padding: 20px 20px 6px; }
.faq-toolbar__search-line { position: relative; width: 100%; max-width: 640px; border-bottom: 1px solid var(--border-strong); padding: 9px 44px 9px 0; }
.faq-toolbar__search-line input { width: 100%; background: none; border: none; outline: none; color: var(--text); font-size: var(--fs-input); line-height: var(--lh-input); text-align: center; font-family: var(--font-sans); }
.faq-toolbar__search-line input::placeholder { color: var(--text-dim); transition: opacity 0.15s; }
.faq-toolbar__search-line input:focus::placeholder { opacity: 0; }
/* 지우기 버튼은 입력값이 있을 때만 뜬다(.show 는 Alpine 이 붙인다) */
.faq-toolbar__clear { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; color: var(--text-dim); transition: color 0.18s, background-color 0.18s; }
.faq-toolbar__clear.show { display: grid; }
.faq-toolbar__clear:hover { color: var(--text); background: var(--surface-2); }
.faq-toolbar__clear svg { width: 15px; height: 15px; }
.faq-toolbar__btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-dim); }
.faq-toolbar__btn svg { width: 19px; height: 19px; }

/* ---------- body ---------- */
.faq-section { padding-block: clamp(28px, 3.5vw, 40px) var(--space-section); }

/* category tabs (horizontal scroll) */
/* 카테고리 탭 — 툴바 카드 안, 가운데 정렬 pill. 검색 입력이 가운데 정렬이라 축을 맞춘다.
   모양·활성색은 공용 .tab(base.css) 이 준다(밑줄형이 아니라 pill 이다).
   개수가 많아 한 줄을 넘기므로 가로 스크롤 대신 wrap 으로 접는다. */
.faq-tabs { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

.faq-count-row { padding: 16px 2px 6px; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-dim); }
.faq-count-row b { color: var(--text); font-family: var(--font-sans); }

/* ---------- accordion list ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.faq-row { border: 1px solid rgba(117,120,125,0.28); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; transition: border-color 0.25s; }
.faq-row:hover { border-color: var(--border-strong); }
.faq-row.open { border-color: var(--border-glow); }
.faq-row__q { width: 100%; display: flex; align-items: center; gap: 16px; padding: 20px 22px; text-align: left; }
.faq-row__cat { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; flex-shrink: 0; letter-spacing: -0.01em; background: var(--chip-bg); color: var(--chip-text); border: 1px solid var(--chip-border); }
.faq-row__mark { font-family: var(--font-sans); font-weight: 800; font-size: var(--fs-text-md); line-height: var(--lh-text-md); flex-shrink: 0; width: 19px; text-align: center; }
.faq-row__mark--q { color: var(--text-accent); }
:root[data-theme="light"] .faq-row__mark--q { color: #2250e3; }
.faq-row__mark--a { color: var(--color-rose); }
.faq-row__text { flex: 1; min-width: 0; font-size: var(--fs-text-md); font-weight: 600; color: var(--text); line-height: var(--lh-text-md); letter-spacing: -0.01em; }
.faq-row__chev { width: 22px; height: 22px; color: var(--text-dim); flex-shrink: 0; transition: transform 0.3s var(--ease), color 0.2s; }
.faq-row.open .faq-row__chev { transform: rotate(180deg); color: #50aaff; }

.faq-row__a { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease); }
.faq-row.open .faq-row__a { max-height: 1400px; }
.faq-row__a-inner { display: flex; align-items: flex-start; gap: 20px; padding: 0 22px 24px 22px; border-top: 1px solid transparent; }
.faq-row__a-body { flex: 1; min-width: 0; }
.faq-row.open .faq-row__a-inner { border-top-color: rgba(117,120,125,0.28); padding-top: 20px; }

.faq-row__a p { color: var(--text-2); line-height: var(--lh-text-md); margin-bottom: 14px; font-size: var(--fs-text-md); }
.faq-row__a p:last-child { margin-bottom: 0; }
.faq-row__a strong { color: var(--text); font-weight: 700; }
.faq-row__a code { font-family: var(--font-mono); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--chip-text); background: var(--chip-bg); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--chip-border); }
.faq-row__a ul { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 16px; }
.faq-row__a ul li { position: relative; padding-left: 20px; color: var(--text-2); line-height: var(--lh-text-md); font-size: var(--fs-text-md); }
.faq-row__a ul li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); box-shadow: 0 0 8px var(--glow-cyan); }
.faq-row__a .codeblock { margin: 14px 0; }
.faq-row .hl { background: rgba(52,225,255,0.26); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* empty state */
.faq-empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.faq-empty svg { width: 46px; height: 46px; color: var(--text-inactive); margin: 0 auto 16px; }
.faq-empty p { font-size: var(--fs-text-md); line-height: var(--lh-text-md); }
.faq-empty b { color: var(--text); }

/* still-need-help cta */
.faq-help { position: relative; overflow: hidden; margin-top: 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; border-radius: var(--r-lg); border: 1px solid rgba(49,75,204,0.2); background: linear-gradient(135deg, rgba(66,92,224,0.35), rgba(66,92,224,0)), #101571; }
/* 카드 위에 얹는 격자 오버레이 — 좌상단에서 밝고 우하단으로 사라진다 */
.faq-help__grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 40px 40px; -webkit-mask-image: radial-gradient(100% 100% at 15% 0%, #000, transparent 70%); mask-image: radial-gradient(100% 100% at 15% 0%, #000, transparent 70%); }
.faq-help__tx { position: relative; z-index: 1; }
.faq-help__tx h4 { font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); font-weight: 700; margin-bottom: 5px; color: #ffffff; }
.faq-help__tx p { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: rgba(255,255,255,0.75); margin: 0; }
.faq-help__btns { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.faq-help__cta { display: inline-flex; align-items: center; gap: 6px; padding: 11px 22px; border-radius: var(--r-pill); background: #ffffff; color: #000000; font-weight: 700; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); transition: transform 0.2s var(--ease); }
.faq-help__cta:hover { transform: translateY(-1px); }
.faq-help__cta-ic { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 640px) {
  .faq-hero { padding-top: 93px; }
  /* 좁은 화면에서는 카드가 한 줄로 서고 CTA 는 화살표 아이콘만 남는다 */
  .faq-help { flex-wrap: nowrap; align-items: center; padding: 20px 15px 20px 20px; gap: 10px; }
  .faq-help__tx { flex: 1 1 0%; min-width: 0; }
  .faq-help__tx h4 { font-size: var(--fs-text-md); line-height: var(--lh-text-md); }
  .faq-help__tx p { font-size: 0.8rem; line-height: 1.4; }
  .faq-help__btns { flex-shrink: 0; }
  .faq-help__cta { background: none; border: none; box-shadow: none; padding: 0; flex-shrink: 0; }
  .faq-help__cta:hover { transform: none; }
  .faq-help__cta-label { display: none; }
  .faq-help__cta-ic { width: 27px; height: 27px; color: #fff; }
  .faq-row__cat { display: none; }
  .faq-row__mark--a { display: none; }
  .faq-row__a-inner { padding-left: 49px; }
  .faq-row__q { padding: 18px; gap: 12px; }
}
