/* ============================================
   TROVAEL Premium Skin v7.0
   Brand Guidelines Color System
   ============================================ */

/**
 * ═══════════════════════════════════════════════════════════════════════════
 * TROVAEL Premium Skin v8.3
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * 이 스킨은 TROVAEL(https://trovael.com) 전용으로 제작되었습니다.
 * 무단 복제, 배포, 수정을 금지합니다.
 * 
 * Copyright © 2025 TROVAEL. All Rights Reserved.
 * Created with ♥ for TROVAEL - Where Value Lives
 * 
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ===== CSS Variables ===== */
:root {
  /* Brand Colors (from Brand Guidelines) */
  --gold: #D4AF37;
  --gold-light: #F4D03F;
  --gold-dark: #B8860B;
  --navy: #0A1628;
  --navy-light: #1A2744;
  --white: #FAFAFA;
  --gray: #6B7280;
  
  /* Semantic Colors */
  --bg-primary: var(--navy);
  --bg-secondary: var(--navy-light);
  --bg-tertiary: #152238;
  --text-primary: var(--white);
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.55);
  --accent: var(--gold);
  --accent-light: var(--gold-light);
  --border: rgba(212, 175, 55, 0.2);
  --border-light: rgba(255, 255, 255, 0.1);
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Layout */
  --header-height: 70px;
  --max-width: 1200px;
  --content-width: 900px;
  --sidebar-width: 320px;
  --spacing: 24px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Light Mode */
body.light-mode {
  --bg-primary: #F5F7FA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E8ECF1;
  --text-primary: var(--navy);
  --text-secondary: rgba(10, 22, 40, 0.8);
  --text-muted: rgba(10, 22, 40, 0.55);
  --accent: var(--gold-dark);
  --border: rgba(10, 22, 40, 0.1);
  --border-light: rgba(10, 22, 40, 0.08);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Light Mode - 댓글 스타일 보정 */
body.light-mode .comment-item {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F7FA 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-mode .comment-item:hover {
  box-shadow: 0 4px 20px rgba(184, 134, 11, 0.15);
}

body.light-mode .comment-avatar {
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.2);
}

body.light-mode .comment-date {
  background: #E8ECF1;
}

body.light-mode .comment-form {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F7FA 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.light-mode .form-row input,
body.light-mode .form-textarea textarea {
  background: #FFFFFF;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* Utility */
.logo-icon {
  color: var(--accent);
}

/* ===== Header ===== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  transition: background-color var(--transition), border-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.logo a {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 20px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 3px;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-left: 8px;
}

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

.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

/* Theme Toggle */
#themeToggle .icon-sun,
body.light-mode #themeToggle .icon-moon {
  display: none;
}

body.light-mode #themeToggle .icon-sun,
#themeToggle .icon-moon {
  display: block;
}

/* Menu Button */
.btn-menu {
  flex-direction: column;
  gap: 5px;
}

.btn-menu span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: all var(--transition);
}

/* ===== Search Modal ===== */
#searchModal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

#searchModal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  opacity: 0.95;
}

.modal-body {
  position: relative;
  width: 90%;
  max-width: 560px;
  transform: translateY(-20px);
  transition: transform var(--transition);
}

#searchModal.active .modal-body {
  transform: translateY(0);
}

.search-form {
  display: flex;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.search-form input {
  flex: 1;
  padding: 18px 24px;
  font-size: 16px;
  font-family: var(--font-body);
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-form button {
  padding: 18px;
  color: var(--accent);
  transition: all var(--transition);
}

.search-form button:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.search-hint {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Sidebar ===== */
#sidebar {
  position: fixed;
  inset: 0;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

#sidebar.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.sidebar-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  max-width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition);
}

#sidebar.active .sidebar-panel {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--spacing);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.sidebar-desc {
  padding: var(--spacing);
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.9;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing);
}

.nav-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}

.category-menu a {
  display: block;
  padding: 12px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}

.category-menu a:hover {
  color: var(--accent);
  padding-left: 8px;
}

