/* =======================================================================
   styles.css — 주역 단시점 UI 스타일 (Claude 스타일 버전 v3.0)
   따뜻한 크림/브라운 톤 + 테라코타(#d97757) 포인트
   기존 클래스 구조 100% 유지 — HTML/JS 수정 없이 교체 가능
   ======================================================================= */

/* ===== CSS 변수 (Claude 팔레트) ===== */
:root {
  /* 포인트 컬러 — Claude 테라코타 */
  --primary-color: #d97757;       /* 메인 액센트 */
  --primary-dark: #b8552f;        /* 호버/강조 */
  --primary-light: #e89b7f;       /* 밝은 액센트 */
  --accent-color: #c96442;        /* 괘 기호 등 세컨더리 액센트 */

  /* 배경/카드 — 따뜻한 크림 계열 */
  --background: #f0eee6;          /* Claude 배경 크림 */
  --card-bg: #faf9f5;             /* 카드 아이보리 */
  --card-bg-deep: #ffffff;        /* 내부 중첩 카드 */

  /* 텍스트 — 웜 브라운/차콜 */
  --text-primary: #3d3929;        /* 본문 */
  --text-secondary: #6e6a5e;      /* 보조 */
  --text-muted: #a19f94;          /* 힌트/캡션 */

  /* 보더/중립 */
  --border-color: #e3e0d5;
  --neutral-bg: #ece9df;
  --info-bg: #f3ede4;             /* 등급 배지 배경 */

  /* 테라코타 은은한 배경 (판단문 등) */
  --terracotta-tint: rgba(217, 119, 87, 0.08);
  --terracotta-border: rgba(217, 119, 87, 0.35);
}

/* ===== 기본 설정 ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'nanum-square', 'NanumGothic', 'Noto Sans KR', sans-serif;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--background);
}

/* 수정 */
.entry-content main,
.entry-content > main,
main {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ===== 유틸리티 ===== */
.is-hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.92rem; }

/* ===== 공통 패널 ===== */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(61, 57, 41, 0.06);
}

.panel h2 {
  margin: 0 0 20px 0;
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  font-family: 'Noto Serif KR', serif;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

/* 해결지수 점수 강조 */
.panel h2 span,
#fortuneScore {
  color: var(--primary-color);
}

/* ===== 입력 폼 ===== */
.field {
  margin-bottom: 16px;
}

.field label {
  font-size: 0.95rem;
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.tsline {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.tsline b {
  color: var(--primary-dark);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

input[type="date"],
input[type="time"],
select {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--card-bg-deep);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--terracotta-tint);
}

.chk {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
  color: var(--text-secondary);
}

.chk input[type="checkbox"] {
  margin: 0;
  accent-color: var(--primary-color);
}

button {
  padding: 10px 22px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  font-weight: 600;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.28);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

/* 초기화 버튼 — 보조 스타일 (두 번째 버튼) */
.actions button:last-child,
#resetBtn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.actions button:last-child:hover,
#resetBtn:hover {
  background: var(--neutral-bg);
  color: var(--text-primary);
  box-shadow: none;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.hint-inline {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ===== 간지 프리뷰 ===== */
.preview {
  font-size: 1.05rem;
  padding: 16px;
  text-align: center;
  font-weight: 500;
  font-family: 'Noto Serif KR', serif;
  background: var(--terracotta-tint);
  border: 1px solid var(--terracotta-border);
  border-radius: 12px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* ===== 괘 정보 (텍스트 위주) ===== */
.hexagram-info {
  background: var(--card-bg-deep);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.hex-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.hex-row:last-child {
  border-bottom: none;
}

.hex-label {
  font-weight: 600;
  color: var(--primary-dark);
  min-width: 60px;
  font-size: 1rem;
}

.hex-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Noto Serif KR', serif;
}

.hex-trigrams {
  font-size: 1.5rem;
  color: var(--accent-color);
  display: inline-flex;
  gap: 4px;
}

.hex-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hex-spacer {
  flex: 1;
}

.hex-grade {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--info-bg);
  color: var(--primary-dark);
  border: 1px solid var(--terracotta-border);
  margin-left: auto;
}

.hex-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  min-width: 40px;
  text-align: right;
}

.hex-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.hex-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.hex-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px dashed var(--border-color);
}

/* ===== 해설 섹션 ===== */
.interpretation-content {
  line-height: 1.8;
  color: var(--text-primary);
}

.judgment-1 {
  font-size: 1.15rem;
  font-weight: 600;
  font-family: 'Noto Serif KR', serif;
  color: var(--text-primary);
  margin-bottom: 15px;
  padding: 16px 18px;
  border-left: 4px solid var(--primary-color);
  background: var(--terracotta-tint);
  border-radius: 0 12px 12px 0;
}

.judgment-2 {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.85;
  padding: 0 16px;
}

/* ===== 로그 ===== */
pre {
  background: #f5f3ec;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--text-secondary);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  main { padding: 12px; }

  .panel { padding: 16px; border-radius: 14px; }

  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .hex-row {
    flex-wrap: wrap;
  }

  .hex-spacer {
    display: none;
  }

  .hex-grade,
  .hex-score {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .panel h2 {
    font-size: 1.25rem;
  }
}

/* ===== 모션 최소화 환경 존중 ===== */
@media (prefers-reduced-motion: reduce) {
  button,
  input,
  select {
    transition: none;
  }
  button:hover {
    transform: none;
  }
}

/* 불필요한 p 태그 여백 제거 */
.entry-content > p:empty,
.entry-content > p:first-child:has(link),
.entry-content > p:last-child:has(script) {
  display: none;
  margin: 0;
  padding: 0;
}
.dansijum-wrap {
  margin-top: 0;
  margin-bottom: 0;
}
