:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text-body);
  line-height: 1.8;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================
   [공통 네비게이션 & 푸터]
   ======================================================== */
.site-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.nav-back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-back-link:hover {
  color: var(--text-main);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 36px 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 60px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 16px;
}
.footer-links a:hover { color: var(--text-main); }
.footer-legal-notice {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.6;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

/* ========================================================
   [면책 조항 & 반응형 광고 규격]
   ======================================================== */
.disclaimer-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 3px solid #64748b;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.disclaimer-box strong { color: var(--text-main); }
.disclaimer-box.home-center {
  max-width: 760px;
  margin: 24px auto 0 auto;
  text-align: left;
}

.ad-placeholder,
.ad-article-mid,
.ad-container,
.ad-in-grid {
  margin: 1.5rem 0;
  padding: 0;
  border: none;
  background: transparent;
  min-height: 0;
  overflow: hidden;
}

.ad-in-grid {
  grid-column: 1 / -1;
  margin: 0.75rem 0;
}

ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

/* 카탈로그 상단 동적 안내/팁 박스 */
.guide-note-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 16px 0 20px 0;
}
.guide-note-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.guide-note-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-body);
  margin-bottom: 8px;
}
.guide-note-content p:last-child {
  margin-bottom: 0;
}

/* ========================================================
   [홈 화면 레이아웃 (Index)]
   ======================================================== */
.hub-container {
  max-width: 1140px;
  margin: 40px auto 60px auto;
  padding: 0 20px;
}
.hub-hero {
  text-align: center;
  margin-bottom: 28px;
}
.hub-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hub-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 36px 0;
}
.service-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.service-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.route-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 4px;
}
.stat-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}
.card-foot {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.update-time {
  font-size: 0.78rem;
  color: #94a3b8;
}
.action-text {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}
.service-card:hover .action-text { gap: 8px; }

/* ========================================================
   [카탈로그 2열 그리드 & 사이드바 레이아웃 (Catalog)]
   ======================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.25rem;
  max-width: 1140px;
  margin: 36px auto 0 auto;
  padding: 0 20px;
}

/* 목록 시작 직전 상단 가로 광고 */
.catalog-ad-top {
  width: 100%;
  margin: 1.25rem 0 0.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

.catalog-ad-top ins.adsbygoogle {
  display: block;
  width: 100%;
}

.catalog-main {
  min-width: 0;
}
.catalog-header {
  margin-bottom: 1.75rem;
}
.catalog-badge-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.catalog-badge {
  font-family: var(--font-mono);
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #eff6ff;
  color: var(--accent);
}
.catalog-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}
.catalog-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}
.catalog-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: #64748b;
  padding: 0.65rem 1rem;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* 본문 사이트 2열 카드 그리드 */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.site-card-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.site-card-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
}
.site-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.site-card-link-btn {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: #eff6ff;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.site-card-link-btn:hover {
  background: #dbeafe;
  color: var(--accent-hover);
}
.site-card-desc {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  text-align: justify;
}
.site-card-ref {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.5rem;
}
.site-card-ref a {
  color: var(--accent);
  text-decoration: underline;
}

/* 우측 사이드바 영역 */
.catalog-sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar-ad-box {
  overflow: hidden;
  border-radius: 8px;
}
.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.sidebar-widget-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.9;
}
.sidebar-toc-list a {
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ========================================================
   [반응형 미디어 쿼리]
   ======================================================== */
@media (max-width: 960px) {
  .directory-grid {
    grid-template-columns: 1fr;
  }
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .catalog-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .sites-grid {
    grid-template-columns: 1fr;
  }
  .catalog-title {
    font-size: 1.5rem;
  }
}