.sidebar-footer {
  padding: 20px var(--spacing);
  border-top: 1px solid var(--border-light);
}

.sidebar-links {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.sidebar-links a {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.sidebar-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-footer .copyright {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Main Content ===== */
#main {
  padding-top: var(--header-height);
  min-height: 100vh;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px var(--spacing);
}

/* ===== 포털형 검색 결과 페이지 ===== */

/* 페이지 헤더 (검색어/카테고리 표시) */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}

.page-header-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-header-title .highlight {
  color: var(--accent);
}

.page-header-meta {
  font-size: 14px;
  color: var(--text-muted);
}

.page-header-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.header-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.header-tab:hover,
.header-tab.active {
  background: var(--accent);
  color: var(--navy);
  border-color: var(--accent);
}

/* 최신 콘텐츠 섹션 (카드 슬라이더) */
.featured-section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-more {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-more:hover {
  color: var(--accent);
}

/* 최신 콘텐츠 카드 그리드 */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

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

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

.featured-card-thumb {
  position: relative;
  width: 100%;
  padding-top: 65%;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.featured-card-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-card:hover .featured-card-thumb img {
  transform: scale(1.08);
}

.featured-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: var(--navy);
  border-radius: 4px;
}

.featured-card-body {
  padding: 14px;
}

.featured-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* 검색 결과 리스트 */
.search-results-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.results-section {
  margin-bottom: 32px;
}

.results-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

/* 검색 결과 아이템 */
.search-result-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  transition: all var(--transition);
  overflow: hidden;
}

.search-result-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.1);
}

