/* =============================================
   정책자금정보 - 메인 스타일시트
   ============================================= */

/* ── CSS 변수 ── */
:root {
  --primary:    #1a56db;
  --primary-dk: #1143b0;
  --accent:     #ff6b00;
  --success:    #0e9f6e;
  --danger:     #e02424;
  --warning:    #d97706;

  --text:       #111827;
  --text-2:     #4b5563;
  --text-3:     #9ca3af;
  --border:     #e5e7eb;
  --bg:         #f9fafb;
  --bg-card:    #ffffff;

  --font:       'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);

  --container:  1200px;
  --sidebar-w:  280px;
}

/* ── 리셋 / 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── 접근성 ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 6px;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 1000;
}
.skip-link:focus { left: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── 레이아웃 ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 48px;
  align-items: start;
}
.main-area { min-width: 0; }

/* ── 헤더 ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.logo a {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.logo-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  white-space: nowrap;
}

.header-search {
  flex: 1;
  max-width: 480px;
  margin-left: auto;
}
.header-search form {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0 16px;
  transition: border-color .2s;
}
.header-search form:focus-within { border-color: var(--primary); }
.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: .9rem;
  outline: none;
  color: var(--text);
}
.header-search button {
  color: var(--text-3);
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color .2s;
}
.header-search button:hover { color: var(--primary); }

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
}
.mobile-menu-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: all .3s;
}

/* ── 모바일 드롭다운 메뉴 ── */
/* hidden 속성으로 기본 숨김 처리 (CSS 미로딩 시에도 안전) */
#mobile-menu[hidden] { display: none !important; }
#mobile-menu:not([hidden]) {
  display: block;
  background: var(--primary);
  border-top: 1px solid rgba(255,255,255,.15);
}

.mobile-menu-inner { padding: 4px 0 8px; }

/* 모바일 메뉴 내 검색창 */
.mobile-search-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.mobile-search-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  font-size: .9rem;
  background: rgba(255,255,255,.18);
  color: #fff;
  outline: none;
}
.mobile-search-form input::placeholder { color: rgba(255,255,255,.55); }
.mobile-search-form button {
  padding: 9px 16px;
  background: rgba(255,255,255,.22);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.mobile-search-form button:hover { background: rgba(255,255,255,.32); }

/* 모바일 메뉴 내 카테고리 목록 */
.mobile-nav-list { list-style: none; }
.mobile-nav-list li a {
  display: block;
  padding: 13px 16px;
  color: rgba(255,255,255,.88);
  font-size: .92rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: background .15s;
}
.mobile-nav-list li:last-child a { border-bottom: none; }
.mobile-nav-list li a:hover { background: rgba(255,255,255,.1); color: #fff; }
.mobile-nav-list li a[aria-current="page"] {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 700;
  border-left: 3px solid #fff;
  padding-left: 13px;
}

/* ── 카테고리 내비 ── */
.category-nav {
  background: var(--primary);
}
.nav-list {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list a {
  display: block;
  padding: 10px 16px;
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all .2s;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: #fff;
  border-bottom-color: #fff;
}

/* ── 브레드크럼 ── */
.breadcrumb-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: .8rem;
  color: var(--text-3);
  flex-wrap: wrap;
}
.breadcrumb li + li::before { content: '›'; margin-right: 6px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* ── 섹션 타이틀 ── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
}
.section-title .total-count {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-3);
}

/* ── 게시글 목록 ── */
.post-list { display: flex; flex-direction: column; gap: 2px; }

.post-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .2s, transform .2s;
}
.post-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.notice-item { border-left: 4px solid var(--accent); }

.post-link {
  display: block;
  padding: 16px 20px;
  color: inherit;
}

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.post-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.post-title-large {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}
.post-link:hover .post-title { color: var(--primary); }

.post-excerpt {
  font-size: .875rem;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.5;
}
.post-lead {
  font-size: 1.05rem;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.6;
}

