/* ============================================
   서퍼블리셔 디자인 시스템 v4.0
   프리미엄 다크 테마 + 글래스모피즘
   ============================================ */

/* -- CSS 변수 (다크 테마) -- */
:root,
[data-theme="dark"] {
  --bg-primary: #0a0b0f;
  --bg-secondary: #12131a;
  --bg-card: #1a1b25;
  --bg-card-hover: #22232f;
  --bg-glass: rgba(26, 27, 37, 0.7);
  --text-primary: #e8e9ed;
  --text-secondary: #9ca0b0;
  --text-muted: #6b6f82;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --green: #00b894;
  --blue: #0984e3;
  --orange: #fdcb6e;
  --red: #e17055;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --header-h: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Noto Sans KR', 'Inter', -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1f5;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --text-primary: #1a1b25;
  --text-secondary: #5a5e72;
  --text-muted: #9ca0b0;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
}

/* -- 리셋/기본 -- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -- 스크롤 프로그레스 -- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 9999;
  transition: width 0.1s;
}

/* -- 헤더 -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.5rem;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* -- 헤더 사이트 현황 -- */
.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px;
  flex-shrink: 1;
  min-width: 0;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  line-height: 1.15;
  white-space: nowrap;
}

.header-stat-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.header-stat-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.02em;
}