.result-link {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.result-thumbnail {
  width: 180px;
  height: 120px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.search-result-item:hover .result-thumbnail img {
  transform: scale(1.05);
}

.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.result-category-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.result-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

.result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-separator {
  opacity: 0.5;
}

.meta-author {
  font-weight: 500;
  color: var(--text-secondary);
}

/* 검색 결과 없음 */
.no-results {
  text-align: center;
  padding: 80px 20px;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.no-results-desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* 그리드 뷰 모드 */
.search-results-container.grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-view .search-result-item {
  margin-bottom: 0;
}

.grid-view .result-link {
  flex-direction: column;
  padding: 0;
}

.grid-view .result-thumbnail {
  width: 100%;
  height: 160px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.grid-view .result-content {
  padding: 16px;
}

.grid-view .result-title {
  font-size: 16px;
}

.grid-view .result-summary {
  display: none;
}

/* 뷰 모드 토글 */
.view-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.view-btn:hover,
.view-btn.active {
  background: var(--accent);
  color: var(--navy);
  border-color: var(--accent);
}

/* 라이트모드 */
body.light-mode .featured-card {
  background: #fff;
}

body.light-mode .search-result-item {
  background: #fff;
}

body.light-mode .search-result-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 반응형 */
@media (max-width: 1024px) {
  .featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .search-results-container.grid-view {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .featured-section {
    margin-bottom: 24px;
  }
  
  .result-link {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .result-thumbnail {
    width: 100%;
    height: 180px;
  }
  
  .search-results-container.grid-view {
    grid-template-columns: 1fr;
  }
  
  .page-header-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .featured-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .featured-card-body {
    padding: 10px;
  }
  
  .featured-card-title {
    font-size: 13px;
  }
}

/* ===== 기존 Article List 스타일 (하위 호환) ===== */
.article-list {
  margin-bottom: 24px;
}

.article-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

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

.card-link {
  display: flex;
  flex-direction: row;
}

.card-thumbnail {
  width: 300px;
  min-height: 200px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-tertiary);
}

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

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

.card-content {
  flex: 1;
  padding: var(--spacing);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Article Single (Permalink Page) ===== */
.article-single {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ===== Article Header (오마이뉴스 스타일) ===== */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

/* 카테고리 뱃지 */
.article-category-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
  margin-bottom: 16px;
  text-decoration: none;
  transition: opacity var(--transition);
}

.article-category-badge:hover {
  opacity: 0.8;
}

/* 제목 */
.article-header .article-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 24px;
  word-break: keep-all;
}

/* 작성자 정보 라인 */
.article-author-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 18px;
  flex-shrink: 0;
}

.author-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.author-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.author-separator {
  color: var(--text-muted);
  font-size: 12px;
}

.author-email {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

.author-email:hover {
  opacity: 0.8;
  text-decoration: underline;
}

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

.author-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* 읽기 시간 */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 12px;
  border-left: 1px solid var(--border-light);
}

.reading-time svg {
  opacity: 0.7;
}

.reading-time-text {
  white-space: nowrap;
}

/* 액션바 */
.article-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.action-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.action-item svg {
  opacity: 0.7;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.action-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.1);
}

.action-btn svg {
  opacity: 0.8;
}

/* 라이트모드 */
body.light-mode .author-avatar {
  color: #FFFFFF;
}

body.light-mode .action-btn {
  background: #F5F7FA;
  border-color: #E5E7EB;
}

body.light-mode .action-btn:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* ===== Article Body ===== */
.article-body {
  font-size: 17px;
  line-height: 1.95;
  color: var(--text-primary);
  word-break: keep-all;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 56px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 18px;
  color: var(--text-primary);
}

.article-body h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 24px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.article-body img {
  border-radius: var(--radius-sm);
  margin: 32px 0;
}

.article-body blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-body pre {
  margin: 32px 0;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  border: 1px solid var(--border-light);
}

.article-body code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
}

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

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

.article-body li {
  margin-bottom: 10px;
}

.article-body ul li {
  list-style-type: disc;
}

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

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

.article-body th,
.article-body td {
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  text-align: left;
}

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

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 48px 0;
}

/* ===== Article Tags ===== */
.article-tags {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.tags-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}

.tags-list a {
  display: inline-block;
  margin: 0 8px 10px 0;
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.tags-list a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

/* ===== Article Actions (CCL, Share) ===== */
.article-actions {
  margin: 40px 0;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* 빈 article-actions 완전 숨기기 */
.article-actions:empty,
.article-actions.is-empty {
  display: none !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  visibility: hidden !important;
}

/* Tistory Like Button Styling */
.container_postbtn {
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
}

.container_postbtn .postbtn_like {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  transition: all var(--transition) !important;
}

.container_postbtn .postbtn_like:hover {
  border-color: var(--accent) !important;
  background: var(--bg-tertiary) !important;
}

/* 구독하기 버튼 스타일 */
.container_postbtn .btn_subscription,
.btn_subscription {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-secondary) !important;
  transition: all var(--transition) !important;
}

.container_postbtn .btn_subscription:hover,
.btn_subscription:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* 더보기 버튼 (공유 등) */
.container_postbtn .postbtn_etc,
.postbtn_etc {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  transition: all var(--transition) !important;
}

.container_postbtn .postbtn_etc:hover,
.postbtn_etc:hover {
  border-color: var(--accent) !important;
}

/* ===== Post Navigation ===== */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
}

/* 빈 post-nav 숨기기 */
.post-nav:empty,
.post-nav.is-empty {
  display: none !important;
  margin: 0 !important;
}

.post-nav-item {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.post-nav-item:hover {
  border-color: var(--accent);
}

.nav-next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.nav-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Comment Section ===== */
.comment-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border-light);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 댓글 헤더 영역 */
.comment-header-area {
  text-align: center;
  margin-bottom: 40px;
}

.comment-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.title-icon {
  color: var(--accent);
}

.comment-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.5px;
}

/* ===== 댓글 목록 - 모던 디자인 ===== */
.comment-list {
  margin-bottom: 40px;
}

/* 개별 댓글 아이템 */
.comment-item {
  display: flex;
  gap: 16px;
  padding: 24px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  position: relative;
  transition: all var(--transition);
}

.comment-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

/* 아바타 */
.comment-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--bg-primary);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* 댓글 본문 영역 */
.comment-body {
  flex: 1;
  min-width: 0;
}

/* 댓글 메타 (작성자, 날짜) */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0.3px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-primary);
  border-radius: 12px;
}

/* 댓글 내용 */
.comment-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
  word-break: keep-all;
}

