/* ==========================================================================
   faq.css — 자주 있는 문의 = 갈림길 진단 지도 + 펼친 답 카드 (B5 · DESIGN 4-17 · S4 · 9-8 · H4)
   - 마크업 = M/parts/faq.html · faq.en.html(T/build_parts.py 생성) · 동작 = js/parts/faq.js
   - 머리 faq- · 공용 부품(.tx-paths 칩 = B2 answer.css · .tx-player = B2 · .tx-btn · .tx-link · .t-h2 = B0)은 주인의 꼴 그대로
   - ≥1024: 왼쪽 5/12 고정(지도 + 「해결이 안 됐나요?」) · 오른쪽 7/12 카드 / ≤1023: 세로 나무 → 카드 → 「해결이 안 됐나요?」(채팅 길 84 비움)
   - 지도 선 3px --ink · 고른 길 4px --accent · 끝역에서 카드 쪽 주황 점선 · 갈래 색 하나 · 숫자 0 · 그라데이션 0
   ========================================================================== */

.faq{ margin-top:var(--section-gap); }
.faq-head{ margin:0 0 32px; }
.faq-head__t{ margin:0; }
.faq-head__sub{ margin:8px 0 0; font-size:17px; font-weight:500; line-height:1.6; color:var(--ink-2); }

/* ── 두 칸 ─────────────────────────────────────────────── */
.faq-grid{
  display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); column-gap:48px; align-items:start;
  --faq-gap:48px;
}
.faq-side{ position:sticky; top:calc(var(--sticky-top) + 24px); }
.faq-cards{ display:grid; gap:20px; min-width:0; }
.faq-tree, .faq-stuck--end{ display:none; }
@media (max-width:1279.98px){ .faq-grid{ column-gap:36px; --faq-gap:36px; } }
/* // 판단: 1024–1279 는 두 칸을 반반 — 5/12 이면 지도 칸이 330~430px 라 갈림 사이 선이 거의 세로로 눌리고 이름이 선에 닿음 */
@media (min-width:1024px) and (max-width:1279.98px){ .faq-grid{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); } }

