@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;700;900&display=swap');

/* ── 메인 목차 영역 ── */
.analects-wrapper {
  font-family: 'Noto Serif KR', serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.analects-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px double #8b6914;
}

.analects-header h2 {
  font-size: 2.2rem;
  font-weight: 900;
  color: #d4a830;
  letter-spacing: 0.4em;
  margin-bottom: 0.3rem;
}

.analects-header .subtitle {
  font-size: 0.95rem;
  color: #a08850;
  letter-spacing: 0.15em;
}

.analects-scroll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

@media (max-width: 500px) {
  .analects-scroll {
    grid-template-columns: 1fr;
  }
}

.analects-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid #3d3520;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a1610 0%, #211c12 100%);
  text-decoration: none !important;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.analects-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #8b6914;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.analects-item:hover {
  background: linear-gradient(135deg, #211c12 0%, #2a2418 100%);
  border-color: #8b6914;
  box-shadow: 0 2px 16px rgba(139, 105, 20, 0.2);
  transform: translateY(-1px);
}

.analects-item:hover::before {
  opacity: 1;
}

.analects-num {
  font-size: 0.75rem;
  color: #7a6a3a;
  min-width: 3.2rem;
  margin-right: 0.5rem;
  text-align: center;
  font-family: 'Noto Serif KR', serif;
}

.analects-title-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.analects-hanja {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8d5a0;
  letter-spacing: 0.1em;
}

.analects-desc {
  font-size: 0.78rem;
  color: #8a7a50;
  letter-spacing: 0.05em;
}

.analects-divider {
  text-align: center;
  margin: 1.8rem 0;
  color: #8b6914;
  font-size: 1.2rem;
  letter-spacing: 1em;
  font-family: 'Noto Serif KR', serif;
}

/* ── 사이드바 고전풍 오버라이드 ── */
.sidebar .nav__list {
  font-family: 'Noto Serif KR', serif;
}

.sidebar .nav__list .nav__sub-title {
  font-family: 'Noto Serif KR', serif;
  color: #d4a830;
  border-bottom: 2px double #5a4a20;
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
}

.sidebar .nav__list .nav__sub-title a {
  color: #d4a830 !important;
  text-decoration: none;
}

.sidebar .nav__list .nav__sub-title a:hover {
  color: #f0c040 !important;
}

.sidebar .nav__list .nav__items ul {
  border-left: 2px solid #3d3520;
  padding-left: 0.8rem;
  margin-left: 0.2rem;
}

.sidebar .nav__list .nav__items li {
  margin-bottom: 0.15rem;
}

.sidebar .nav__list .nav__items a {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  color: #a09070 !important;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  transition: all 0.2s ease;
  display: block;
  text-decoration: none !important;
}

.sidebar .nav__list .nav__items a:hover {
  color: #e8d5a0 !important;
  background: rgba(139, 105, 20, 0.12);
}

.sidebar .nav__list .nav__items a.active {
  color: #d4a830 !important;
  background: rgba(139, 105, 20, 0.18);
  border-left: 3px solid #8b6914;
  margin-left: -0.8rem;
  padding-left: 1.1rem;
  font-weight: 700;
}

/* ── 상세 페이지 (각 편) 스타일 ── */
.analects-detail {
  font-family: 'Noto Serif KR', serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.analects-detail-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 3px double #5a4a20;
}

.analects-detail-header .detail-num {
  font-size: 0.85rem;
  color: #7a6a3a;
  letter-spacing: 0.3em;
  margin-bottom: 0.3rem;
}

.analects-detail-header .detail-title {
  font-size: 2rem;
  font-weight: 900;
  color: #d4a830;
  letter-spacing: 0.3em;
  margin: 0.3rem 0;
}

.analects-detail-header .detail-subtitle {
  font-size: 0.9rem;
  color: #a08850;
  letter-spacing: 0.1em;
}

.analects-detail-content {
  font-family: 'Noto Serif KR', serif;
  line-height: 2;
  color: #c8b888;
}

.analects-detail-content h3 {
  font-family: 'Noto Serif KR', serif;
  color: #d4a830;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #3d3520;
}

.analects-detail-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 2px double #3d3520;
}

.analects-detail-nav a {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.85rem;
  color: #a09070 !important;
  text-decoration: none !important;
  padding: 0.5rem 1rem;
  border: 1px solid #3d3520;
  border-radius: 4px;
  transition: all 0.25s ease;
}

.analects-detail-nav a:hover {
  color: #e8d5a0 !important;
  border-color: #8b6914;
  background: rgba(139, 105, 20, 0.1);
}

/* ── 장(章) 카드 리스트 ── */
.analects-verse-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.analects-verse-card {
  display: flex;
  align-items: flex-start;
  padding: 1rem 1.2rem;
  border: 1px solid #3d3520;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a1610 0%, #211c12 100%);
  text-decoration: none !important;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.analects-verse-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #8b6914;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.analects-verse-card:hover {
  background: linear-gradient(135deg, #211c12 0%, #2a2418 100%);
  border-color: #8b6914;
  box-shadow: 0 2px 16px rgba(139, 105, 20, 0.15);
  transform: translateX(4px);
}

.analects-verse-card:hover::before {
  opacity: 1;
}

.verse-num {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.75rem;
  color: #7a6a3a;
  min-width: 2.5rem;
  padding-top: 0.15rem;
  text-align: center;
}

.verse-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.verse-hanja {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8d5a0;
  letter-spacing: 0.05em;
}

.verse-reading {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  color: #7a6a3a;
  letter-spacing: 0.03em;
}

.verse-preview {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  color: #8a7a50;
  letter-spacing: 0.02em;
}

/* ── 개별 장(章) 상세 페이지 ── */
.verse-original {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.15rem;
  line-height: 2.2;
  color: #e8d5a0;
  padding: 1.2rem 1.5rem;
  border-left: 3px solid #8b6914;
  background: rgba(139, 105, 20, 0.06);
  border-radius: 0 4px 4px 0;
  margin: 0.8rem 0;
  letter-spacing: 0.05em;
}

/* ── 字解 글자 풀이 ── */
.char-breakdown {
  margin: 1rem 0 1.5rem;
}

.char-section-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.9rem;
  color: #8b6914;
  letter-spacing: 0.15em;
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #3d3520;
}

.char-breakdown .char-section-title:first-child {
  margin-top: 0;
}

.char-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.8rem;
  padding: 0.6rem 0.5rem;
  border: 1px solid #3d3520;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a1610 0%, #1e1a10 100%);
  transition: all 0.2s ease;
}

.char-card:hover {
  border-color: #8b6914;
  background: linear-gradient(135deg, #211c12 0%, #2a2418 100%);
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.15);
}

.char-han {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #e8d5a0;
  line-height: 1.3;
}

.char-read {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.75rem;
  color: #a09070;
  margin-top: 0.15rem;
}

.char-mean {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.65rem;
  color: #7a6a3a;
  margin-top: 0.1rem;
  text-align: center;
  max-width: 4.5rem;
  word-break: keep-all;
}
