/* ============================================================
   문의사항 페이지
   ============================================================ */

/* ── Toolbar ───────────────────────────────────────── */
.inq-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* .inq-tabs / .inq-tab → 공통 .tab-bar / .tab-btn으로 마이그레이션됨 (layout.css 참조). */
/* .inq-write-btn / .inq-submit-btn → .btn-primary로 마이그레이션됨 (layout.css 참조). */
/* .inq-status-btn → .btn-secondary로 마이그레이션됨 (layout.css 참조). */
/* .inq-list / .inq-detail → .section-card로 마이그레이션됨 (components.css 참조). */
/* .inq-detail-empty → .empty-state로 마이그레이션됨 (components.css 참조). */
/* .inq-status-badge → .tag .tag--pill로 마이그레이션됨 (components.css 참조). */


/* ── Two-column layout ─────────────────────────────── */
.inq-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--space-4);
  align-items: start;
}

/* 목록·상세가 길어도 페이지 전체가 늘어나지 않도록 각 패널 내부에서만 스크롤.
   높이 = 뷰포트 − (상단 헤더 + 툴바 + 여백) 근사치. 값이 넉넉해 더블 스크롤은 방지. */
#inq-list,
#inq-detail {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .inq-layout { grid-template-columns: 1fr; }
  /* 1단(모바일/태블릿)에서는 패널 높이 제한을 풀고 자연스러운 페이지 스크롤 사용 */
  #inq-list,
  #inq-detail { max-height: none; overflow: visible; }
}


/* ── 목록 항목 — 한 줄 리스트 (상태점 · 제목 · 작성자 · 날짜) ──
   메일/이슈 트래커 스타일. 화면당 항목 수 늘려 스캔 효율 ↑. */
.inq-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.inq-item:last-of-type { border-bottom: none; }
.inq-item:hover { background: var(--bg); }
.inq-item.active { background: var(--bg-subtle); }

/* 상태 색 점 — 색깔이 상태(대기/완료)를 표현 */
.inq-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.inq-item-title {
  flex: 1;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inq-item-author {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.inq-item-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ── Pager ─────────────────────────────────────────── */
.inq-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  font-size: var(--text-base);
  color: var(--text-muted);
}

.inq-pager-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.inq-pager-btn:hover:not(:disabled) { background: var(--bg); }
.inq-pager-btn:focus-visible { outline: none; border-color: var(--ad-primary); box-shadow: var(--focus-ring); }
.inq-pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ── Detail (.section-card__body 안) ───────────────── */
.inq-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-3);
}

.inq-detail-title {
  font-size: var(--text-xl);
  font-weight: 800;
  margin: var(--space-2) 0 var(--space-2);
  letter-spacing: -0.02em;
  color: var(--text);
}

.inq-detail-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.inq-detail-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.inq-action-btn {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.inq-action-btn:hover { background: var(--bg); }
.inq-action-btn:focus-visible { outline: none; border-color: var(--ad-primary); box-shadow: var(--focus-ring); }
.inq-action-btn.danger { color: var(--danger); border-color: var(--danger-border); }
.inq-action-btn.danger:hover { background: var(--danger-light); }

.inq-detail-body {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: var(--space-4);
  word-break: break-word;
}


/* ── Answer block ──────────────────────────────────── */
.inq-answer {
  background: var(--success-light);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.inq-answer-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  color: var(--success);
  margin-bottom: var(--space-2);
}

.inq-answer-meta {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.inq-answer-body {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--text-secondary);
  word-break: break-word;
}


/* ── Answer form (responder only) ──────────────────── */
.inq-answer-form {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border);
}

.inq-form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.inq-input, .inq-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-family: inherit;
  color: var(--text);
  background: var(--white);
}

.inq-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* 인라인 스타일 클래스화 (시각 변화 없음) */
.inq-toolbar .tab-bar { margin: 0; }                  /* layout .tab-bar 마진 상쇄 */
.inq-layout > .section-card { margin-bottom: 0; }     /* 레이아웃이 간격 담당 */
.inq-answer-submit { width: auto; padding: var(--space-2) var(--space-6); }   /* btn-primary 100% 너비 오버라이드 */
.inq-modal-field { margin-bottom: 14px; }
.inq-modal-field-lg { margin-bottom: 18px; }
.inq-textarea--tall { min-height: 160px; }            /* 작성·수정 모달 본문 (답변 textarea는 base 100px 유지) */

.inq-input:focus, .inq-textarea:focus {
  outline: none;
  border-color: var(--ad-primary);
}

.inq-form-actions {
  margin-top: var(--space-3);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