.post-meta-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--text-3);
}
.fund-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 700;
  font-size: .82rem;
}
.fund-agency { color: var(--text-2); }
.fund-target { color: var(--text-2); }
.view-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ── 배지 ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-notice  { background: #fef3c7; color: #92400e; }
.badge-open    { background: #d1fae5; color: #065f46; }
.badge-soon    { background: #fee2e2; color: #991b1b; }
.badge-closed  { background: #f3f4f6; color: #6b7280; }
.badge-draft   { background: #e0e7ff; color: #3730a3; }

.category-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 600;
}

/* ── 게시글 상세 ── */
.post-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 20px;
  margin-bottom: 20px;
}

.post-meta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-3);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.post-meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 정책자금 요약 박스 */
.fund-summary-box {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.fund-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}
.fund-summary-grid { display: flex; flex-direction: column; gap: 8px; }
.fund-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e0edff;
}
.fund-row:last-child { border-bottom: none; }
.fund-row dt { font-size: .875rem; color: var(--text-2); font-weight: 500; }
.fund-row dd { font-size: .875rem; color: var(--text); }
.fund-highlight { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  transition: background .2s;
}
.btn-apply:hover { background: var(--primary-dk); color: #fff; }

/* 본문 콘텐츠 */
.post-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  line-height: 1.8;
}
.post-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}
.post-content h2:first-child { margin-top: 0; }
.post-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
}
.post-content p { margin-bottom: 12px; color: var(--text-2); }
.post-content ul, .post-content ol {
  margin: 0 0 16px 20px;
  list-style: disc;
  color: var(--text-2);
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 4px; }
.post-content strong { color: var(--text); font-weight: 700; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: .9rem;
}
.post-content th, .post-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th { background: var(--bg); font-weight: 600; }
.post-content tr:hover td { background: #fafafa; }
mark { background: #fef9c3; padding: 0 2px; border-radius: 2px; }

/* 태그 */
.post-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.tag-link {
  padding: 4px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: .8rem;
  color: var(--text-2);
  transition: all .2s;
}
.tag-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 공유 버튼 */
.post-share {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .875rem;
  color: var(--text-2);
}
.share-btn {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .85; }
.share-kakao { background: #fee500; color: #3c1e1e; }
.share-copy  { background: var(--bg); border: 1px solid var(--border); color: var(--text-2); }

/* 이전/다음 글 */
.post-nav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-nav-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
}
.post-nav-item + .post-nav-item { border-top: 1px solid var(--border); }
.nav-label {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--text-3);
  font-weight: 500;
  width: 50px;
}
.post-nav-item a { color: var(--text); }
.post-nav-item a:hover { color: var(--primary); }

/* ── 사이드바 ── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.widget-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.widget-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: .875rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: all .15s;
}
.widget-list li:last-child a { border-bottom: none; }
.widget-list li a:hover { background: var(--bg); color: var(--primary); }
.widget-list li a.active { color: var(--primary); font-weight: 600; }
.widget-list .count {
  font-size: .75rem;
  color: var(--text-3);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 8px;
}
.external-links a::after { content: ' ↗'; font-size: .7rem; color: var(--text-3); }

.widget-rank-list li { border-bottom: 1px solid var(--border); }
.widget-rank-list li:last-child { border-bottom: none; }
.widget-rank-list li a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  font-size: .82rem;
  color: var(--text-2);
  transition: all .15s;
}
.widget-rank-list li a:hover { background: var(--bg); color: var(--primary); }
.rank-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-title { line-height: 1.4; }

.widget-post-list li { border-bottom: 1px solid var(--border); }
.widget-post-list li:last-child { border-bottom: none; }
.widget-post-list li a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  transition: background .15s;
}
.widget-post-list li a:hover { background: var(--bg); }
.widget-post-title { font-size: .82rem; color: var(--text); line-height: 1.4; }
.widget-fund { font-size: .75rem; color: var(--primary); font-weight: 600; }
.widget-date { font-size: .72rem; color: var(--text-3); }
.widget-text { padding: 12px 16px; font-size: .875rem; color: var(--text-2); line-height: 1.6; }

/* ── 카테고리 페이지 헤더 ── */
.category-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.category-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}
.category-desc {
  font-size: .9rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.category-count {
  font-size: .85rem;
  color: var(--text-3);
}
.category-count strong { color: var(--primary); }

/* ── 검색 페이지 ── */
.search-page-header { margin-bottom: 20px; }
.search-form-large {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.search-form-large input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
.search-form-large input:focus { border-color: var(--primary); }
.search-result-info {
  font-size: .875rem;
  color: var(--text-2);
  margin-bottom: 16px;
}
.search-result-info strong { color: var(--primary); }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.hint-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-top: 16px;
}

/* ── 페이지네이션 ── */
.pagination { margin-top: 24px; text-align: center; }
.pagination ul {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.pagination li a,
.pagination li .current {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text-2);
  background: var(--bg-card);
  transition: all .15s;
}
.pagination li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li .current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── 빈 상태 ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state p { margin-bottom: 16px; font-size: 1.05rem; }
.empty-state svg { margin: 0 auto 16px; }
.hint { font-size: .875rem !important; }

/* ── 알림 / 경고 ── */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: .9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }
.alert ul { margin-left: 16px; list-style: disc; }

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn-primary:hover { background: var(--primary-dk); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-block { width: 100%; }

/* ── 에러 페이지 ── */
.error-page {
  text-align: center;
  padding: 80px 20px;
}
.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}
.error-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.error-desc { color: var(--text-2); margin-bottom: 24px; line-height: 1.7; }
.error-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 32px; }
.error-categories p { color: var(--text-3); font-size: .875rem; margin-bottom: 12px; }
.error-categories ul { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; }
.error-categories a { padding: 6px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; }
.error-categories a:hover { border-color: var(--primary); color: var(--primary); }

/* ── 공지 섹션 ── */
.notice-section { margin-bottom: 24px; }
.posts-section { margin-bottom: 24px; }

