/* ============================================================
   SEcMS Blog — Dark Theme v4 (2026-07-01)
   GitHub Dark: #0d1117 배경, #161b22 카드, #e6edf3 텍스트
   WCAG 2.1 대비비: 본문 ~15:1, muted ~5.5:1, 썸네일 카운터 ✅
   클래스 계약 100% 보존 + 신규 .posts-grid/.post-thumb/.post-body/.cat-tabs/.brand-* 추가
   ============================================================ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  /* ── 다크 팔레트 ── */
  --bg:          #0d1117;   /* 전체 배경 */
  --bg-card:     #161b22;   /* 카드/패널 배경 */
  --bg-soft:     #1c2128;   /* 보조 배경 (입력·인라인 코드) */
  --ink:         #e6edf3;   /* 메인 텍스트 (~15:1 on #0d1117) */
  --ink-2:       #cdd9e5;   /* 본문 텍스트 (~12:1) */
  --muted:       #8b949e;   /* 메타·보조 (~5.5:1 on #161b22) */
  --line:        #30363d;   /* 경계선 */
  --line-hover:  #444c56;
  --accent:      #58a6ff;   /* 블루 액센트 (링크) */
  --accent-org:  #f97316;   /* 오렌지 CTA */
  --maxw:        1240px;
  --radius:      12px;
  --radius-sm:   8px;
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --shadow:      0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 20px 48px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
::selection { background: #1f3a5f; color: #e6edf3; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s var(--ease);
}
a:hover { color: #79c0ff; }
img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════
   NAV — sticky 다크 네비 (.nav = .site-nav 공용)
═══════════════════════════════════════════════════ */
.site-nav,
.nav {
  background: rgba(13, 17, 23, 0.92);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 1.5rem;
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 1.5rem;
}

/* 로고 영역 */
.nav-logo,
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}

/* 메인 로고 이미지 */
.nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 1px;
}

/* 카테고리 탭 */
.cat-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tabs a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  border-radius: 6px;
  transition: color .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.cat-tabs a:hover {
  color: var(--ink);
  background: rgba(48, 54, 61, 0.6);
}
.cat-tabs a.active {
  color: var(--ink);
  background: var(--bg-soft);
}

/* 레거시 .nav-links 지원 */
.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  border-radius: 6px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover {
  color: var(--ink);
  background: rgba(48, 54, 61, 0.6);
}

/* CTA 버튼 */
.nav-cta {
  background: var(--accent-org) !important;
  color: #fff !important;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 800 !important;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}
.nav-cta:hover {
  background: #ea580c !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(249,115,22,0.5);
}

/* ═══════════════════════════════════════════════════
   BLOG LAYOUT — 메인 2컬럼 그리드
═══════════════════════════════════════════════════ */
.blog-grid,
.blog-layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}

.blog-main {
  min-width: 0;
}
/* article 밖에 떠있는 빈 .read-more 링크 숨김 (HTML 구조상 article 다음 형제로 오는 것) */
.blog-main > a.read-more {
  display: none;
}

.blog-page-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.blog-page-title::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 40px; height: 1px;
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════
   POSTS GRID — 카드 그리드 (CSS counter 포함)
═══════════════════════════════════════════════════ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  counter-reset: pcard;
}

/* ── 카드 ── */
.post-item {
  counter-increment: pcard;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.post-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-hover);
}

