/* 퍼프칩스튜디오 블로그 공용 스타일 — index.html(홈)과 같은 다크 톤/액센트 컬러를 쓰되,
   긴 글을 읽기 편하도록 배경은 정적인 단색으로, 본문 최대폭은 720px로 좁혀 가독성을 높인다. */

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

:root {
  --bg: #0f1410;
  --surface: #171b17;
  --text: #f2f0e9;
  --text-secondary: #d9f0dd;
  --text-muted: #a9cbb2;
  --text-faint: #7fa38a;
  --border: rgba(255, 255, 255, 0.14);
  --accent: #d6ff3f;
  --accent-contrast: #0d0d0f;
  --card-bg: rgba(18, 20, 30, 0.55);
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

html,
body {
  background: var(--bg);
  min-height: 100%;
}

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.7;
}

a {
  color: var(--accent);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 상단 내비 (홈페이지 .top-nav와 동일한 패턴) ---------- */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

/* 탭 타겟 최소 높이 44px(패딩으로 확보) — 홈페이지 .top-nav와 동일한 패턴 */
.top-nav-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
  font-weight: 800;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: -0.2px;
}

.top-nav-logo:hover {
  color: var(--accent);
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
  color: var(--text-muted);
  text-decoration: none;
}

.top-nav-links a:hover,
.top-nav-links a.is-active {
  color: var(--accent);
}

/* ko/en 언어 토글 — 홈페이지(index.html)의 인라인 .lang-toggle-btn 버튼과 같은 톤(액센트 배경
   pill)이지만, 블로그는 실제로 URL이 다른 정적 페이지(/blog/{slug}.html ↔ /blog/en/{slug}.html)라
   JS로 텍스트만 바꿔치는 버튼이 아니라 그냥 <a> 링크다. */
.top-nav-links a.lang-toggle-btn {
  min-height: auto;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 999px;
  text-decoration: none;
}

.top-nav-links a.lang-toggle-btn:hover {
  color: var(--accent-contrast);
  opacity: 0.85;
}

/* ---------- 목록 페이지 ---------- */

.page-title {
  margin-top: 40px;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.page-desc {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-secondary);
}

.post-list {
  list-style: none;
  margin-top: 32px;
}

.post-card {
  margin-top: 14px;
}

.post-card:first-child {
  margin-top: 0;
}

.post-card a {
  display: block;
  padding: 22px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.08s;
}

.post-card a:hover {
  border-color: var(--accent);
}

.post-card a:active {
  transform: scale(0.995);
}

.post-card-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.post-card-desc {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-card-date {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-faint);
}

.post-list-empty {
  margin-top: 32px;
  padding: 22px 24px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- 글 페이지 ---------- */

article {
  margin-top: 40px;
}

article h1 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.35;
}

.post-meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-faint);
}

article h2 {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
}

article h3 {
  margin-top: 28px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

article p,
article li,
article td,
article th {
  font-size: 16px;
  line-height: 1.7;
}

article p {
  margin-top: 16px;
  color: var(--text-secondary);
}

article ul,
article ol {
  margin-top: 16px;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

article li {
  margin-top: 8px;
}

article a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

article strong {
  color: var(--text);
}

article blockquote {
  margin-top: 20px;
  padding: 4px 4px 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

article code {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

article pre {
  margin-top: 18px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}

article pre code {
  border: none;
  padding: 0;
  background: none;
}

article img {
  max-width: 100%;
  display: block;
  margin-top: 20px;
  border-radius: 12px;
}

article hr {
  margin-top: 32px;
  border: none;
  border-top: 1px solid var(--border);
}

/* 표 스타일 — 좁은 화면(375px 등)에서 열이 뭉개지지 않도록 가로 스크롤 래퍼로 감싼다
   (빌드 스크립트가 <table>을 <div class="table-wrap">로 자동 래핑한다) */
.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

article table {
  width: 100%;
  min-width: 560px;
  margin-top: 0;
  border-collapse: collapse;
}

article th,
article td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

article th {
  background: var(--card-bg);
  color: var(--text);
  font-weight: 700;
}

article tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ---------- 관련 글 ---------- */

.related-posts {
  margin-top: 48px;
}

.related-posts-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.related-posts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.related-posts-list a {
  display: block;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 0.15s;
}

.related-posts-list a:hover {
  border-color: var(--accent);
}

/* ---------- 도구 안내 박스 ---------- */

.tools-box {
  margin-top: 48px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.tools-box-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tools-box-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.tools-box-links a {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.tools-box-links a:hover {
  text-decoration: underline;
}

/* ---------- 푸터 ---------- */

footer {
  margin-top: auto;
  padding-top: 48px;
  text-align: center;
  font-size: 14px;
  color: var(--text-faint);
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
  color: var(--text-faint);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
}

@media (min-width: 768px) {
  .wrap {
    padding: 64px 40px 100px;
  }

  .page-title {
    font-size: 40px;
  }

  article h1 {
    font-size: 38px;
  }

  article p,
  article ul,
  article ol,
  article li,
  article td,
  article th,
  article blockquote {
    font-size: 17px;
  }
}

/* ≤640px: article 본문(p/li/td/th/blockquote) 최소 16px, line-height 1.7을 명시적으로 다시
   못박는다 — 기본값이 이미 모바일 우선(16px/1.7)이라 이 블록 없이도 same 값이지만, 라이브에서
   13px로 측정된 사례가 있어 상속/캐스케이드에 기대지 않고 이 폭에서 확정적으로 강제한다. */
@media (max-width: 640px) {
  article p,
  article ul,
  article ol,
  article li,
  article td,
  article th,
  article blockquote {
    font-size: 16px;
    line-height: 1.7;
  }
}
