/* =====================================================
   도전님 훈시 — 주제별 모음
   (색·글꼴 변수는 css/style.css 의 :root 를 그대로 사용)
   ===================================================== */

.page-topics { min-height: 100dvh; padding-bottom: 60px; }

/* ── 머리말 ── */
.tp-lead {
  max-width: 820px;
  margin: 18px auto 4px;
  padding: 0 18px;
  font-size: .93rem;
  line-height: 1.85;
  color: var(--text2);
  text-align: center;
}
.tp-lead b { color: var(--accent); font-weight: 700; }

/* ── 주제 카드 목록 ── */
.tp-grid {
  max-width: 820px;
  margin: 18px auto 0;
  padding: 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
}

.tp-card {
  display: block;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              border-color .18s var(--ease);
  cursor: pointer;
}
.tp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--gold);
}
.tp-card-t {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.5;
  margin-bottom: 5px;
}
.tp-card-s {
  font-size: .84rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 10px;
}
.tp-card-m {
  font-size: .76rem;
  color: var(--text2);
  letter-spacing: .3px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.tp-card-m b { color: var(--accent); font-weight: 700; }

/* ── 주제 상세 ── */
.tp-view { max-width: 820px; margin: 0 auto; padding: 0 14px; }

.tp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 6px;
  padding: 7px 14px 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--text2);
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
}
.tp-back:hover { color: var(--accent); border-color: var(--gold); }

.tp-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.5;
  margin: 10px 0 4px;
}
.tp-sub { font-size: .9rem; color: var(--text2); margin-bottom: 12px; }

.tp-intro {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: .92rem;
  line-height: 1.95;
  color: var(--text);
  margin-bottom: 8px;
}
.tp-meta {
  font-size: .78rem;
  color: var(--text2);
  text-align: right;
  margin-bottom: 18px;
}

/* ── 단락(섹션) ── */
.tp-sec { margin-bottom: 26px; }
.tp-sec-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tp-sec-n {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #221703;
  font-size: .76rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  align-self: center;
}
.tp-sec-t {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text);
}
.tp-sec-d { font-size: .8rem; color: var(--text2); }
.tp-sec-c { margin-left: auto; font-size: .76rem; color: var(--text2); }

/* ── 대목 카드 ── */
.tp-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-xs);
}
.tp-item.open { border-color: var(--gold); box-shadow: var(--shadow-sm); }

.tp-ih { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tp-ep {
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--active-bg);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 1px 10px;
}
.tp-date, .tp-n { font-size: .74rem; color: var(--text2); }
.tp-n::before { content: '·'; margin-right: 6px; }

.tp-gist {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 6px;
}
.tp-head {
  font-size: .86rem;
  line-height: 1.8;
  color: var(--text2);
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tp-item.open .tp-head { display: none; }

.tp-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.tp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  font-size: .82rem;
  font-family: inherit;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
}
.tp-btn:hover { color: var(--accent); border-color: var(--gold); }
.tp-btn.play { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .tp-btn.play { color: #1C1409; }
.tp-btn.play:hover { background: var(--accent-h); border-color: var(--accent-h); }

/* ── 본문 ── */
.tp-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.tp-loading { font-size: .85rem; color: var(--text2); padding: 6px 0; }

.tp-seg {
  display: flex;
  gap: 9px;
  padding: 5px 8px 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s var(--ease);
}
.tp-seg:hover { background: var(--active-bg); }
.tp-seg-n {
  flex: none;
  font-size: .7rem;
  color: var(--text2);
  padding-top: .45em;
  min-width: 2.1em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tp-seg-x {
  font-family: 'Noto Serif KR', serif;
  font-size: 1rem;
  line-height: 2;
  color: var(--text);
}
.tp-seg-x ruby rt { font-size: .5em; color: var(--text2); }

.tp-body-foot {
  margin-top: 10px;
  font-size: .76rem;
  color: var(--text2);
  text-align: center;
}

/* ── 안내 / 오류 ── */
.tp-msg {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 18px;
  text-align: center;
  color: var(--text2);
  font-size: .92rem;
  line-height: 1.9;
}

@media (max-width: 480px) {
  .tp-grid { grid-template-columns: 1fr; gap: 10px; }
  .tp-title { font-size: 1.2rem; }
  .tp-sec-c { margin-left: 0; }
}
