/* 공개 콘텐츠 표면 — 세금 캘린더 · 절세 콘텐츠 · 지도.
   토큰(tokens.css)만 쓰고 app.css는 건드리지 않는다(공용 파일 회피). */

/* ── 페이지 머리 ───────────────────────────────────────────── */
.page-head { margin-top: var(--s-2xl); }
.page-head h1 { font-size: 26px; font-weight: 700; line-height: 1.3; }
.page-head p { margin-top: 6px; font-size: 15px; color: var(--text-secondary); }

/* ── 세금 캘린더 ───────────────────────────────────────────── */
.cal-group { margin-top: var(--s-2xl); }
.cal-group > h2 { font-size: 19px; font-weight: 700; }
.cal-group > .hint { margin-top: 4px; font-size: 13px; color: var(--text-tertiary); }

.cal-list { display: flex; flex-direction: column; gap: 10px; margin-top: var(--s-lg); }
.cal-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
/* 날짜 블록 — 월/일을 두 줄로 세워 스캔이 빠르게. */
.cal-date {
  flex-shrink: 0; width: 60px; text-align: center;
  padding: 8px 0; border-radius: var(--r-md); background: var(--surface-alt);
}
.cal-date .m { display: block; font-size: 12px; font-weight: 600; color: var(--text-tertiary); }
.cal-date .d { display: block; font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.cal-date.every .d { font-size: 15px; padding: 3px 0; }

.cal-main { flex: 1; min-width: 0; }
.cal-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { font-size: 16px; font-weight: 700; }
.cal-note { margin-top: 4px; font-size: 13px; color: var(--text-tertiary); }

/* 대상 배지 — 앱 TaxAudience 색 규칙(사업자=primary·근로자=success·공통=grey). */
.aud { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-full); }
.aud-business { background: var(--primary-light); color: var(--primary); }
.aud-worker { background: #E6F9F1; color: #0F9960; }
.aud-common { background: var(--grey100); color: var(--grey700); }

/* D-day — 임박(7일 이내)만 강조하고 나머지는 조용하게. */
.dday {
  margin-left: auto; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.dday.soon { color: var(--error); }

/* ── 면책 고지 (캘린더·콘텐츠 공용) ─────────────────────────── */
.disclaimer {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: var(--s-2xl); padding: var(--s-md);
  background: var(--grey50); border-radius: var(--r-md);
  font-size: 12px; line-height: 1.6; color: var(--text-tertiary);
}
.disclaimer .ic { flex-shrink: 0; font-size: 13px; }

/* ── 절세 콘텐츠 피드 ──────────────────────────────────────── */
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-lg); margin-top: var(--s-lg); }
.article-card {
  display: block; padding: var(--s-lg);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.article-card:hover { border-color: var(--grey300); }
.article-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.article-card .t { margin-top: 8px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.article-card .s { margin-top: 4px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.cat-chip {
  font-size: 12px; font-weight: 700; padding: 3px 8px;
  border-radius: var(--r-sm); background: var(--primary-light); color: var(--primary);
}
.read-min { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

/* ── 절세 콘텐츠 상세 ──────────────────────────────────────── */
.article-body { max-width: 720px; }
.article-body h1 { margin-top: var(--s-md); font-size: 26px; font-weight: 700; line-height: 1.35; }
.article-body .lead { margin-top: 8px; font-size: 16px; color: var(--text-secondary); line-height: 1.6; }
.article-body h2 { margin-top: var(--s-2xl); font-size: 18px; font-weight: 700; }
.article-body h2 + p { margin-top: 6px; }
.article-body p { font-size: 16px; line-height: 1.75; color: var(--text-secondary); }

.keypoints { margin-top: var(--s-lg); padding: var(--s-lg); background: var(--primary-light); border-radius: var(--r-lg); }
.keypoints .h { font-size: 16px; font-weight: 600; color: var(--primary); }
.keypoints ul { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.keypoints li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.keypoints li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--primary); font-weight: 700; font-size: 13px;
}

.article-cta { margin-top: var(--s-3xl); text-align: center; }
.article-cta .btn { width: 100%; max-width: 420px; }

.related { display: flex; flex-direction: column; gap: 10px; margin-top: var(--s-lg); }
.related a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.related a:hover { border-color: var(--grey300); }
.related .t { font-size: 15px; font-weight: 600; }
.related .c { margin-top: 3px; font-size: 12px; color: var(--text-tertiary); }

/* ── 지도 ──────────────────────────────────────────────────── */
/* 안내·버튼·지역 시트가 지도 위에 겹친다(앱 tax_map_screen의 Stack과 같은 배치). */
.map-wrap { position: relative; }
.map-canvas { height: 460px; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--border); }

/* 키 미발급 시의 안내 플레이스홀더 — 앱의 지도 플레이스홀더와 같은 역할. */
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; height: 260px; padding: var(--s-xl); text-align: center;
  background: var(--surface-alt); border: 1px dashed var(--grey300); border-radius: var(--r-xl);
}
.map-placeholder .ic { font-size: 30px; }
.map-placeholder .t { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.map-placeholder .s { font-size: 13px; color: var(--text-tertiary); line-height: 1.6; }

.map-notice {
  margin-top: var(--s-md); padding: 10px var(--s-md);
  background: var(--primary-light); border-radius: var(--r-md);
  font-size: 13px; color: var(--primary);
}

/* 지도 위 안내 문구 — 위치 거부·너무 넓은 화면일 때만 뜬다. */
.map-toast {
  position: absolute; left: var(--s-md); right: var(--s-md); top: var(--s-md); z-index: 5;
  padding: 10px var(--s-lg); border-radius: var(--r-full);
  background: rgba(255, 255, 255, .94); box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  font-size: 13px; color: var(--text-secondary); text-align: center;
}
.map-toast[hidden] { display: none; }

.map-recenter {
  position: absolute; right: var(--s-lg); bottom: var(--s-lg); z-index: 5;
  padding: 10px var(--s-lg); border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer;
}
.map-recenter:hover { background: var(--surface-alt); }

/* 지역 배지 — 인원수만 크게. 접속중 세무사가 있으면 초록(D-023 신호등 문법).
   래퍼를 44×44 고정으로 두고 배지를 가운데 정렬해, 자릿수가 늘어도 좌우로 균등하게
   커진다 → 마커 anchor(22,22)가 항상 배지 중심에 맞는다. */
.map-badge-wrap {
  position: relative; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.map-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-full);
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22);
  color: #fff; font-size: 15px; font-weight: 800; line-height: 1; white-space: nowrap;
}
.map-badge.on { background: var(--presence-online); }
.map-badge-cap {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap;
  /* 지도 타일 위에서도 읽히게 흰 테두리를 두른다. */
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}