/* 댓글 내 링크 */
.comment-content a,
.comment-content .comment-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

.comment-content a:hover,
.comment-content .comment-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* 미디어 컨테이너 */
.comment-media-container {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 댓글 내 임베드된 미디어 */
.embedded-media {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
}

.embedded-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition);
  display: block;
}

.embedded-image:hover {
  transform: scale(1.02);
}

.embedded-video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  border: none;
  display: block;
}

/* ===== 링크 프리뷰 카드 ===== */
.link-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  overflow: hidden;
}

.link-preview-card:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.link-preview-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-preview-icon img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.link-preview-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.link-preview-domain {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
  text-transform: lowercase;
}

.link-preview-url {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-preview-arrow {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--transition);
}

.link-preview-card:hover .link-preview-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* 라이트모드 링크 프리뷰 */
body.light-mode .link-preview-card {
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-mode .link-preview-card:hover {
  background: #F5F7FA;
}
  border-radius: var(--radius-sm);
  border: none;
}

/* 댓글 액션 버튼 */
.comment-actions {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.comment-actions a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 16px;
  background: transparent;
  transition: all var(--transition);
}

.comment-actions a:hover {
  color: var(--accent);
  background: rgba(212, 175, 55, 0.1);
}

.comment-actions .action-icon {
  font-size: 14px;
}

/* ===== 대댓글 스타일 ===== */
/* 1단계 대댓글 */
.comment-item.rp_child,
.comment-item[class*="child"],
.comment-item.is-reply {
  margin-left: 48px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(212, 175, 55, 0.03) 100%);
  border-left: 3px solid var(--accent);
  position: relative;
}

.comment-item.rp_child::before,
.comment-item[class*="child"]::before,
.comment-item.is-reply::before {
  content: '↳';
  position: absolute;
  left: -32px;
  top: 24px;
  font-size: 18px;
  color: var(--accent);
  opacity: 0.7;
}

.comment-item.rp_child .comment-avatar,
.comment-item[class*="child"] .comment-avatar,
.comment-item.is-reply .comment-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--navy-light) 100%);
  border: 2px solid var(--accent);
  color: var(--accent);
}

/* 2단계 이상 대댓글 */
.comment-item.rp_child .comment-item.rp_child,
.comment-item[class*="child"] .comment-item[class*="child"],
.comment-item.is-reply .comment-item.is-reply {
  margin-left: 32px;
  border-left-color: var(--text-muted);
}

/* ===== 비밀 댓글 스타일 ===== */
.comment-item.secret,
.comment-item[class*="secret"] {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, var(--bg-tertiary) 100%);
  border-style: dashed;
}

.comment-item.secret::after,
.comment-item[class*="secret"]::after {
  content: '🤫';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px;
}

/* ===== 댓글 입력 폼 ===== */
.comment-form-wrapper {
  margin-top: 40px;
}

.comment-form {
  padding: 28px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.form-row input {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
}

.form-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-row input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  margin-bottom: 16px;
}

.form-textarea textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  transition: all var(--transition);
}

.form-textarea textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-textarea textarea::placeholder {
  color: var(--text-muted);
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.secret-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}

.secret-check:hover {
  color: var(--text-secondary);
}

.secret-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.secret-check span {
  user-select: none;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--bg-primary);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-submit:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-submit span {
  font-size: 14px;
}

/* 댓글 없을 때 */
.comment-list:empty::before {
  content: "아직 댓글이 없습니다. 첫 번째 댓글을 남겨주세요!";
  display: block;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 반응형 */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .comment-item.rp_child,
  .comment-item[class*="child"],
  .comment-item.reply {
    margin-left: 20px;
  }
}