@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }
  .header-stats {
    margin: 0 8px;
    gap: 6px;
  }
  .header-stat {
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .header-stat-label {
    display: none;
  }
  .header-stat {
    padding: 4px 7px;
  }
  .header-stat-num {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .header-stats {
    display: none;
  }
}


.search-toggle,
.theme-toggle,
.mobile-menu-toggle {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.search-toggle:hover,
.theme-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* -- 검색 오버레이 -- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-inner {
  width: 90%;
  max-width: 600px;
  position: relative;
}

.search-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.search-input-overlay {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.2rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font);
  outline: none;
}

.search-submit-overlay {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

/* -- 히어로 배너 -- */
.hero-banner {
  padding: 80px 0 40px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 50%, rgba(108, 92, 231, 0.05) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-greeting {
  display: block;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hero-main {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
}

.hero-main em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.hero-search {
  margin-top: 24px;
  position: relative;
  max-width: 500px;
}

.hero-search-input {
  width: 100%;
  padding: 14px 50px 14px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border var(--transition);
}

.hero-search-input:focus {
  border-color: var(--accent);
}

.hero-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-light);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -- 카테고리 칩 -- */
.category-filter-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.category-filter-section .container {
  position: relative;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 2px;
  /* All chips visible on desktop; no edge-fade mask (was clipping novel chip) */
}

.category-chip {
  padding: 9px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: transform var(--transition), border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-chip:hover {
  border-color: var(--chip-color, var(--accent));
  color: var(--text-primary);
  transform: translateY(-1px);
}

.category-chip.active {
  background: var(--chip-color, var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--chip-color, var(--accent)) 38%, transparent);
}

.chip-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 50px;
  margin-left: 4px;
}

/* -- 글 카드 그리드 -- */
.articles-section {
  padding: 40px 0 80px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.card-link {
  display: block;
  color: inherit;
}

.card-image {
  height: 200px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.article-card:hover .card-image img {
  transform: scale(1.05);
}

.card-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.card-body {
  padding: 20px;
}

.article-category {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(108, 92, 231, 0.12);
  color: var(--cat-color, var(--accent-light));
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta-sep {
  opacity: 0.5;
}

/* -- Featured 대형 카드 -- */
.featured-article {
  margin-bottom: 32px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  color: inherit;
}

.featured-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-glow);
}

.featured-image {
  height: 320px;
  overflow: hidden;
  position: relative;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.featured-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 12px 0;
}

.featured-excerpt {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.featured-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(108, 92, 231, 0.1));
}

/* -- 페이지네이션 -- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}

.page-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* -- 빈 상태 -- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1/-1;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
}

/* -- 버튼 -- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* -- 푸터 -- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

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

.footer-links h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-light);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -- Back to Top -- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* -- 에러 페이지 -- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.error-code {
  font-size: 8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.error-title {
  font-size: 1.5rem;
  margin: 16px 0 8px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* -- 카테고리 페이지 -- */
.category-page {
  padding: 40px 0 80px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.category-icon-large {
  font-size: 3rem;
}

.category-title {
  font-size: 1.8rem;
  font-weight: 800;
}

.category-desc {
  color: var(--text-secondary);
  margin-top: 4px;
}

.sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.sort-label {
  color: var(--text-muted);
}

.sort-option {
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.sort-option.active {
  background: var(--accent);
  color: #fff;
}

.list-article-card {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.list-article-card:hover {
  background: var(--bg-card);
}

.list-card-link {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  color: inherit;
}

.list-card-image {
  width: 200px;
  min-width: 200px;
  height: 140px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.list-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(108, 92, 231, 0.08));
  border-radius: var(--radius-sm);
}

.list-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.list-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -- 검색 페이지 -- */
.search-page {
  padding: 60px 0 80px;
}

.search-header {
  margin-bottom: 32px;
}

.search-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8rem;
}

.search-info {
  color: var(--text-secondary);
  margin-top: 8px;
}

.search-form-page {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.search-input-page {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
}

.search-input-page:focus {
  border-color: var(--accent);
}

.search-result-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.search-result-card a {
  color: inherit;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-title:hover {
  color: var(--accent-light);
}

.result-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* -- 글 상세 -- */
.article-page {
  padding-top: 20px;
}

.article-header {
  margin-bottom: 40px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-light);
}

.breadcrumb-current {
  color: var(--text-secondary);
}

.article-category-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(108, 92, 231, 0.15);
  color: var(--cat-color, var(--accent-light));
  margin-bottom: 12px;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 20px;
}

.article-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.author-name {
  font-weight: 600;
  display: block;
}

.author-detail time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-right {
  display: flex;
  gap: 16px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-hero-image {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 480px;
}

.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -- 본문 콘텐츠 -- */
.article-content {
  padding: 40px 0;
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  list-style: disc;
}

.article-content ol li {
  list-style: decimal;
}

.article-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.article-content code {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-content pre {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border);
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-content img {
  border-radius: var(--radius-sm);
  margin: 24px auto;
}

.article-content a {
  color: var(--accent-light);
  border-bottom: 1px solid transparent;
}

.article-content a:hover {
  border-bottom-color: var(--accent-light);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-content th {
  background: var(--bg-card);
  font-weight: 600;
}

/* -- 태그 -- */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.tag {
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* -- 액션 바 -- */
.article-actions {
  display: flex;
  gap: 12px;
  padding: 20px 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.like-btn.liked {
  background: rgba(231, 92, 92, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.like-btn.liked svg {
  fill: var(--red);
}

/* -- 관련 글 -- */
.related-section {
  padding: 48px 0;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: inherit;
  transition: all var(--transition);
}

.related-card:hover {
  border-color: var(--accent-glow);
}

.related-image {
  width: 80px;
  min-width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  font-size: 1.5rem;
}

.related-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.related-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-info time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -- 댓글 섹션 -- */
.comments-section {
  padding: 48px 0;
}

.comment-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.comment-form-wrapper {
  margin-bottom: 32px;
}

.comment-form {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.form-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

.form-textarea:focus {
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -- 반응형 -- */
@media (max-width: 768px) {
  .hero-main {
    font-size: 1.6rem;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-search {
    max-width: 100%;
  }

  .hero-stats {
    justify-content: center;
  }

  .main-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-image {
    height: 200px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-title {
    font-size: 1.6rem;
  }

  .article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-card-link {
    flex-direction: column;
  }

  .list-card-image {
    width: 100%;
    height: 180px;
  }

  .form-row {
    flex-direction: column;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .search-form-page {
    flex-direction: column;
  }
}


/* Category chips: scroll only on very small screens */
@media (max-width: 480px) {
  .category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-chips::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  .category-chip {
    padding: 7px 14px;
    font-size: 0.85rem;
  }
}
@media (max-width: 480px) {
  .hero-main {
    font-size: 1.3rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .container,
  .container-narrow {
    padding: 0 16px;
  }
}
/* ===== 시리즈 인덱스 페이지 (/series/<key>/) — 2026-05-30 ===== */
.series-page { padding: 2rem 0 4rem; }
.series-hero {
    display: flex; gap: 1.25rem; align-items: flex-start;
    padding: 2rem; margin: 1rem 0 2rem; border-radius: 20px;
    background: linear-gradient(135deg, rgba(0,212,255,0.10), rgba(139,92,246,0.10));
    border: 1px solid rgba(0,212,255,0.2);
}
.series-hero-icon { font-size: 3rem; line-height: 1; }
.series-hero-badge {
    display: inline-block; font-size: 0.8rem; font-weight: 700; color: #00d4ff;
    background: rgba(0,212,255,0.12); padding: 4px 10px; border-radius: 999px; margin-bottom: 0.6rem;
}
.series-hero-title { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 0.5rem; }
.series-hero-desc { color: var(--text-secondary, #9aa7c0); line-height: 1.6; margin: 0; max-width: 60ch; }
.series-episodes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.series-episode { display: flex; align-items: stretch; gap: 0.85rem; }
.series-episode-num {
    flex: 0 0 auto; width: 34px; height: 34px; margin-top: 0.4rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem; background: rgba(0,212,255,0.15); color: #00d4ff;
}
.series-episode.is-upcoming .series-episode-num { background: rgba(255,255,255,0.06); color: #9aa7c0; }
.series-episode-card {
    flex: 1 1 auto; display: flex; gap: 1rem; align-items: center;
    padding: 0.9rem; border-radius: 14px; text-decoration: none;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    transition: border-color .2s, transform .2s;
}
a.series-episode-card:hover { border-color: rgba(0,212,255,0.5); transform: translateY(-2px); }
.series-episode-thumb {
    flex: 0 0 auto; width: 110px; height: 72px; border-radius: 10px; overflow: hidden;
    background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center;
}
.series-episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.series-episode-ph { font-size: 1.6rem; opacity: 0.7; }
.series-episode-body { flex: 1 1 auto; min-width: 0; }
.series-episode-title { font-size: 1.05rem; margin: 0 0 0.3rem; color: var(--text-primary, #e8eefc); line-height: 1.4; }
.series-episode-excerpt {
    font-size: 0.85rem; color: var(--text-secondary, #9aa7c0); margin: 0 0 0.3rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.series-episode-date { font-size: 0.78rem; color: var(--text-secondary, #9aa7c0); opacity: 0.8; }
.series-episode-soon { opacity: 0.65; cursor: default; }
.series-episode-badge {
    display: inline-block; font-size: 0.75rem; font-weight: 700; color: #9aa7c0;
    background: rgba(255,255,255,0.08); padding: 3px 9px; border-radius: 999px;
}
@media (max-width: 600px) {
    .series-episode-thumb { width: 76px; height: 56px; }
    .series-hero { flex-direction: column; }
}


/* ===== Bookshelf UI (2026-08-23) ===== */
.shelf-section {
  margin-bottom: 2.75rem;
  position: relative;
}

.shelf-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.shelf-label--latest {
  margin-top: 0.5rem;
}

.shelf-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.shelf-row,
.shelf-grid.articles-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  align-items: end;
  padding-bottom: 0.35rem;
}

.shelf-row--popular {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.shelf-board {
  height: 14px;
  margin-top: 0.15rem;
  border-radius: 2px 2px 6px 6px;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(62, 39, 28, 0.55) 28%,
      rgba(42, 26, 18, 0.9) 72%,
      rgba(20, 12, 8, 0.95) 100%);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
}

.shelf-board::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -6px;
  height: 6px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
}

/* Book cover cards (also restyles .article-card when used as books) */
.book-card,
.articles-grid .article-card.book-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px 10px 10px 6px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.28);
}

.book-card .book-link,
.book-card .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  position: relative;
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  z-index: 3;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--cat-color, var(--accent)) 85%, #fff),
      var(--cat-color, var(--accent)),
      color-mix(in srgb, var(--cat-color, var(--accent)) 70%, #000));
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25);
}

.book-cover,
.book-card .card-image,
.book-card .list-card-image {
  position: relative;
  height: auto;
  aspect-ratio: 3 / 4;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border-radius: 0;
}

.book-cover img,
.book-card .card-image img,
.book-card .list-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.book-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 11, 15, 0.75) 0%, rgba(10, 11, 15, 0.15) 42%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.book-placeholder,
.book-card .card-placeholder {
  height: 100%;
  min-height: 100%;
  aspect-ratio: 3 / 4;
}

.book-info,
.book-card .card-body,
.book-card .list-card-body {
  padding: 0.75rem 0.85rem 0.95rem 1rem;
  position: relative;
  z-index: 2;
}

.book-title,
.book-card .card-title,
.book-card .list-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card .card-excerpt,
.book-card .list-card-excerpt {
  font-size: 0.8rem;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  margin-bottom: 0.5rem;
}

.book-card:hover,
.articles-grid .article-card.book-card:hover {
  transform: translateY(-10px) rotate(-0.6deg);
  border-color: rgba(108, 92, 231, 0.55);
  box-shadow:
    0 0 0 1px rgba(108, 92, 231, 0.35),
    0 12px 28px rgba(108, 92, 231, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.book-card:hover .book-cover img,
.book-card:hover .card-image img {
  transform: scale(1.06);
}

.book-rank {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.45);
}

.book-card--compact .book-info .article-category {
  font-size: 0.72rem;
  padding: 2px 8px;
}

/* Featured as pulled-out book */
.featured-card.book-featured {
  position: relative;
  border-color: rgba(108, 92, 231, 0.45);
  box-shadow:
    0 0 0 1px rgba(108, 92, 231, 0.25),
    0 16px 40px rgba(108, 92, 231, 0.22),
    var(--shadow-lg);
  transform: translateY(-6px) scale(1.01);
}

.featured-card.book-featured::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 5;
  background: linear-gradient(180deg, #a29bfe, #6c5ce7, #4834d4);
}

.featured-card.book-featured:hover {
  transform: translateY(-10px) scale(1.015);
  box-shadow:
    0 0 0 1px rgba(108, 92, 231, 0.45),
    0 20px 48px rgba(108, 92, 231, 0.35),
    var(--shadow-lg);
}

/* Category list: override horizontal list when bookshelved */
.shelf-section--category .list-article-card.book-card {
  border-bottom: none;
}

.shelf-section--category .list-card-link.book-link {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.shelf-section--category .list-card-image.book-cover {
  width: 100%;
  min-width: 0;
  height: auto;
}

.shelf-section--category .articles-list.shelf-grid {
  display: grid;
}

/* Responsive: tablet ~3, mobile ~2 books per row */
@media (max-width: 1024px) {
  .shelf-row,
  .shelf-grid.articles-grid,
  .shelf-row--popular {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shelf-row,
  .shelf-grid.articles-grid,
  .shelf-row--popular {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.65rem;
  }

  .book-title,
  .book-card .card-title,
  .book-card .list-card-title {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .book-card .card-excerpt,
  .book-card .list-card-excerpt {
    display: none;
  }

  .shelf-heading {
    font-size: 1.25rem;
  }

  .featured-card.book-featured {
    transform: none;
  }

  .featured-card.book-featured:hover {
    transform: translateY(-4px);
  }
}

/* Keep light theme readable on shelf board */
[data-theme="light"] .shelf-board {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(160, 120, 90, 0.45) 30%,
      rgba(120, 85, 60, 0.75) 70%,
      rgba(90, 60, 40, 0.85) 100%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .book-cover-shade {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

/* ===== Category CSS 3D books (2026-08-23) ===== */
.category-shelf {
  perspective: 1100px;
  perspective-origin: 50% 40%;
  padding: 4px 0 2px;
}

.category-books {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 16px 20px;
  padding: 18px 6px 10px;
  transform-style: preserve-3d;
}

.cat-book {
  --book-color: var(--accent);
  --book-depth: 12px;
  position: relative;
  display: inline-block;
  width: 76px;
  height: 108px;
  flex: 0 0 auto;
  transform-style: preserve-3d;
  transform: rotateY(-22deg) translateZ(0);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), filter 0.28s ease;
  color: #fff;
  text-decoration: none;
  outline: none;
}

.cat-book:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 6px;
  border-radius: 4px;
}

.cat-book-spine,
.cat-book-cover,
.cat-book-pages {
  position: absolute;
  top: 0;
  left: 0;
  backface-visibility: hidden;
}

.cat-book-spine {
  width: var(--book-depth);
  height: 100%;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--book-color) 55%, #000) 0%,
      color-mix(in srgb, var(--book-color) 78%, #111) 55%,
      color-mix(in srgb, var(--book-color) 65%, #000) 100%);
  transform-origin: left center;
  transform: rotateY(-90deg) translateX(calc(var(--book-depth) * -0.5));
  border-radius: 2px 0 0 2px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.cat-book-cover {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 7px 8px;
  text-align: center;
  border-radius: 0 5px 5px 0;
  background:
    linear-gradient(155deg,
      color-mix(in srgb, var(--book-color) 88%, #fff) 0%,
      var(--book-color) 48%,
      color-mix(in srgb, var(--book-color) 78%, #000) 100%);
  box-shadow:
    3px 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset -2px 0 0 rgba(0, 0, 0, 0.12);
  transform: translateZ(calc(var(--book-depth) / 2));
}

.cat-book-pages {
  width: var(--book-depth);
  height: calc(100% - 4px);
  top: 2px;
  left: auto;
  right: 0;
  background:
    repeating-linear-gradient(
      180deg,
      #f7f3ea 0px,
      #f7f3ea 2px,
      #ebe4d6 2px,
      #ebe4d6 3px
    );
  transform-origin: right center;
  transform: rotateY(90deg) translateX(calc(var(--book-depth) / 2));
  border-radius: 0 1px 1px 0;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.5);
}

.cat-book-icon {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.cat-book-name {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  word-break: keep-all;
  max-width: 100%;
}

.cat-book-count {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  margin-top: 1px;
}

.cat-book:hover {
  transform: translateY(-12px) rotateY(-8deg) scale(1.04);
  filter: drop-shadow(0 14px 22px color-mix(in srgb, var(--accent) 42%, transparent));
  z-index: 3;
  color: #fff;
}

.cat-book.active {
  transform: translateY(-8px) rotateY(-10deg);
  filter: drop-shadow(0 0 0 transparent) drop-shadow(0 10px 20px color-mix(in srgb, var(--accent) 48%, transparent));
  z-index: 2;
}

.cat-book.active .cat-book-cover {
  box-shadow:
    0 0 0 2px var(--accent-light),
    3px 8px 20px color-mix(in srgb, var(--accent) 45%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.category-shelf > .shelf-board {
  margin-top: 2px;
}

/* Category page: 3D shelf spacing under header */
.category-page .category-shelf {
  margin: -8px 0 20px;
}


/* Responsive: ~4 / row tablet, 2-3 phone */
@media (max-width: 900px) {
  .category-books {
    gap: 14px 16px;
    padding-top: 14px;
  }
  .cat-book {
    width: 68px;
    height: 98px;
    --book-depth: 10px;
  }
  .cat-book-name { font-size: 0.64rem; }
  .cat-book-icon { font-size: 1.25rem; }
}

@media (max-width: 640px) {
  .category-filter-section { padding: 18px 0 14px; }
  .category-books {
    gap: 12px 14px;
    justify-content: center;
  }
  .cat-book {
    width: calc((100% - 28px) / 3);
    max-width: 92px;
    min-width: 72px;
    height: 102px;
    transform: rotateY(-14deg);
  }
  .cat-book:hover,
  .cat-book.active {
    transform: translateY(-8px) rotateY(-6deg);
  }
}

@media (max-width: 400px) {
  .cat-book {
    width: calc((100% - 14px) / 2);
    max-width: none;
    min-width: 0;
    height: 108px;
  }
}

[data-theme="light"] .cat-book-cover {
  box-shadow:
    3px 6px 14px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

[data-theme="light"] .cat-book:hover {
  filter: drop-shadow(0 12px 18px color-mix(in srgb, var(--accent) 28%, transparent));
}