/* ── 푸터 ── */
.site-footer {
  background: #1f2937;
  color: #d1d5db;
  margin-top: auto;
}
.footer-inner { padding: 40px 0 0; }
.footer-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #374151;
}
.footer-col h3 {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 6px; }
.footer-col li a {
  font-size: .85rem;
  color: #9ca3af;
  transition: color .15s;
}
.footer-col li a:hover { color: #fff; }
.footer-about p { font-size: .85rem; line-height: 1.6; margin-bottom: 8px; }
.footer-notice { font-size: .75rem !important; color: #6b7280 !important; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.copyright { font-size: .8rem; color: #6b7280; }
.footer-bottom nav { display: flex; gap: 16px; }
.footer-bottom nav a { font-size: .8rem; color: #6b7280; }
.footer-bottom nav a:hover { color: #fff; }

/* ── 테이블 모바일 스크롤 (기본) ── */
.post-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  white-space: nowrap;
}
.post-content th,
.post-content td {
  white-space: normal;
  min-width: 80px;
}

/* ── 한국어 줄바꿈 ── */
body { word-break: keep-all; overflow-wrap: break-word; }

/* ── 반응형 ── */

/* 태블릿 (≤900px) */
@media (max-width: 900px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 32px;
  }
  .sidebar { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* 모바일 (≤640px) */
@media (max-width: 640px) {
  :root { --container: 100%; }
  .container { padding: 0 14px; }

  /* ── 헤더 ── */
  .header-inner { height: 54px; gap: 10px; }
  .logo-sub { display: none; }
  .header-search { display: none; }
  .mobile-menu-btn { display: flex; margin-left: auto; flex-shrink: 0; }

  /* ── 데스크탑 카테고리 nav 숨기고 모바일 메뉴로 대체 ── */
  .category-nav { display: none; }

  /* ── 레이아웃 ── */
  .layout-with-sidebar {
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 24px;
  }

  /* ── 게시글 목록 ── */
  .post-list { gap: 8px; }
  .post-link { padding: 14px 14px; }
  .post-title { font-size: .95rem; }
  .post-excerpt { font-size: .82rem; }
  .post-meta-bottom { gap: 8px; font-size: .75rem; }
  .post-meta-top { flex-wrap: wrap; gap: 6px; }

  /* ── 게시글 상세 ── */
  .post-header { padding: 18px 16px 14px; }
  .post-title-large { font-size: 1.15rem; }
  .post-lead { font-size: .95rem; }
  .post-meta-info { gap: 10px; font-size: .78rem; }

  .post-content { padding: 18px 14px; }
  .post-content h2 { font-size: 1.05rem; padding-left: 10px; }
  .post-content h3 { font-size: .95rem; }
  .post-content p { font-size: .9rem; }
  .post-content ul, .post-content ol { margin-left: 16px; font-size: .9rem; }

  /* ── 정책자금 요약 박스 ── */
  .fund-summary-box { padding: 16px 14px; }
  .fund-row { grid-template-columns: 68px 1fr; gap: 6px; }
  .fund-row dt, .fund-row dd { font-size: .82rem; }
  .fund-highlight { font-size: 1rem; }
  .btn-apply { width: 100%; justify-content: center; margin-top: 14px; }

  /* ── 태그 / 공유 ── */
  .post-tags { padding: 12px 14px; }
  .post-share { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }

  /* ── 이전/다음 글 ── */
  .post-nav-item { padding: 12px 14px; font-size: .82rem; }
  .nav-label { width: 40px; font-size: .72rem; }

  /* ── 카테고리 헤더 ── */
  .category-header { padding: 18px 14px; }
  .category-title { font-size: 1.15rem; }

  /* ── 검색 ── */
  .search-page-header { margin-bottom: 14px; }
  .search-form-large { flex-direction: column; gap: 8px; }
  .search-form-large .btn { width: 100%; }

  /* ── 섹션 타이틀 ── */
  .section-title { font-size: 1rem; }

  /* ── 푸터 ── */
  .footer-inner { padding: 28px 0 0; }
  .footer-top { grid-template-columns: 1fr; gap: 20px; padding-bottom: 24px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .footer-col li a { font-size: .82rem; }

  /* ── 에러 페이지 ── */
  .error-page { padding: 48px 16px; }
  .error-code { font-size: 4rem; }
  .error-actions { flex-direction: column; align-items: center; }

  /* ── 페이지네이션 ── */
  .pagination li a,
  .pagination li .current { min-width: 34px; height: 34px; font-size: .8rem; }
}

/* 아주 작은 화면 (≤380px) */
@media (max-width: 380px) {
  .logo-text { font-size: 1.05rem; }
  .post-title { font-size: .88rem; }
  .post-title-large { font-size: 1rem; }
  .fund-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .fund-row dt {
    font-size: .75rem;
    color: var(--text-3);
    font-weight: 700;
  }
  .post-content { padding: 14px 12px; }
  .fund-summary-box { padding: 14px 12px; }
}

@media print {
  .site-header, .category-nav, .sidebar, .site-footer, .post-nav, .post-share { display: none !important; }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .post-content { border: none; padding: 0; }
}