.comment-container {
  margin-top: 24px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 댓글 영역이 무조건 보이도록 강제 */
.comment-container > * {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== Tistory Comment System (React Rendered) ===== */
/* 댓글 React 앱 강제 표시 */
div[data-tistory-react-app="Comment"],
div[data-tistory-react-app="comment"],
.tt-comment-area,
.tt_wrap_cmt,
.comment_view,
#tt-body-comment {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 댓글 전체 컨테이너 */
.tt-comment-cont {
  background: transparent !important;
  display: block !important;
  visibility: visible !important;
}

/* 댓글 개수 영역 */
.tt-box-total {
  margin-bottom: 24px !important;
  padding: 16px 20px !important;
  background: var(--bg-secondary) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-light) !important;
}

.tt-box-total .tt_txt_g {
  color: var(--text-secondary) !important;
}

.tt-box-total .tt_num_g {
  color: var(--accent) !important;
  font-weight: 600 !important;
}

/* 댓글 리스트 */
.tt-area-reply,
.tt-list-reply {
  background: transparent !important;
}

.tt-item-reply {
  margin-bottom: 16px !important;
  padding: 20px 24px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius) !important;
  transition: border-color var(--transition) !important;
}

.tt-item-reply:hover {
  border-color: var(--border) !important;
}

/* 대댓글 들여쓰기 */
.tt-item-reply .tt-list-reply .tt-item-reply {
  margin-left: 20px !important;
  background: var(--bg-tertiary) !important;
}

/* 댓글 작성자 */
.tt-link-user {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

/* 댓글 날짜 */
.tt-box-meta time,
.tt_cmt_profile {
  font-size: 12px !important;
  color: var(--text-muted) !important;
}

/* 댓글 본문 */
.tt-wrap-desc,
.tt-box-content p {
  font-size: 15px !important;
  line-height: 1.8 !important;
  color: var(--text-secondary) !important;
}

/* 댓글 버튼들 */
.tt-box-meta button,
.tt-wrap-link a {
  color: var(--text-muted) !important;
  font-size: 13px !important;
  transition: color var(--transition) !important;
}

.tt-box-meta button:hover,
.tt-wrap-link a:hover {
  color: var(--accent) !important;
}

/* 댓글 작성 폼 */
.tt-box-write {
  padding: 24px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius) !important;
  margin-top: 24px !important;
}

.tt-box-write textarea {
  width: 100% !important;
  min-height: 120px !important;
  padding: 16px !important;
  margin-bottom: 16px !important;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  color: var(--text-primary) !important;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  outline: none !important;
  resize: vertical !important;
}

.tt-box-write textarea:focus {
  border-color: var(--accent) !important;
}

.tt-box-write textarea::placeholder {
  color: var(--text-muted) !important;
}

/* 이름/비밀번호 입력 */
.tt-box-write input[type="text"],
.tt-box-write input[type="password"] {
  display: inline-block !important;
  width: calc(50% - 8px) !important;
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  margin-right: 16px !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  color: var(--text-primary) !important;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  outline: none !important;
}

.tt-box-write input[type="password"] {
  margin-right: 0 !important;
}

.tt-box-write input:focus {
  border-color: var(--accent) !important;
}

.tt-box-write input::placeholder {
  color: var(--text-muted) !important;
}

/* 등록 버튼 */
.tt-box-write button[type="submit"],
.tt-btn-register {
  display: inline-block !important;
  padding: 12px 28px !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--bg-primary) !important;
  background: var(--accent) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  transition: background var(--transition) !important;
}

.tt-box-write button[type="submit"]:hover,
.tt-btn-register:hover {
  background: var(--accent-light) !important;
}

/* 비밀글 체크박스 */
.tt-box-write label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-right: 16px !important;
  font-size: 13px !important;
  color: var(--text-muted) !important;
}

.tt-box-write input[type="checkbox"] {
  accent-color: var(--accent) !important;
}

/* 댓글 없을 때 */
.tt-txt-empty {
  text-align: center !important;
  padding: 40px !important;
  color: var(--text-muted) !important;
  font-size: 14px !important;
}

/* ===== Protected Content ===== */
.protected-content {
  text-align: center;
  padding: 80px var(--spacing);
  max-width: var(--content-width);
  margin: 0 auto;
}

.protected-icon {
  font-size: 48px;
  margin-bottom: 24px;
}

.protected-title {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 12px;
}

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