/* 내 위치 — 세무사 배지와 헷갈리지 않게 모양을 다르게 둔다. */
.map-me-wrap { position: relative; width: 22px; height: 22px; }
.map-me {
  display: block; width: 22px; height: 22px; border-radius: var(--r-full);
  background: var(--primary); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(49, 130, 246, .35);
}

/* 지역을 눌렀을 때 뜨는 세무사 목록 (앱 바텀시트 대응). */
.map-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 78%;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-xl);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .14);
}
.map-sheet[hidden] { display: none; }
.map-sheet-head {
  display: flex; align-items: flex-start; gap: var(--s-md);
  padding: var(--s-lg) var(--s-xl); border-bottom: 1px solid var(--border);
}
.map-sheet-head > div { flex: 1 1 auto; min-width: 0; }
.map-sheet-title { font-size: 17px; font-weight: 700; }
.map-sheet-sub { margin-top: 1px; font-size: 12px; color: var(--text-tertiary); }
.map-sheet-note { margin-top: 3px; font-size: 12px; color: var(--text-secondary); }
.map-sheet-basis { margin-top: 2px; font-size: 12px; color: var(--text-tertiary); }
.map-sheet-close {
  flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--text-tertiary); font-size: 20px; line-height: 1; cursor: pointer;
}
.map-sheet-close:hover { background: var(--surface-alt); }
.map-sheet-list { overflow-y: auto; padding: var(--s-sm) 0; }

.map-row {
  display: flex; align-items: center; gap: var(--s-md);
  padding: var(--s-md) var(--s-xl); color: inherit;
}
.map-row + .map-row { border-top: 1px solid var(--border); }
.map-row:hover { background: var(--surface-alt); }
.map-row .avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--r-full); object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-alt); font-weight: 700; color: var(--text-secondary);
}
.map-row-main { flex: 1 1 auto; min-width: 0; }
.map-row-top { display: flex; align-items: center; gap: var(--s-sm); }
.map-row-top b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row-sub {
  display: block; margin-top: 2px; font-size: 13px; color: var(--text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-row-go { flex: 0 0 auto; color: var(--grey400); font-size: 20px; }

/* ── 좁은 화면 ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .article-grid { grid-template-columns: 1fr; }
  .cal-item { padding: 14px; gap: 12px; }
  .cal-date { width: 52px; }
  .map-canvas { height: 360px; }
  .map-sheet-head { padding: var(--s-md) var(--s-lg); }
  .map-row { padding: var(--s-md) var(--s-lg); }
}
