/* style.css - 칼크모 공통 스타일 (에디토리얼 모노 · 흑백 + 단일 포인트 #FF4D2E) */

:root {
  /* 색상 */
  --ink: #111111;
  --text: #111111;
  --text-sub: #444444;
  --text-muted: #6b6b6b;
  --bg: #ffffff;
  --paper: #fafafa;
  --line: #e4e4e4;
  --accent: #ff4d2e;
  --accent-dark: #e23c1e;
  --accent-soft: #fff1ee;

  /* 구버전 변수명 매핑 (calculator.css 등 참조 호환) */
  --primary: #ff4d2e;
  --primary-dark: #e23c1e;
  --primary-light: #fff1ee;
  --surface: #f4f4f4;
  --surface-soft: #fafafa;
  --border: #e4e4e4;
  --success: #0a7d4d;
  --warning: #d8341f;

  /* 모양 — 에디토리얼: 각진 모서리, 그림자 없음 */
  --radius-lg: 0px;
  --radius: 0px;
  --radius-sm: 0px;
  --shadow: none;
  --shadow-hover: none;

  /* 레이아웃 */
  --max-width: 1080px;
  --content-width: 720px;

  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  letter-spacing: -0.01em;
  word-break: keep-all;       /* 한글: 단어 중간에서 줄바꿈 안 함 */
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }

/* ===== 헤더 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--ink);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.logo-mark {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}
.gnb { display: flex; gap: 22px; }
.gnb a {
  position: relative;
  padding: 4px 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.gnb a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .15s;
}
.gnb a:hover::after, .gnb a.active::after { width: 100%; }
.gnb a.active { color: var(--accent); }
.nav-toggle { display: none; }

/* ===== 레이아웃 ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.main-col { flex: 1 1 auto; min-width: 0; max-width: var(--content-width); }
.side-col { flex: 0 0 160px; position: sticky; top: 80px; }

/* ===== 히어로 (메인) — 좌측 정렬 대형 타이포 ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 20px 36px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.06;
}
.hero p {
  margin-top: 18px;
  color: var(--text-sub);
  font-size: 18px;
  line-height: 1.5;
  max-width: 560px;
}

/* ===== 계산기 섹션 / 헤어라인 그리드 ===== */
.calc-section { scroll-margin-top: 76px; }
.calc-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 48px 0 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.calc-group-title::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--accent);
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-top: none;
  counter-reset: card;
}
.calc-card {
  position: relative;
  display: block;
  background: #fff;
  padding: 30px 26px 28px;
  transition: background .12s;
}
.calc-card:hover { background: var(--accent-soft); }
.calc-card .emoji { display: none; }
.calc-card::before {
  counter-increment: card;
  content: counter(card, decimal-leading-zero);
  position: absolute;
  top: 26px; right: 24px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.calc-card:hover::before { color: var(--accent); }
.calc-card h2, .calc-card h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-right: 30px;
}
.calc-card p {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.5;
}
.calc-card.soon { pointer-events: none; opacity: .5; }
.badge-soon {
  position: absolute;
  top: 26px; right: 24px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
}

/* ===== 본문 콘텐츠 블록 ===== */
.content-block { margin-top: 56px; }
.content-block h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}
.content-block h3 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
.content-block p { color: var(--text-sub); margin-bottom: 10px; line-height: 1.7; }
.content-block ul.dot { margin: 8px 0 8px 2px; }
.content-block ul.dot li {
  position: relative;
  padding-left: 16px;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.content-block ul.dot li::before {
  content: '';
  position: absolute;
  left: 2px; top: 11px;
  width: 4px; height: 4px;
  background: var(--accent);
}
.info-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 18px 20px;
  margin: 16px 0;
  line-height: 1.7;
  color: var(--text-sub);
}
.info-box strong { color: var(--ink); }

/* 본문 링크 — 포인트색 + 밑줄로 '클릭 가능' 구분 */
.content-block p a,
.content-block li a,
.info-box a,
.faq-a-inner a,
.calc-page-head .lead a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.content-block p a:hover,
.info-box a:hover { text-decoration: none; }
.disclaimer a { text-decoration: underline; text-underline-offset: 2px; }
/* CTA 버튼형 링크는 본문 링크 색 규칙에서 제외 (흰 글자 유지) */
.content-block a.btn-calc, a.btn-calc { color: #fff; font-weight: 800; text-decoration: none; }

/* ===== FAQ 아코디언 ===== */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-q {
  width: 100%;
  text-align: left;
  padding: 20px 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
}
.faq-q::after {
  content: '+';
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
  transition: transform .2s;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a-inner { padding: 0 4px 20px; color: var(--text-sub); line-height: 1.7; }

/* ===== 관련 계산기 ===== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 16px;
}
.related-grid a {
  padding: 18px;
  background: #fff;
  font-weight: 700;
  color: var(--ink);
  transition: background .12s;
}
.related-grid a:hover { background: var(--accent-soft); }
.related-grid a span { display: block; font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* ===== 광고 슬롯 ===== */
.ad-slot { margin: 24px auto; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-placeholder {
  width: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  color: var(--text-muted);
  font-size: 13px;
  background: var(--paper);
}
.ad-label { font-size: 11px; color: var(--text-muted); text-align: center; display: block; margin-bottom: 4px; }
.ad-side .ad-placeholder { min-height: 600px; }

/* ===== 푸터 ===== */
.site-footer { margin-top: 72px; border-top: 2px solid var(--ink); background: #fff; }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 40px;
  color: var(--text-muted);
  font-size: 14px;
}
.footer-inner nav { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 18px; }
.footer-inner nav a { color: var(--ink); font-weight: 600; }
.footer-inner nav a:hover { color: var(--accent); }
.disclaimer { margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }

/* ===== 반응형 ===== */
@media (max-width: 900px) {
  .side-col { display: none; }
  .layout { display: block; }
  .main-col { max-width: 100%; }
}
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .hero { padding: 44px 16px 28px; }
  .hero h1 { font-size: 34px; letter-spacing: -0.04em; }
  .hero p { font-size: 16px; }
  .calc-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .gnb {
    position: fixed;
    inset: 60px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--ink);
    padding: 8px 16px 16px;
    transform: translateY(-120%);
    transition: transform .2s, visibility .2s;
    visibility: hidden;
  }
  .gnb.open { transform: translateY(0); visibility: visible; }
  .gnb a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .gnb a::after { display: none; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--ink); }
}