.protected-form {
  display: inline-flex;
  gap: 8px;
}

.protected-form input {
  padding: 14px 20px;
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
}

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

.protected-form button {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--bg-primary);
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.protected-form button:hover {
  background: var(--accent-light);
}

/* ===== Guestbook ===== */
.guestbook-section {
  max-width: var(--content-width);
  margin: 0 auto;
}

.guestbook-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.page-link,
.page-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.page-link:hover,
.page-num:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-num.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.page-numbers {
  display: flex;
  gap: 4px;
}

/* ===== Footer ===== */
#footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 60px var(--spacing);
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-brand .logo-icon {
  font-size: 24px;
}

.footer-brand .brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
}

.footer-brand .brand-slogan {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 10px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

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

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-copy a {
  color: var(--accent);
}

/* ===== Scroll Top Button ===== */
.btn-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 1000;
}

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

.btn-scroll-top:hover {
  background: var(--accent-light);
  transform: translateY(-3px);
}

/* ===== Hide Profile Box & Unwanted Elements ===== */
.tt_article_useless_p_skin,
.area_profile,
.profile_area,
.box_profile,
.tt-box-account,
div[data-tistory-react-app="Profile"],
div[data-tistory-react-app="Subscription"] {
  display: none !important;
}

/* 본문 하단 점 3개 (슬라이드 인디케이터 등) 숨기기 */
.tt-paging-wrap,
.tt_pagination,
.tt-body-page .tt-area-paging,
.article-body .tt-paging,
.container_postbtn + .tt-pagination,
.tt-wrap-paging,
/* 캐러셀/슬라이드 인디케이터 */
.carousel-indicators,
.slide-indicators,
.tt-slide-indicator,
.indicator-dots,
/* 구분점 스타일 */
.article-body > p:empty + p:empty + p:empty,
.article-body hr + p:empty,
.article-body center:has(only-child:is(:empty, br)),
.article-body p:has(only-child:is(br)),
/* 빈 단락 처리 */
.article-body > p:only-child:empty {
  display: none !important;
}

/* 티스토리 자동 생성 구분선 스타일 제거 */
.article-body > div:empty,
.article-body > span:empty,
.article-body > center:empty {
  display: none !important;
}

/* 본문 내 점 3개 패턴 숨기기 (• • • 형태) */
.article-body p {
  /* 점 3개만 있는 단락 숨기기 */
}

.article-body p:only-child,
.article-body center:only-child {
  /* 내용이 없는 경우에만 적용 */
}

/* ===== Tistory Editor Elements ===== */
figure.imageblock {
  text-align: center;
  margin: 32px 0;
}