/* 썸네일 그라디언트 (CSS counter 번호 우하단) */
.post-thumb {
  height: 120px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.post-thumb::after {
  content: counter(pcard, decimal-leading-zero);
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 2rem;
  font-weight: 900;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  line-height: 1;
  letter-spacing: -0.04em;
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

/* 8사이클 그라디언트 */
.post-item:nth-child(8n+1) .post-thumb { background: linear-gradient(135deg,#1e3a8a,#3b82f6); }
.post-item:nth-child(8n+2) .post-thumb { background: linear-gradient(135deg,#6d28d9,#a78bfa); }
.post-item:nth-child(8n+3) .post-thumb { background: linear-gradient(135deg,#c2410c,#f97316); }
.post-item:nth-child(8n+4) .post-thumb { background: linear-gradient(135deg,#065f46,#10b981); }
.post-item:nth-child(8n+5) .post-thumb { background: linear-gradient(135deg,#1e1b4b,#7c3aed); }
.post-item:nth-child(8n+6) .post-thumb { background: linear-gradient(135deg,#7f1d1d,#ef4444); }
.post-item:nth-child(8n+7) .post-thumb { background: linear-gradient(135deg,#0c4a6e,#0ea5e9); }
.post-item:nth-child(8n+8) .post-thumb { background: linear-gradient(135deg,#4a1d96,#ec4899); }

/* data-cat 속성 기반 그라디언트 (선택적) */
.post-item[data-cat="routing"] .post-thumb      { background: linear-gradient(135deg,#1e3a8a,#3b82f6); }
.post-item[data-cat="fill"] .post-thumb         { background: linear-gradient(135deg,#6d28d9,#a78bfa); }
.post-item[data-cat="install"] .post-thumb      { background: linear-gradient(135deg,#c2410c,#f97316); }
.post-item[data-cat="bom"] .post-thumb          { background: linear-gradient(135deg,#065f46,#10b981); }
.post-item[data-cat="class"] .post-thumb        { background: linear-gradient(135deg,#1e1b4b,#7c3aed); }
.post-item[data-cat="analysis"] .post-thumb     { background: linear-gradient(135deg,#7f1d1d,#ef4444); }
.post-item[data-cat="saas"] .post-thumb         { background: linear-gradient(135deg,#0c4a6e,#0ea5e9); }
.post-item[data-cat="guide"] .post-thumb        { background: linear-gradient(135deg,#4a1d96,#ec4899); }

/* 카드 바디 */
.post-body {
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 레거시 padding 지원 (post-body 없을 때) */
.post-item > .entry-cat:first-child {
  margin: 1.1rem 1.25rem 0;
}

.entry-cat {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(88,166,255,0.12);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

.entry-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.entry-title a {
  color: var(--ink);
  transition: color .2s var(--ease);
}
.entry-title a:hover { color: var(--accent); }

.entry-excerpt {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.entry-meta span { display: inline-flex; align-items: center; }
.entry-meta span:not(:last-child)::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--line-hover);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.75rem;
  transition: gap .2s var(--ease), color .2s var(--ease);
}
.read-more:hover {
  color: #79c0ff;
  gap: 0.55rem;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.widget,
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}

.widget-title,
.sidebar-card h4 {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  line-height: 1;
}

/* 사이드바 검색 */
.sidebar-card input[type="text"],
.sidebar-card input[type="search"] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s var(--ease);
}
.sidebar-card input[type="text"]:focus,
.sidebar-card input[type="search"]:focus {
  border-color: var(--accent);
}
.sidebar-card input::placeholder { color: var(--muted); }

/* 방문자 통계 (TODAY/YDAY/TOTAL) */
.sidebar-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.sidebar-stat-label { color: var(--muted); font-weight: 700; }
.sidebar-stat-value { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }

/* // POPULAR 섹션 */
.sidebar-popular {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.popular-item:last-child { border-bottom: none; }

.popular-rank {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 1.5rem;
  padding-top: 1px;
  flex-shrink: 0;
}
.popular-rank.top { color: var(--accent); }

.popular-info { flex: 1; min-width: 0; }
.popular-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s var(--ease);
}
.popular-title:hover { color: var(--accent); }
.popular-views {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* // CATEGORY 섹션 */
.sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  transition: background .2s var(--ease);
  text-decoration: none;
}
.cat-item:hover { background: var(--bg-soft); }
.cat-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-2);
}
.cat-item-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 1px 7px;
  border-radius: 99px;
}

/* 레거시 sidebar-links */
.sidebar-links { list-style: none; }
.sidebar-links li {
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}
.sidebar-links li:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-links a {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color .2s var(--ease);
}
.sidebar-links a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   RELATED CARDS
═══════════════════════════════════════════════════ */
.related-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.related-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--bg-soft);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
  display: block;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.related-card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 0.45rem;
  background: rgba(88,166,255,0.15);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.related-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.4;
}
.related-card:hover .related-card-title { color: var(--ink); }

/* ═══════════════════════════════════════════════════
   PAGE HEADER — 단일 포스트 헤더
═══════════════════════════════════════════════════ */
.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}
.page-header-inner {
  max-width: 780px;
  margin: 0 auto;
}
.breadcrumb {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.post-meta span { display: inline-flex; align-items: center; }
.post-meta .tag {
  display: inline-block;
  background: rgba(88,166,255,0.12);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* 포스트 히어로 이미지 (그라디언트 대체) */
.post-hero {
  width: 100%;
  height: 260px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6, #7c3aed);
  border-radius: 0;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ═══════════════════════════════════════════════════
   ARTICLE LAYOUT — 단일 포스트 본문
═══════════════════════════════════════════════════ */
.article-layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}

.article-body {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  min-width: 0;
}

/* ── 아티클 타이포그래피 ── */
.article-body p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.03em;
  position: relative;
}
.article-body h2::before {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 36px; height: 1px;
  background: var(--accent);
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  margin: 2rem 0 0.85rem;
  letter-spacing: -0.02em;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.4rem;
}
.article-body li {
  margin-bottom: 0.55rem;
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.75;
}

.article-body strong {
  color: var(--ink);
  font-weight: 800;
}

.article-body em {
  color: var(--muted);
  font-style: italic;
}

.article-body code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  color: #e06c75;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.article-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-2);
  font-size: 0.9rem;
}

/* 표 */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.75rem;
  font-size: 0.93rem;
}
.article-body th {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 800;
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.article-body td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}
.article-body tr:nth-child(even) td {
  background: rgba(22,27,34,0.5);
}
.article-body tr:hover td {
  background: rgba(48,54,61,0.4);
}

/* 강조 박스 */
.highlight-box {
  background: rgba(88,166,255,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.3rem 1.6rem;
  margin: 1.75rem 0;
}
.highlight-box h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.highlight-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}

/* CTA 블록 */
.cta-block {
  background: linear-gradient(135deg, rgba(249,115,22,0.08), rgba(234,88,12,0.12));
  border: 1.5px dashed rgba(249,115,22,0.4);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  margin-top: 3rem;
  text-align: center;
}
.cta-block h3 {
  font-size: 1.35rem;
  color: var(--accent-org);
  font-weight: 900;
  margin-bottom: 0.6rem;
}
.cta-block p {
  font-size: 0.93rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.cta-btn {
  background: var(--accent-org);
  color: #fff !important;
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.93rem;
  box-shadow: 0 4px 14px rgba(249,115,22,0.35);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249,115,22,0.5);
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  padding: 3.5rem 1.5rem 2.5rem;
  color: var(--muted);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}
.footer-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.footer-logo span { color: var(--accent); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}
.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color .2s var(--ease);
}
.footer-links a:hover { color: var(--ink); }

footer p {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════
   SITE HEADER (레거시 — WP 스타일 상단 헤더)
═══════════════════════════════════════════════════ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.site-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  display: inline-block;
  text-decoration: none;
}
.site-title b {
  background: linear-gradient(90deg, var(--accent-org), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.site-tagline {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

/* 레거시 .main-nav */
.main-nav {
  background: rgba(13,17,23,0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.main-nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav-inner::-webkit-scrollbar { display: none; }
.main-nav a {
  display: inline-block;
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — 768px 모바일
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .blog-grid,
  .blog-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-inner { height: 58px; gap: 0.75rem; }
  .cat-tabs  { display: none; }
  .nav-links { display: none; }

  .brand-name { font-size: 1rem; }
  .brand-sub  { display: none; }

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

  .blog-grid,
  .blog-layout {
    padding: 1.5rem 1rem 3rem;
  }

  .article-body {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-sm);
  }

  .page-header {
    padding: 2.5rem 1rem 2rem;
  }

  .article-layout {
    padding: 1.5rem 1rem 3rem;
  }

  footer { padding: 2.5rem 1rem 2rem; }

  .post-thumb { height: 100px; }
}

@media (max-width: 480px) {
  .nav-cta { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
  .entry-title { font-size: 0.95rem; }
}

/* ═══════════════════════════════════════════════════
   모바일 최적화 — v2 (2026-07-01, mobile-spa-blog-theme 이식)
   출처: SEcMS 블로그 모바일 최적화.zip
═══════════════════════════════════════════════════ */

/* 가로 스크롤 원천 차단 */
html, body { overflow-x: hidden; max-width: 100vw; }
body {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 터치 타깃 최소 44px (WCAG 2.5.5) */
.nav-cta, .cat-tabs a, .nav-links a { min-height: 44px; }
.cat-tabs a, .nav-links a { display: inline-flex; align-items: center; }
.cat-tabs a, .nav-links a, .footer-links a { touch-action: manipulation; }

/* iOS 노치·홈바 안전영역 (viewport-fit=cover 와 쌍) */
.nav-inner {
  padding-left:  max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}
footer {
  padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom) + 1rem));
}

/* iOS 입력 자동 확대 방지 (font-size ≥ 16px) */
input, select, textarea { font-size: 16px; }

/* img / svg max-width 안전망 */
img, svg, .post-item, .sidebar-card, .widget { max-width: 100%; }

/* 중간 해상도 (920px 이하) — 사이드바 스택 */
@media (max-width: 920px) {
  .blog-grid, .blog-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    max-width: none;
    width: 100%;
  }
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* 작은 모바일 (640px 이하) */
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .blog-grid, .blog-layout { padding: 1.25rem 0.9rem 3rem; }
  .post-thumb { height: 90px; }
  .brand-sub { display: none; }
  .nav-cta { display: none; }   /* 드로어 CTA가 없으니 작은 화면에서만 숨김 */
  .article-body { padding: 1.2rem 1rem; }
}

/* 매우 좁은 화면 (400px 이하) */
@media (max-width: 400px) {
  .nav-inner { gap: 0.5rem; }
  .brand-name { font-size: 0.95rem; }
}

/* prefers-reduced-motion 사용자 존중 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════
   모바일 최적화 — v3 (2026-07-23)
   기존 v1/v2 규칙은 건드리지 않고 "덧대기"만 한다.
   ① 본문 16px 하한(iOS 자동확대 방지) ② 표 가로스크롤 컨테이너
   ③ 긴 URL·코드 넘침 차단 ④ 헤딩 clamp() ⑤ 터치타깃 44px 확대
   ⑥ 대비 교정(WCAG 2.1 AA: 본문 4.5:1 / UI 3:1)
═══════════════════════════════════════════════════ */

/* ⑥ 대비 교정 — 흰 글자 CTA 버튼의 배경이 너무 밝아 2.80:1 이었다.
   오렌지 브랜드색(--accent-org)은 '글자색'으로 유지하고,
   버튼 '배경'만 어둡게(--cta-bg) 분리해 흰 글자 대비를 5.19:1 로 올린다. */
:root { --cta-bg: #c2410c; }
.nav-cta { background: var(--cta-bg) !important; color: #fff !important; font-weight: 700 !important; }
.cta-btn { background: var(--cta-bg); color: #fff; font-weight: 700; }
.nav-cta:hover, .cta-btn:hover { background: #9a3412; color: #fff; }
/* 푸터 저대비(#475569 = 2.4:1) 교정 */
footer p, .footer-inner p { color: #9aa7b4; }

/* 다크 단일 테마임을 브라우저에 명시 — 폼 컨트롤·스크롤바가 라이트로 강제되어
   '밝은 배경 + 밝은 글자'가 되는 사고 차단 */
:root { color-scheme: dark; }

/* ② 표 — 컨테이너만 가로 스크롤. 페이지 본문은 절대 가로로 밀리지 않는다. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
}
.table-wrap > table { margin: 0; border: 0; }
.article-body table { width: 100%; border-collapse: collapse; }
.article-body th { background: var(--bg-card); color: var(--ink); font-weight: 700; }

/* ③ 넘침 차단 — 긴 URL·모델명·코드 */
.article-body, .article-body p, .article-body li, .article-body td, .article-body th {
  overflow-wrap: break-word;
  word-break: break-word;
}
.article-body pre {
  overflow-x: auto;
  white-space: pre;
  background: var(--bg-soft);
  color: var(--ink);
  padding: .9rem 1rem;
  border-radius: 8px;
}
.article-body code { overflow-wrap: break-word; }
.article-body a { word-break: break-all; }

/* ④ 헤딩 — 뷰포트 비례 축소(모바일에서 제목이 4줄로 터지는 것 방지) */
.page-header h1 { font-size: clamp(1.45rem, 5.2vw, 2.35rem); line-height: 1.32; }
.article-body h2 { font-size: clamp(1.18rem, 3.9vw, 1.55rem); line-height: 1.4; }
.article-body h3 { font-size: clamp(1.02rem, 3.2vw, 1.22rem); line-height: 1.45; }

/* 이미지·SVG 안전망 (본문 도해 포함) */
.article-body img, .article-body svg, .article-body figure { max-width: 100%; height: auto; }
.article-body figure { margin-left: 0; margin-right: 0; }

@media (max-width: 640px) {
  /* ① 본문 16px 하한 — 15px 이하면 iOS 가 탭 시 자동 확대한다 */
  .article-body { font-size: 16px; line-height: 1.78; padding: 1.15rem .95rem; }
  .article-body p, .article-body li { font-size: 16px; line-height: 1.78; }
  .article-body table { font-size: .875rem; }
  .article-body th, .article-body td { padding: .5rem .6rem; }

  /* ⑤ 터치타깃 44×44 (WCAG 2.5.5) — 본문 링크·태그·페이지네이션 */
  .article-body a, .tag, .footer-links a, .popular-title, .cat-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .article-body p a, .article-body li a { display: inline; min-height: 0; } /* 문장 중 링크는 인라인 유지 */
  .cta-btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: .8rem 1.4rem; }

  .breadcrumb, nav[aria-label="breadcrumb"] { font-size: .8rem; line-height: 1.6; }
  .article-layout { display: block; }
  .sidebar { display: none; }
}