/* ── 지도(4-17) — y 는 설계값 px · x 는 폭에 따라(faq.js geom() 과 같은 식) ── */
.faq-map{
  position:relative; height:var(--map-h, 420px); container:faqmap / inline-size;
  --startx:26px; --trunkx:96px;
  --lblw:clamp(170px, 38%, 210px);
  --endx:calc(100% - 22px - var(--lblw));
  --brx:calc(var(--trunkx) + (var(--endx) - var(--trunkx)) * .55);
}
.faq-map__svg{ position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.faq-map__ln{ fill:none; stroke:var(--ink); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.faq-map__hot{
  fill:none; stroke:var(--accent); stroke-width:4; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:1 1; stroke-dashoffset:1; vector-effect:non-scaling-stroke;
}

/* 출발역 — 주황 고리 + 점(지금 여기) */
.faq-map__start{ position:absolute; left:var(--startx); top:var(--y); width:0; height:0; }
.faq-map__ring{
  position:absolute; left:-12px; top:-12px; width:24px; height:24px; border-radius:50%;
  border:3px solid var(--accent); background:var(--bg); box-sizing:border-box;
}
.faq-map__ring::after{ content:""; position:absolute; inset:4px; border-radius:50%; background:var(--accent); }
.faq-map__startlbl{
  position:absolute; left:0; top:calc(var(--y) + 18px); max-width:88px;
  font-size:14px; font-weight:750; line-height:1.35; color:var(--ink); word-break:keep-all;
}
@container faqmap (min-width:480px){ .faq-map__startlbl{ max-width:112px; } }

/* 갈림역 — 작은 고리 · 이름은 고리 왼쪽(들어오는 선 위 · 나가는 선과 겹치지 않게 — 판단) */
.faq-map__branch{ position:absolute; left:var(--brx); top:var(--y); width:0; height:0; }
.faq-map__bring{
  position:absolute; left:-8px; top:-8px; width:16px; height:16px; border-radius:50%;
  border:3px solid var(--ink); background:var(--bg); box-sizing:border-box;
}
.faq-map__blbl{
  position:absolute; right:6px; bottom:9px; white-space:nowrap;
  font-size:13px; font-weight:750; line-height:1.3; color:var(--ink-2);
}
.faq-map__branch.is-below .faq-map__blbl{ bottom:auto; top:9px; }
.faq-map__gh{                                                    /* 좁은 지도용 갈림 이름(그 묶음 첫 질문 위) */
  display:none; position:absolute; left:32px; bottom:calc(100% - 4px); white-space:nowrap;
  font-size:13px; font-weight:750; line-height:1.3; color:var(--ink-2);
}
@container faqmap (max-width:439.98px){
  .faq-map__blbl{ display:none; }
  .faq-map__gh{ display:block; }
}

/* 끝역 — 고리 + 질문 글(15/650) + 고르면 카드 쪽 주황 점선(칸 사이 틈까지) */
.faq-map__ends{ position:absolute; inset:0; margin:0; padding:0; list-style:none; pointer-events:none; }
.faq-map__end{
  position:absolute; left:calc(var(--endx) - 11px); right:calc(-1 * var(--faq-gap, 48px)); top:var(--y);
  transform:translateY(-50%); pointer-events:auto;
}
.faq-node{
  display:flex; align-items:center; gap:10px; min-height:44px; color:var(--ink); border-radius:10px;
}
.faq-node__ring{
  flex:none; width:22px; height:22px; border-radius:50%; border:3px solid var(--ink); background:var(--bg); box-sizing:border-box;
  transition:background-color var(--ui-fast) ease-out, border-color var(--ui-fast) ease-out;
}
.faq-node__q{
  flex:0 1 auto; max-width:calc(100% - 32px - var(--faq-gap, 48px) - 14px);
  font-size:15px; font-weight:650; line-height:1.35; letter-spacing:-.01em; word-break:keep-all;
  text-underline-offset:3px;
}
.faq-node__dots{ flex:1 1 14px; min-width:14px; height:0; border-top:3px dotted var(--accent); opacity:0; }
.faq-node:hover .faq-node__q{ text-decoration:underline; }
.faq-node:hover .faq-node__ring{ border-color:var(--accent); }
.faq-map__end.is-sel .faq-node__ring{ background:var(--accent); border-color:var(--accent); }
.faq-map__end.is-sel .faq-node__dots{ opacity:1; }
.faq-node:focus-visible{ outline-offset:2px; }

/* 나라 바뀜(S4) — 걷히는 동안만 보이게(core.css data-kr 숨김보다 앞섬) · 끝나면 faq.js 가 is-leaving 을 뗌 */
html:not([data-country="KR"]) .faq-map .faq-map__end[data-kr].is-leaving{ display:block !important; }
html:not([data-country="KR"]) .faq-map .faq-map__ln[data-kr].is-leaving{ display:inline !important; }
html:not([data-country="KR"]) .faq-cards .faq-card[data-kr].is-leaving{ display:block !important; }

/* ── 답 카드(9-8 원문 · 펼친 채) ─────────────────────────── */
.faq-card{
  position:relative; padding:24px 26px 26px; border-radius:var(--r-card); background:var(--surface); box-shadow:var(--sh-1);
  container:faqcard / inline-size; scroll-margin-top:calc(var(--sticky-top) + 16px);
  transition:box-shadow 150ms ease-out;
}
.faq-card:focus{ outline:none; }                                  /* 끝역 · 나무 줄로 옮겨 온 초점 — 고른 표시는 왼쪽 막대 */
.faq-card::before{
  content:""; position:absolute; left:0; top:18px; bottom:18px; width:4px; border-radius:0 3px 3px 0;
  background:var(--accent); opacity:0; transition:opacity var(--ui-fast) ease-out;
}
.faq-card.is-sel{ box-shadow:var(--sh-2); }
.faq-card.is-sel::before{ opacity:1; }
.faq-card__q{ margin:0 0 12px; font-size:20px; font-weight:750; line-height:1.35; letter-spacing:-.012em; color:var(--ink); }
.faq-card__grid{ display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
.faq-card__main{ min-width:0; }
.faq-card .tx-paths{ margin:0 0 14px; }
.faq-card__a p{ margin:0; font-size:16px; font-weight:450; line-height:1.7; color:var(--ink); word-break:keep-all; }
.faq-quote{ margin:0; padding:2px 0 2px 16px; border-left:3px solid var(--line-2); }
.faq-quote p{ margin:0 0 6px; font-size:16px; font-weight:450; line-height:1.7; color:var(--ink); word-break:keep-all; }
.faq-quote p:last-child{ margin:0; }
.faq-card__cond{ margin:12px 0 0; font-size:14px; font-weight:550; line-height:1.55; color:var(--ink-2); word-break:keep-all; }
.faq-card__guide{ margin:14px 0 0; }
.faq-card__player{ margin:0; max-width:560px; }
/* ≥1024 카드 안 오른쪽 320×180(4-17) — 카드가 그만큼 넓을 때만(좁으면 글 아래 폭 전체 · 판단: 1280 · 1024 의 7/12 칸은 320 + 글 열이 안 들어감) */
@container faqcard (min-width:620px){
  .faq-card.has-player .faq-card__grid{ grid-template-columns:minmax(0,1fr) 320px; column-gap:24px; align-items:start; }
  .faq-card__player{ width:320px; }
}
@media (max-width:1439px){ .faq-card__q{ font-size:19px; } }
@media (max-width:1023.98px){ .faq-card__q{ font-size:18px; } }

/* ── 「해결이 안 됐나요?」 칸(H4 — 지도 아래 한 번 · 폰은 목록 끝) ── */
.faq-stuck{ margin-top:24px; padding:20px 22px 22px; border-radius:var(--r-card); background:var(--bg-2); }
.faq-stuck__t{ margin:0; font-size:17px; font-weight:750; line-height:1.4; color:var(--ink); }
.faq-stuck__b{ margin:6px 0 0; font-size:15px; font-weight:450; line-height:1.6; color:var(--ink-2); word-break:keep-all; }
.faq-stuck__row{ margin:14px 0 0; }

/* ── ≤1023: 세로 나무(목차) · 카드 · 막다른 곳 칸 — 채팅 길(3-8) ── */
@media (max-width:1023.98px){
  .faq-head{ max-width:calc(100% - var(--lane-cut)); }
  .faq-grid{ grid-template-columns:minmax(0,1fr); row-gap:28px; }
  .faq-side{ position:static; }
  .faq-map, .faq-stuck--side{ display:none; }
  .faq-tree{ display:block; max-width:calc(100% - var(--lane-cut)); }
  .faq-cards{ gap:16px; }
  .faq-card{ max-width:calc(100% - var(--lane-cut)); }
  .faq-stuck--end{ display:block; max-width:calc(100% - var(--lane-cut)); margin-top:0; }
}
@media (max-width:600.98px){
  .faq-head__sub{ font-size:16px; }
  .faq-card{ padding:18px 18px 20px; border-radius:16px; }
  .faq-card::before{ top:14px; bottom:14px; }
}

.faq-tree__start{ display:flex; align-items:center; gap:12px; margin:0; font-size:15px; font-weight:750; line-height:1.35; color:var(--ink); }
.faq-tree__sring{
  position:relative; flex:none; width:24px; height:24px; border-radius:50%; border:3px solid var(--accent); background:var(--bg); box-sizing:border-box;
}
.faq-tree__sring::after{ content:""; position:absolute; inset:4px; border-radius:50%; background:var(--accent); }
.faq-tree__groups{ position:relative; margin:6px 0 0 10.5px; padding:4px 0 2px 27px; list-style:none; }
.faq-tree__groups::before{                                       /* 세로 줄기 3px --ink — 마지막 질문 고리 높이에서 끝남(넘침 0) */
  content:""; position:absolute; left:0; top:0; bottom:24px; width:3px; background:var(--ink);
}
.faq-tree__g + .faq-tree__g{ margin-top:10px; }
.faq-tree__gh{ position:relative; margin:0; padding:6px 0 2px; font-size:13px; font-weight:750; line-height:1.3; color:var(--ink-2); }
.faq-tree__gh::before{                                            /* 갈림 = 세로선 위 작은 고리 */
  content:""; position:absolute; left:-33px; top:7px; width:15px; height:15px; border-radius:50%;
  border:3px solid var(--ink); background:var(--bg); box-sizing:border-box;
}
.faq-tree__rows{ margin:0; padding:0; list-style:none; }
.faq-tree__row{
  display:flex; align-items:center; gap:10px; min-height:44px; padding:4px 0;
  font-size:15px; font-weight:650; line-height:1.4; color:var(--ink); word-break:keep-all; border-radius:8px;
}
.faq-tree__ring{ flex:none; width:18px; height:18px; border-radius:50%; border:3px solid var(--ink); background:var(--bg); box-sizing:border-box; }
.faq-tree__row:hover > span:last-child{ text-decoration:underline; text-underline-offset:3px; }
.faq-tree__row.is-sel .faq-tree__ring{ background:var(--accent); border-color:var(--accent); }

/* 「채팅+」 같은 「+」 붙은 낱말은 한 덩어리로(Chrome 은 keep-all 이어도 「+」 앞에서 줄을 바꿈 — 글자는 그대로 · build_parts.nobr) */
.faq-nobr{ white-space:nowrap; }
