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

:root {
  --green:  #10B981;
  --green-dark: #059669;
  --dark:   #111827;
  --dark2:  #1F2937;
  --gray:   #6B7280;
  --light:  #F9FAFB;
  --border: #E5E7EB;
  --text:   #1F2937;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 광고 공통 카드 ===== */
.ad-card {
  background: #fff;
  border-radius: 10px;
  border: 1.5px dashed var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ad-card-label {
  font-size: .68rem;
  color: #9CA3AF;
  align-self: flex-start;
  margin-bottom: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ===== 상단 광고 ===== */
.ad-top-wrap {
  background: #F9FAFB;
  border-bottom: 1px solid var(--border);
}
.ad-top-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}
.ad-top-inner .ad-card {
  min-height: 100px;
  justify-content: center;
}

/* ===== 본문 + 사이드바 레이아웃 ===== */
.page-layout {
  flex: 1;
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  gap: 28px;
  align-items: flex-start;
}

/* ===== 사이드바 광고 ===== */
.ad-sidebar {
  width: 300px;
  flex-shrink: 0;
}
.ad-sidebar-inner {
  position: sticky;
  top: 72px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ad-sidebar-inner .ad-card {
  min-height: 280px;
  justify-content: center;
  width: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ===== Header ===== */
.site-header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #1F2937;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.site-logo em {
  color: var(--green);
  font-style: normal;
}
.header-nav a {
  color: #9CA3AF;
  font-size: .875rem;
  transition: color .2s;
}
.header-nav a:hover { color: var(--green); }

/* ===== Main Layout ===== */
.main-wrap {
  flex: 1;
  min-width: 0;
  padding: 48px 0 80px;
}

/* ===== Home Page ===== */
.home-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--border);
}
.home-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.home-desc {
  color: var(--gray);
  font-size: .95rem;
}

/* ===== Post List ===== */
.post-list { list-style: none; }

.post-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-card:last-child { border-bottom: none; }

.post-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
}
.post-card h2 a {
  color: var(--dark);
  transition: color .2s;
}
.post-card h2 a:hover { color: var(--green); }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--gray);
  font-size: .82rem;
  margin-bottom: 10px;
}
.meta-sep { color: var(--border); }
.post-category {
  background: #ECFDF5;
  color: var(--green-dark);
  font-size: .78rem;
  padding: 1px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.post-excerpt {
  color: #374151;
  font-size: .93rem;
  line-height: 1.65;
  margin-bottom: 10px;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  background: var(--light);
  border: 1px solid var(--border);
  color: var(--gray);
  font-size: .76rem;
  padding: 2px 10px;
  border-radius: 20px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 48px;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--dark);
  transition: border-color .2s, color .2s;
}
.pagination a:hover {
  border-color: var(--green);
  color: var(--green);
}
.pagination .current {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}
.pagination .disabled {
  color: var(--border);
  cursor: default;
}

/* ===== Post Detail ===== */
.post-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--gray);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--green); }
.breadcrumb a:hover { text-decoration: underline; }

.post-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--dark);
  margin-bottom: 14px;
}
.post-meta.inline { display: inline-flex; }
.post-tags.inline { display: inline-flex; }

/* ===== Post Body ===== */
.post-body {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
}
.post-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin: 40px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--green);
}
.post-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark2);
  margin: 28px 0 10px;
}
.post-body p { margin-bottom: 18px; }
.post-body ul, .post-body ol {
  margin: 0 0 18px 24px;
}
.post-body li { margin-bottom: 6px; }
.post-body strong { color: var(--dark); font-weight: 600; }
.post-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-body a:hover { color: var(--green-dark); }
.post-body blockquote {
  border-left: 3px solid var(--green);
  padding: 12px 20px;
  background: var(--light);
  margin: 20px 0;
  border-radius: 0 6px 6px 0;
  color: var(--dark2);
}
.post-body code {
  background: var(--light);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .875em;
  font-family: 'Courier New', monospace;
}
.post-body pre {
  background: var(--dark);
  color: #E5E7EB;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* ===== CTA Box ===== */
.cta-box {
  background: linear-gradient(135deg, #064E3B 0%, #111827 100%);
  border-radius: 14px;
  padding: 40px 36px;
  margin: 56px 0 40px;
  text-align: center;
  color: #fff;
}
.cta-emoji {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.cta-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.cta-desc {
  color: #9CA3AF;
  font-size: .93rem;
  margin-bottom: 24px;
  line-height: 1.6;
}
.cta-btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  padding: 13px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s, transform .1s;
  text-decoration: none;
}
.cta-btn:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}
.cta-note {
  margin-top: 14px;
  color: #6B7280;
  font-size: .8rem;
}

/* ===== FAQ Section ===== */
.faq-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.faq-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 18px;
}
.faq-section details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .2s;
}
.faq-section details[open] { border-color: var(--green); }
.faq-section summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dark);
  user-select: none;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--green);
  font-weight: 400;
  flex-shrink: 0;
  margin-left: 12px;
}
.faq-section details[open] summary::after { content: "−"; }
.faq-section details p {
  padding: 0 18px 16px;
  color: #374151;
  font-size: .93rem;
  line-height: 1.75;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ===== Post Nav ===== */
.post-nav {
  margin-top: 20px;
  padding-top: 20px;
}
.back-link {
  color: var(--green);
  font-size: .9rem;
  transition: color .2s;
}
.back-link:hover { color: var(--green-dark); text-decoration: underline; }

/* ===== Footer ===== */
.site-footer {
  background: var(--dark);
  color: var(--gray);
  padding: 40px 20px 28px;
  margin-top: 0;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.footer-kits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 24px;
}
.footer-kits a {
  color: #9CA3AF;
  font-size: .83rem;
  transition: color .2s;
}
.footer-kits a:hover { color: var(--green); }
.footer-desc {
  font-size: .85rem;
  margin-bottom: 16px;
  line-height: 1.6;
}
.footer-desc a { color: var(--green); }
.footer-copy {
  font-size: .78rem;
  color: #4B5563;
  border-top: 1px solid #1F2937;
  padding-top: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .ad-sidebar { display: none; }
  .page-layout { padding: 0 20px; }
}
@media (max-width: 640px) {
  .main-wrap { padding: 28px 0 60px; }
  .page-layout { padding: 0 16px; }
  .home-title { font-size: 1.4rem; }
  .post-title { font-size: 1.35rem; }
  .post-body h2 { font-size: 1.15rem; }
  .cta-box { padding: 28px 20px; }
  .cta-title { font-size: 1.1rem; }
  .header-nav { display: none; }
}
