/* =========================================================
   FAQ — 자주 묻는 질문 (메인 index.html)
   - 왼쪽: 제목 + 짧은 안내 + 문의 메일 링크 (데스크톱은 스크롤 중 제자리에 머묾)
   - 오른쪽: 얇은 구분선 리스트. 번호(01–04) · 질문 · 원형 + 아이콘
   - 펼치면: + → × (45° 회전, 코발트 원), 번호 코발트, 아래 구분선이 코발트로 차오름
   - 높이 모션은 motion.js(FAQ 아코디언)가 담당. JS·동작 줄이기 없으면 그냥 열리고 닫힘
   색은 light.css 토큰만 쓴다 (다크 모드는 토큰이 금빛으로 바뀜).
   ========================================================= */
.faq { --faq-line: rgba(25, 31, 40, .12); --faq-line-strong: var(--ink); }
:root[data-theme="dark"] .faq { --faq-line: rgba(244, 235, 220, .14); --faq-line-strong: rgba(244, 235, 220, .55); }

.faq-grid { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .faq-grid { grid-template-columns: 4fr 8fr; gap: 48px; align-items: start; }
  .faq-head { position: sticky; top: calc(var(--hdr, var(--header-h)) + 40px); }
}

/* ---- 왼쪽: 제목 · 안내 · 메일 ---- */
.faq-note { margin-top: 16px; max-width: 20em; font-size: 17px; color: var(--ink-2); word-break: keep-all; text-wrap: pretty; }
/* 첫 줄: "문의 메일 →", 둘째 줄: 주소 (span은 display: contents로 격자에 바로 놓임) */
.faq-mail {
  display: inline-grid; grid-template-columns: auto 1fr; justify-items: start; align-items: center;
  column-gap: 8px; row-gap: 2px; margin-top: 24px; min-height: 44px; line-height: 1.4;
  color: var(--brand); font-weight: 600; font-size: 17px; text-decoration: none; transition: color .2s;
}
.faq-mail > span { display: contents; }
.faq-mail small { grid-column: 1 / -1; grid-row: 2; font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.faq-mail small:empty { display: none; }
.faq-mail svg { grid-column: 2; grid-row: 1; width: 18px; height: 18px; transition: transform .35s var(--ease); }
.faq-mail:hover { color: var(--brand-ink); }
.faq-mail:hover svg { transform: translateX(4px); }

/* ---- 오른쪽: 구분선 리스트 ---- */
.faq-list { border-top: 1px solid var(--faq-line-strong); }
.faq-item { position: relative; border-bottom: 1px solid var(--faq-line); }
/* 펼친 항목: 아래 구분선 위로 코발트 선이 왼쪽에서 차오름 */
.faq-item::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--brand); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .6s var(--ease);
}
.faq-item[open]:not(.is-closing)::after { transform: scaleX(1); }

.faq-item summary {
  list-style: none; cursor: pointer; position: relative;
  display: grid; grid-template-columns: 48px 1fr 36px; align-items: start; gap: 16px;
  padding: 28px 0; border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary:focus-visible { outline-offset: 2px; }

.faq-n {
  font-size: 14px; line-height: 27.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em; transition: color .3s;
}
.faq-q {
  font-size: 19px; font-weight: 600; line-height: 1.45; letter-spacing: -0.02em; color: var(--ink);
  word-break: keep-all; text-wrap: pretty; transition: color .2s;
}

/* + / × 아이콘: 얇은 원 + 막대 두 개, 열리면 45° 돌아 × */
.faq-ico {
  position: relative; width: 36px; height: 36px; margin-top: -4.25px; border-radius: 50%; justify-self: end;   /* 질문 첫 줄 가운데 */
  box-shadow: inset 0 0 0 1px var(--faq-line);
  transition: background-color .3s, box-shadow .3s, transform .5s var(--ease);
}
.faq-ico::before, .faq-ico::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -0.75px 0 0 -6px;
  border-radius: 1px; background: var(--ink-2); transition: background-color .3s;
}
.faq-ico::after { transform: rotate(90deg); }

@media (hover: hover) {
  .faq-item summary:hover .faq-q { color: var(--brand); }
  .faq-item summary:hover .faq-ico { box-shadow: inset 0 0 0 1px var(--brand); }
  .faq-item summary:hover .faq-ico::before, .faq-item summary:hover .faq-ico::after { background: var(--brand); }
}
.faq-item[open]:not(.is-closing) .faq-n { color: var(--brand); }
.faq-item[open]:not(.is-closing) .faq-ico { transform: rotate(45deg); background: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.faq-item[open]:not(.is-closing) .faq-ico::before,
.faq-item[open]:not(.is-closing) .faq-ico::after { background: var(--brand-on); }

/* 답: 질문 글자와 같은 왼쪽 선 (번호 칸 + 간격) */
.faq-a { overflow: hidden; }
.faq-a p {
  padding: 0 52px 32px 64px; max-width: calc(36em + 116px);
  font-size: 17px; line-height: 1.75; color: var(--ink-2); word-break: keep-all;
}
.faq-a a { color: var(--brand); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.faq-a a:hover { color: var(--brand-ink); }

/* ---- 휴대폰 (2026-11-16 다듬기: 제목 26 · 질문 16 · 답·안내 15 px, 위아래 여백 72 px) ---- */
@media (max-width: 767px) {
  .faq.sec { padding-block: 72px 80px; }
  .faq-grid { gap: 32px; }
  .faq-head .h2 { font-size: 26px; line-height: 1.3; }
  .faq-note { margin-top: 12px; font-size: 15px; line-height: 1.6; text-wrap: balance; }
  .faq-mail { margin-top: 16px; font-size: 16px; }
  .faq-mail small { font-size: 14px; }
  .faq-item summary { grid-template-columns: 24px 1fr 32px; gap: 12px; padding: 20px 0; }
  .faq-n { font-size: 13px; line-height: 23.2px; }
  .faq-q { font-size: 16px; text-wrap: balance; }
  .faq-ico { width: 32px; height: 32px; margin-top: -4.4px; }
  .faq-ico::before, .faq-ico::after { width: 11px; margin-left: -5.5px; }
  .faq-a p { padding: 0 0 24px 36px; font-size: 15px; line-height: 1.65; }
  .faq-a a { padding-block: 12px; }   /* 문장 속 링크: 줄 높이는 그대로, 누르는 범위만 넓힘 */
}

@media (prefers-reduced-motion: reduce) {
  .faq-item::after, .faq-ico, .faq-mail svg { transition: none; }
}
