/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.4em; }

/* ===== VARIABLES ===== */
:root {
  --primary: #0077cc;
  --primary-dark: #005fa3;
  --primary-light: #e8f3fc;
  --accent: #e85d04;
  --accent-light: #fff3ed;
  --green: #2d7a2d;
  --green-light: #edf7ed;
  --amber: #b45309;
  --amber-light: #fef9ee;
  --text: #1a1a1a;
  --text-sub: #4a4a4a;
  --text-muted: #888;
  --border: #e0e0e0;
  --bg: #f8f8f6;
  --bg-card: #fff;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 4px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,.12);
  --max-w: 1080px;
  --nav-h: 60px;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; line-height: 1.3; }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.35; }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin-bottom: 1em; color: var(--text-sub); }
p:last-child { margin-bottom: 0; }

/* ===== LAYOUT ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-sm { padding: 36px 0; }
.section-title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.section-sub {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ===== HEADER & NAV ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}
.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo span { color: var(--accent); }
.nav-list {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 4px;
}
.nav-list a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-sub);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-list a:hover,
.nav-list a.active { background: var(--primary-light); color: var(--primary); }
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-search input {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .85rem;
  width: 160px;
  outline: none;
  transition: border .15s, width .2s;
}
.nav-search input:focus { border-color: var(--primary); width: 200px; }

/* 햄버거 메뉴 */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s;
}
.mobile-nav {
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 16px;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 10px 0;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(0,119,204,.3); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #c44d00; box-shadow: 0 2px 8px rgba(232,93,4,.3); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost {
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; border-radius: 10px; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-full { width: 100%; }

/* 카테고리 버튼 탭 */
.cat-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cat-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  transition: .15s;
  text-decoration: none;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-tab.bada { }
.cat-tab.bada.active { background: var(--primary); border-color: var(--primary); }
.cat-tab.minmul.active { background: var(--green); border-color: var(--green); }
.cat-tab.lure.active { background: var(--amber); border-color: var(--amber); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-thumb {
  background: var(--bg);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}
.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.badge-bada { background: var(--primary-light); color: var(--primary); }
.badge-minmul { background: var(--green-light); color: var(--green); }
.badge-lure { background: var(--amber-light); color: var(--amber); }
.badge-info { background: #f0f0f0; color: #555; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); line-height: 1.4; }
.card-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 14px; flex: 1; line-height: 1.55; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-meta { font-size: .78rem; color: var(--text-muted); }

/* 아이콘 카드 */
.icon-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  display: block;
  color: var(--text);
}
.icon-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.icon-card .icon { font-size: 2.4rem; margin-bottom: 12px; }
.icon-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.icon-card p { font-size: .83rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

/* ===== 히어로 배너 ===== */
.hero {
  background: linear-gradient(135deg, #001e3c 0%, #003d70 50%, #005fa3 100%);
  color: #fff;
  padding: 64px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: .03em;
  color: #fff;
}
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); margin-bottom: 14px; line-height: 1.25; text-shadow: 0 2px 8px rgba(0,0,30,.35); }
.hero h1 em { font-style: normal; color: #93e0ff; }
.hero p { font-size: 1.05rem; color: #ffffff; margin-bottom: 28px; max-width: 540px; font-weight: 500; text-shadow: 0 1px 6px rgba(0,0,50,.7), 0 2px 12px rgba(0,0,50,.4); opacity: 1; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-btns .btn-white {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}
.hero-btns .btn-white:hover { background: #e8f3fc; }
.hero-btns .btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.6);
  font-weight: 600;
}
.hero-btns .btn-outline-white:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* ===== 인기글 목록 ===== */
.post-list { list-style: none; padding: 0; }
.post-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .1s;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover .post-item-title { color: var(--primary); }
.post-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--border);
  min-width: 28px;
  line-height: 1;
  padding-top: 2px;
}
.post-num.top { color: var(--accent); }
.post-item-body { flex: 1; }
.post-item-title { font-size: .95rem; font-weight: 600; margin-bottom: 3px; line-height: 1.4; }
.post-item-meta { font-size: .78rem; color: var(--text-muted); }

/* ===== TOC (목차) ===== */
.toc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 28px 0;
}
.toc-title { font-size: .9rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin-bottom: 4px; }
.toc a { font-size: .88rem; color: var(--primary); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ===== 본문 콘텐츠 ===== */
.article-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 36px; align-items: start; }
.article-body h2 { margin: 32px 0 12px; font-size: 1.3rem; padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); color: var(--text); }
.article-body h3 { margin: 24px 0 8px; font-size: 1.08rem; color: var(--text); }
.article-body p { margin-bottom: 1.1em; color: var(--text-sub); font-size: .97rem; }
.article-body ul, .article-body ol { margin-bottom: 1.2em; }
.article-body li { margin-bottom: .4em; font-size: .97rem; color: var(--text-sub); }
.article-body strong { color: var(--text); }
.tip-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: .92rem;
  color: var(--primary-dark);
}
.tip-box strong { color: var(--primary-dark); }
.warn-box {
  background: #fff8e6;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: .92rem;
  color: #92400e;
}

/* ===== 사이드바 ===== */
.sidebar { position: sticky; top: calc(var(--nav-h) + 20px); }
.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-title { font-size: .88rem; font-weight: 700; color: var(--text-muted); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 14px; }
.sidebar-links { list-style: none; padding: 0; }
.sidebar-links li { border-bottom: 1px solid var(--border); }
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a {
  display: block;
  padding: 9px 0;
  font-size: .87rem;
  color: var(--text-sub);
  transition: color .12s;
}
.sidebar-links a:hover { color: var(--primary); }

/* ===== 브레드크럼 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-muted);
  padding: 12px 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

/* ===== CTA 배너 ===== */
.cta-banner {
  background: var(--primary-light);
  border: 1px solid #b3d9f7;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cta-banner h3 { font-size: 1.1rem; margin-bottom: 4px; color: var(--primary-dark); }
.cta-banner p { font-size: .9rem; color: var(--primary); margin: 0; }

/* ===== 페이지 히어로 (내부 페이지) ===== */
.page-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 32px;
}
.page-hero .badge-genre {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.page-hero h1 { font-size: clamp(1.3rem, 4vw, 1.9rem); margin-bottom: 8px; }
.page-hero p { font-size: .95rem; color: var(--text-muted); margin: 0; }

/* ===== 관련 글 ===== */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ===== 광고 슬롯 ===== */
.ad-slot {
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  color: #aaa;
  letter-spacing: .05em;
}
.ad-slot-top { height: 90px; margin: 20px 0; }
.ad-slot-mid { height: 250px; margin: 28px 0; }
.ad-slot-side { height: 600px; }

/* ===== 푸터 ===== */
.site-footer {
  background: #111;
  color: #aaa;
  padding: 40px 0 24px;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand .logo { color: #fff; margin-bottom: 10px; font-size: 1.1rem; }
.footer-brand p { font-size: .83rem; color: #777; line-height: 1.65; margin: 0; }
.footer-col h4 { font-size: .85rem; font-weight: 700; color: #ddd; margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { font-size: .83rem; color: #888; transition: color .12s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #222;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: #555;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== 반응형 ===== */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .article-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .ad-slot-side { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav-list, .nav-search { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 44px 0 40px; }
  .hero-btns .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .cta-banner { flex-direction: column; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
}
