/* 월급계산소 공통 스타일 */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-bg: #eff6ff;
  --ink: #1e293b;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --green: #059669;
  --green-bg: #ecfdf5;
  --amber-bg: #fffbeb;
  --amber-line: #fde68a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo .logo-mark { color: var(--blue); }

.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
}
.main-nav a:hover { background: var(--blue-bg); color: var(--blue); text-decoration: none; }
.main-nav a.active { background: var(--blue-bg); color: var(--blue); }

/* ── 히어로 ── */
.hero { padding: 56px 0 40px; text-align: center; }
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p { color: var(--ink-soft); max-width: 560px; margin: 0 auto; }
.hero .badge {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-size: .82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ── 카드 그리드 ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 0 48px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
  display: block;
  color: inherit;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--blue); text-decoration: none; }
.tool-card .card-icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.tool-card h2, .tool-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.tool-card p { font-size: .88rem; color: var(--ink-soft); line-height: 1.55; }

/* ── 본문/기사 공통 ── */
.page-title { padding: 40px 0 8px; }
.page-title h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; }
.page-title .sub { color: var(--ink-soft); margin-top: 8px; font-size: .95rem; }
.updated { color: var(--ink-faint); font-size: .82rem; margin-top: 6px; }

.article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.article h2 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
  padding-top: 8px;
}
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 8px; }
.article p { margin: 10px 0; color: var(--ink-soft); }
.article strong { color: var(--ink); }
.article ul, .article ol { margin: 10px 0 10px 22px; color: var(--ink-soft); }
.article li { margin: 5px 0; }

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: .92rem;
}
.article th, .article td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}
.article th { background: var(--bg); font-weight: 700; }
.table-wrap { overflow-x: auto; }

.callout {
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: .92rem;
  color: #78350f;
}
.callout-blue {
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: .92rem;
  color: #1e3a8a;
}

/* ── 계산기 폼 ── */
.calc-box {
  background: var(--card);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 28px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.calc-box h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-faint); font-size: .82rem; margin-left: 4px; }
.field input[type="number"], .field input[type="date"], .field input[type="text"], .field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label { font-weight: 500; font-size: .95rem; display: flex; align-items: center; gap: 6px; cursor: pointer; }

.btn-calc {
  width: 100%;
  background: var(--blue);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  padding: 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 6px;
  transition: background .15s;
}
.btn-calc:hover { background: var(--blue-dark); }

/* ── 결과 영역 ── */
.result {
  display: none;
  background: var(--green-bg);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 22px;
  margin-top: 20px;
}
.result.show { display: block; }
.result .result-main { font-size: .9rem; color: var(--ink-soft); }
.result .result-amount {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.02em;
  margin: 2px 0 10px;
}
.result .result-detail { font-size: .88rem; color: var(--ink-soft); border-top: 1px dashed #a7f3d0; padding-top: 12px; margin-top: 6px; }
.result .result-detail div { margin: 4px 0; }
.result .result-detail b { color: var(--ink); }

.result table.month-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .88rem; background: #fff; border-radius: 8px; }
.result table.month-table th, .result table.month-table td { border: 1px solid #d1fae5; padding: 7px 10px; text-align: right; }
.result table.month-table th { background: #f0fdf4; text-align: center; }
.result table.month-table td:first-child { text-align: center; }

/* ── FAQ ── */
.faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 10px 0;
  background: #fff;
}
.faq summary {
  padding: 14px 16px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 36px;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 1.2rem;
  font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 16px 14px; color: var(--ink-soft); font-size: .93rem; }

/* ── 관련 링크 ── */
.related { margin: 32px 0 48px; }
.related h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }

/* ── 광고 슬롯(승인 후 코드 삽입) ── */
.ad-slot { margin: 24px 0; min-height: 0; }

/* ── 푸터 ── */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 32px 0;
}
.footer-inner { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: var(--ink-soft); font-size: .88rem; font-weight: 600; }
.disclaimer {
  color: var(--ink-faint);
  font-size: .8rem;
  line-height: 1.6;
}

/* ── 반응형 ── */
@media (max-width: 640px) {
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 1.5rem; }
  .page-title h1 { font-size: 1.35rem; }
  .article { padding: 24px 18px; }
  .calc-box { padding: 20px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .header-inner { height: auto; flex-direction: column; align-items: flex-start; padding: 10px 16px; gap: 6px; }
  .main-nav { width: 100%; }
  .result .result-amount { font-size: 1.55rem; }
}
