/* ============================================
   지원금 연구소 — 한이룸 스타일 리디자인
   심플 3컬럼: 프로필 | 소개+피드 | 최근글
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-sub: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  height: auto !important;
  overflow: visible !important;
  overflow-y: scroll !important;
}

body {
  height: auto !important;
  overflow: visible !important;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* ===== 3-COLUMN LAYOUT ===== */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 200px 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* ===== LEFT SIDEBAR ===== */
.sidebar-left {
  position: sticky;
  top: 40px;
  align-self: start;
}

.profile-area {
  margin-bottom: 32px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.profile-name a {
  color: var(--text);
}

.profile-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Nav Section */
.nav-section {
  margin-bottom: 28px;
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.nav-menu ul {
  list-style: none;
}

.nav-menu ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-sub);
  transition: color 0.15s;
}

.nav-menu ul li a:hover {
  color: var(--text);
}

/* 방문자 */
.visitor-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-sub);
}

.visitor-row strong {
  color: var(--text);
  font-weight: 700;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  min-width: 0;
}

/* ===== TOP BANNER ===== */
.top-banner {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
  padding: 24px 28px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  line-height: 1.7;
}

.top-banner p {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* ===== INTRO CARD ===== */
.intro-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px;
  margin-bottom: 8px;
}

.intro-header {
  margin-bottom: 10px;
}

.intro-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #ecfdf5;
  color: #059669;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
}

.intro-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.intro-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.intro-desc {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 16px;
}

.intro-cta {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--text);
  color: #fff;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.intro-cta:hover {
  background: #333;
}

/* ===== FEED CARD (카드형) ===== */
.feed-card {
  margin-bottom: 32px;
}

.feed-card-link {
  display: block;
  transition: transform 0.2s;
}

.feed-card-link:hover {
  transform: translateY(-2px);
}

.feed-card-thumb {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--border-light);
}

.feed-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-card-body {
  padding: 16px 4px 0;
}

.feed-card-date {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.feed-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.3px;
}

.feed-card-link:hover .feed-card-title {
  color: var(--accent);
}

/* Section Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ===== FEED SECTION ===== */
.feed-section {
  /* no extra styles needed */
}

.feed-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.feed-subtitle {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 24px;
}

/* Feed Item */
.feed-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-body {
  flex: 1;
  min-width: 0;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.feed-category {
  color: var(--text-sub);
  font-weight: 500;
}

.feed-dot {
  color: var(--text-light);
}

.feed-item-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  transition: color 0.15s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.feed-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-light);
  transition: all 0.15s;
}

.feed-arrow:hover {
  background: var(--border-light);
  color: var(--text);
}

/* ===== POST DETAIL ===== */
.post-detail {
  padding: 0;
  margin-bottom: 24px;
}

.post-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

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

.post-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.post-meta-row {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  gap: 12px;
}

.post-content {
  font-size: 16px;
  line-height: 1.85;
  color: #374151;
  word-break: keep-all;
}

.post-content img {
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.post-content h2, .post-content h3, .post-content h4 {
  color: var(--text);
  margin: 32px 0 12px;
}

.post-content p { margin-bottom: 16px; }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  color: #1e40af;
}

.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 16px 0;
  font-family: 'Fira Code', monospace;
}

/* Tags */
.post-tags {
  margin: 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  display: inline-block;
  padding: 5px 14px;
  background: var(--border-light);
  color: var(--text-sub);
  border-radius: 20px;
  font-size: 13px;
  transition: all 0.15s;
}

.post-tags a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.post-like { text-align: center; margin: 24px 0; }

/* Post Navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.nav-prev, .nav-next {
  display: block;
  padding: 16px 20px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-prev:hover, .nav-next:hover { background: var(--accent-light); }
.nav-next { text-align: right; }

.nav-label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.nav-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== COMMENTS ===== */
.comments-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.comment-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.comment-count { color: var(--accent); }

.comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-item.rp_entry { margin-left: 32px; padding-left: 16px; border-left: 2px solid var(--border); }