figure.imageblock img {
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Link Card */
.og-container,
.og_box {
  margin: 32px 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .card-thumbnail {
    width: 240px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --spacing: 20px;
  }
  
  .logo-sub {
    display: none;
  }
  
  /* 모바일에서 이메일 줄바꿈 */
  .author-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .author-separator {
    display: none;
  }
  
  .reading-time {
    border-left: none;
    padding-left: 0;
  }
  
  .card-link {
    flex-direction: column;
  }
  
  .card-thumbnail {
    width: 100%;
    height: 200px;
    min-height: auto;
  }
  
  .article-header .article-title {
    font-size: 26px;
  }
  
  /* 액션바 반응형 */
  .article-action-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .action-buttons {
    width: 100%;
  }
  
  .action-btn {
    flex: 1;
    justify-content: center;
  }
  
  .article-body {
    font-size: 16px;
  }
  
  .article-body h2 {
    font-size: 24px;
  }
  
  .sidebar-panel {
    width: 100%;
  }
  
  .post-nav {
    grid-template-columns: 1fr;
  }
  
  /* 댓글 반응형 */
  .comment-item {
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }
  
  .comment-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .comment-item.rp_child,
  .comment-item[class*="child"] {
    margin-left: 20px;
  }
  
  .comment-item.rp_child::before,
  .comment-item[class*="child"]::before {
    display: none;
  }
  
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .comment-form {
    padding: 20px;
  }
  
  .comment-content .embedded-video {
    max-width: 100%;
  }
  
  .tt-box-write input[type="text"],
  .tt-box-write input[type="password"] {
    width: 100% !important;
    margin-right: 0 !important;
  }
  
  .btn-scroll-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
  
  .protected-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .card-content {
    padding: 16px;
  }
  
  .card-title {
    font-size: 18px;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== Force Display Comment & Hide Dots ===== */
/* 댓글 영역 강제 표시 */
.comment-section,
.comment-container,
.tt-comment-cont,
#comment {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
  max-height: none !important;
}

/* 본문 내 점 3개 (•••, ···, ...) 패턴 숨기기 */
.article-body p:empty,
.article-body center:empty,
.article-body div:empty {
  display: none !important;
}

/* 점만 있는 텍스트 숨기기 (br 태그만 있는 경우 포함) */
.article-body > br:only-child,
.article-body p > br:only-child {
  display: none !important;
}

/* 슬라이드 인디케이터/페이징 완전 숨기기 */
.tt-wrap-paging,
.tt-paging-wrap,
.article-body .paging,
.article-body [class*="indicator"],
.article-body [class*="pagination"] {
  display: none !important;
}

/* ===== Print ===== */
@media print {
  #header,
  #sidebar,
  #searchModal,
  .comment-section,
  .pagination,
  #footer,
  .article-actions,
  .post-nav,
  .btn-scroll-top {
    display: none !important;
  }
  
  #main {
    padding-top: 0;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  .article-single {
    max-width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   구독 버튼 숨기기 (안전한 선택자만 사용)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 티스토리 구독 버튼 */
.btn_menu_toolbar.btn_subscription,
button.btn_subscription,
.container_postbtn .btn_subscription,
#tistorySnsLayer {
  display: none !important;
  visibility: hidden !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   블로그 소개 박스 숨기기 (안전한 선택자만)
   ═══════════════════════════════════════════════════════════════════════════ */

.tt_article_useless_p_skin,
.area_profile,
.profile_area,
.box_profile,
.tt-box-account,
.tt-box-blog,
.tt_box_namecard,
.tt_box_namecard_layer,
.tt-area-profile,
div[data-tistory-react-app="Profile"],
div[data-tistory-react-app="Subscription"] {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   대댓글 스타일 (s_rp2_container 용)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 대댓글 컨테이너 */
.comment-item.comment-reply {
  margin-left: 56px;
  margin-top: 12px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(212, 175, 55, 0.05) 100%);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  position: relative;
  display: flex;
  gap: 16px;
}

/* 대댓글 화살표 */
.comment-item.comment-reply .reply-arrow {
  position: absolute;
  left: -40px;
  top: 24px;
  font-size: 20px;
  color: var(--accent);
  opacity: 0.8;
}

/* 대댓글 아바타 */
.comment-item.comment-reply .reply-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 14px;
}

.comment-item.comment-reply .reply-avatar .avatar-icon {
  font-size: 14px;
}

/* 라이트모드 대댓글 */
body.light-mode .comment-item.comment-reply {
  background: linear-gradient(135deg, #F5F7FA 0%, rgba(212, 175, 55, 0.08) 100%);
}

body.light-mode .comment-item.comment-reply .reply-avatar {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

/* 기존 rp_child 클래스 대댓글 스타일 (하위 호환) */
.comment-item.rp_child {
  margin-left: 56px !important;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
  border-left: 3px solid var(--accent) !important;
  position: relative;
}

.comment-item.rp_child::before {
  content: '↳';
  position: absolute;
  left: -36px;
  top: 24px;
  font-size: 20px;
  color: var(--accent);
  opacity: 0.8;
}

.comment-item.rp_child .comment-avatar {
  width: 36px !important;
  height: 36px !important;
  font-size: 14px;
  background: transparent !important;
  border: 2px solid var(--accent) !important;
  color: var(--accent) !important;
}

body.light-mode .comment-item.rp_child {
  background: linear-gradient(135deg, #F5F7FA 0%, rgba(212, 175, 55, 0.08) 100%) !important;
}
