/* Kimchi Premium public site — shared styles
   외부 폰트/CDN 을 쓰지 않는다. 검색 유입이 목적이라 요청 수와 렌더 차단 리소스를 최소화한다. */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #e3e6ea;
  --text: #16191d;
  --muted: #667085;
  --accent: #2563eb;
  --up: #0f9d58;
  --down: #d93025;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --border: #262b34;
    --text: #e8eaed;
    --muted: #9aa4b2;
    --accent: #6b9bff;
    --up: #43c37e;
    --down: #ff6b5e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 17px; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }
/* 메뉴가 늘어 줄바꿈돼도 정렬이 유지되도록 flex 로 감싼다 */
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  justify-content: flex-end;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.site-header nav a:hover { color: var(--text); }
/* 언어 전환 링크는 살짝 구분 */
.site-header nav a.lang { font-weight: 600; color: var(--accent); }

/* headings */
h1 { font-size: 28px; line-height: 1.3; margin: 28px 0 8px; }
h2 { font-size: 20px; margin: 32px 0 10px; }
h3 { font-size: 16px; margin: 22px 0 6px; }
.lede { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

/* stat cards */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0 8px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.stat .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* table */
.table-scroll { overflow-x: auto; margin: 12px 0 8px; }
table.kp {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}
table.kp th, table.kp td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
table.kp th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
table.kp th:first-child, table.kp td:first-child { text-align: left; }
table.kp tbody tr:hover { background: var(--surface); }
table.kp td { font-variant-numeric: tabular-nums; }
table.kp a { color: var(--text); text-decoration: none; font-weight: 600; }
table.kp a:hover { color: var(--accent); }
.sym { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }

.up { color: var(--up); }
.down { color: var(--down); }

/* chart */
.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
}
.chart-box svg { display: block; width: 100%; height: auto; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--accent); opacity: .10; stroke: none; }
.chart-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; opacity: .6; }
.chart-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* prose */
.prose p { margin: 10px 0; }
.prose ul { margin: 10px 0; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
}

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin: 16px 0;
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

/* ad slot placeholder — AdSense 코드는 승인 후 여기에 넣는다 */
.ad-slot { margin: 24px 0; min-height: 90px; }

/* location page buttons */
.loc-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.loc-btn:hover { filter: brightness(1.08); }
.loc-btn-off { background: var(--muted); }
/* leaflet 컨트롤이 다크모드에서도 읽히도록 */
.leaflet-container { background: var(--surface); }

/* API 문서 코드 블록 */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* QR 생성기 */
.qr-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
#qr-out { display: flex; justify-content: center; padding: 16px 0; }
#qr-out canvas, #qr-out img { background: #fff; padding: 12px; border-radius: var(--radius); }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 20px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--muted); }

.updated { font-size: 13px; color: var(--muted); }
.updated strong { color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  h1 { font-size: 23px; }
  .stat .value { font-size: 20px; }
}