.comment-author-info { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-author { font-size: 14px; font-weight: 600; }
.comment-date { font-size: 12px; color: var(--text-light); }
.comment-body { font-size: 14px; color: var(--text-sub); line-height: 1.6; }
.comment-actions { margin-top: 8px; font-size: 12px; }
.comment-actions a { color: var(--text-light); margin-right: 8px; }
.comment-actions a:hover { color: var(--accent); }

.comment-form { margin-top: 20px; }
.comment-input-wrap { background: var(--border-light); border-radius: var(--radius-sm); padding: 16px; }
.comment-guest-info { display: flex; gap: 8px; margin-bottom: 10px; }
.comment-input-field {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  background: #fff; outline: none;
}
.comment-input-field:focus { border-color: var(--accent); }
.comment-textarea {
  width: 100%; min-height: 80px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: #fff; resize: vertical; outline: none;
}
.comment-textarea:focus { border-color: var(--accent); }
.comment-submit-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.comment-secret { font-size: 13px; color: var(--text-light); display: flex; align-items: center; gap: 4px; }
.btn-submit {
  padding: 8px 24px; background: var(--text); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-submit:hover { background: #333; }

/* ===== RIGHT SIDEBAR ===== */
.sidebar-right {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.right-section {}

.right-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.right-list {
  list-style: none;
}

.right-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.right-item:last-child { border-bottom: none; }

.right-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.right-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.right-item-info {
  flex: 1;
  min-width: 0;
}

.right-item-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.15s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.right-item-date {
  font-size: 12px;
  color: var(--text-light);
}

/* 최근 블로그 3개만 표시 */
.right-list .right-item:nth-child(n+4) {
  display: none;
}

.right-more {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  text-align: center;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.right-more:hover { background: #333; }

/* Subscribe Card */
.subscribe-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.subscribe-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.subscribe-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

/* Category */
.category-list ul { list-style: none; }
.category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-sub);
  transition: color 0.15s;
}
.category-list li a:hover { color: var(--text); }
.category-list .link_tit { font-weight: 600; color: var(--text); flex: 1; }
.category-list .c_cnt {
  font-size: 12px;
  color: var(--text-light);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}
/* 카테고리 RSS 아이콘 숨김 */
.category-list img,
.category-list .ico_rss,
.category-list .link_rss {
  display: none !important;
}
.category-list ul ul { margin-left: 14px; }
.category-list ul ul a { font-size: 12px; }

/* ===== TAG CLOUD ===== */
.tag-cloud-section { margin-bottom: 24px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag-item {
  display: inline-block; padding: 6px 14px;
  background: var(--border-light); border-radius: 20px;
  font-size: 13px; color: var(--text-sub); transition: all 0.15s;
}
.tag-item:hover, .tag-item.cloud_select { background: var(--accent-light); color: var(--accent); }

/* ===== OTHER SECTIONS ===== */
.guestbook-section { margin-bottom: 24px; }
.search-result-section { margin-bottom: 24px; }

.protected-post {
  padding: 48px 32px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.protected-icon { font-size: 48px; margin-bottom: 16px; }
.protected-post h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.protected-post p { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; }
.protected-post form { display: flex; justify-content: center; gap: 8px; max-width: 320px; margin: 0 auto; }

/* 홈에서 전체글 검색결과 숨김 */
.search-result-section {
  display: none;
}

/* ===== PAGINATION (숨김 - 더보기 버튼 사용) ===== */
.pagination { display: none; }

/* ===== TISTORY ===== */
#tistorytoolbarid { z-index: 9999 !important; }
.another_category { display: none; }

/* 글 상세 페이지에서 소개 영역 숨기기 */
body[id] .top-banner,
body[id] .intro-card,
body[id] .section-divider,
body[id] .feed-title,
body[id] .feed-subtitle { }

#tt-body-page .top-banner,
#tt-body-page .intro-card,
#tt-body-page .section-divider,
#tt-body-page .feed-title,
#tt-body-page .feed-subtitle,
#tt-body-page .load-more-wrap { display: none; }

/* ===== LOAD MORE BUTTON ===== */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.load-more-btn {
  width: 100%;
  max-width: 480px;
  padding: 16px 24px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: -0.2px;
}

.load-more-btn:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== CALENDAR ===== */
.calendar-wrap {
  margin-top: 4px;
}

.calendar-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: center;
}

.calendar-wrap th {
  padding: 4px 0;
  font-weight: 600;
  color: var(--text-light);
  font-size: 10px;
}

.calendar-wrap th:first-child { color: #ef4444; }
.calendar-wrap th:last-child { color: #3b82f6; }

.calendar-wrap td {
  padding: 3px 0;
  color: var(--text-light);
  font-size: 11px;
}

.calendar-wrap td a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.calendar-wrap .cal_day_today {
  background: var(--accent);
  color: #fff !important;
  border-radius: 50%;
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
}

.calendar-wrap caption {
  font-size: 12px;
  font-weight: 600;
  padding-bottom: 6px;
  color: var(--text);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .page-wrapper {
    grid-template-columns: 180px 1fr;
    gap: 32px;
  }
  .sidebar-right { display: none; }
}

@media (max-width: 768px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 24px;
  }

  .sidebar-left {
    position: static;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .profile-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
  }

  .nav-section { display: none; }

  .intro-title { font-size: 22px; }
  .intro-stats { gap: 24px; }
  .stat-num { font-size: 22px; }

  .feed-thumb { width: 64px; height: 64px; }

  .post-title { font-size: 22px; }
  .post-navigation { grid-template-columns: 1fr; }

  .sidebar-right {
    display: flex;
    position: static;
  }
}

@media (max-width: 480px) {
  .intro-stats { flex-wrap: wrap; gap: 16px; }
  .comment-guest-info { flex-direction: column; }
}