/* ==========================================================================
   tokens.css — 디자인 토큰 · 리셋 · 공통 유틸  (개인 블로그 · 다크 + 민트)
   ========================================================================== */

:root {
  /* 색 — 다크 그라파이트 + 민트 포인트 */
  --bg: #121418;
  --surface: #1a1d23;
  --surface-2: #22262e;
  --line: #2e333d;
  --line-soft: rgba(255, 255, 255, .06);
  --mint: #5cc8a0;
  --mint-2: #7fdcb8;         /* 호버 */
  --mint-soft: rgba(92, 200, 160, .14);
  --teal: var(--mint);       /* 구 변수 호환 — 모두 민트로 통일 */
  --danger: #e8534a;         /* 오류 · BEST 배지 */
  --ink: #f2f4f6;
  --ink-2: #b4bac4;
  --ink-3: #7c838f;

  /* 레이아웃 */
  --bound: 1180px;
  --pad: 24px;
  --sec-gap: 56px;     /* 홈 섹션 간격 (≤640 → 40) */
  --card-gap: 24px;

  /* 헤더 */
  --header-h: 64px;
  --drawer-w: min(320px, 84vw);
  --drawer-pad: 22px;

  /* 라운드 — 그레이뉴스보다 크게 */
  --r-card: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  /* 폰트 */
  --font: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

@media (max-width: 640px) {
  :root {
    --pad: 16px;
    --sec-gap: 40px;
    --card-gap: 14px;
    --header-h: 56px;
  }
}

/* ---------- 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  overflow-x: clip;
  /* 짧은 페이지에서 세로 스크롤바가 사라져도 .gn-bound(로고)가 가로로 밀리지 않게 거터를 고정 */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@supports not (overflow-x: clip) {
  html { overflow-x: visible; }
  body { overflow-x: hidden; }
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
input::placeholder { color: var(--ink-3); }
input:focus { outline: none; border-color: var(--mint); }
svg { display: block; }

::selection { background: rgba(92, 200, 160, .3); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- 공통 유틸 ---------- */
.gn-bound {
  width: 100%;
  max-width: var(--bound);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.clamp-1, .clamp-2, .clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* 카테고리 뱃지 (단일 종류) */
.gn-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
.gn-badge--cat { background: var(--mint-soft); color: var(--mint); }
a.gn-badge:hover { background: rgba(92, 200, 160, .24); color: var(--mint-2); }
@media (max-width: 640px) {
  .gn-badge { height: 20px; padding: 0 8px; font-size: 10.5px; }
}

/* 미디어 박스 */
.gn-media {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.gn-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
a:hover .gn-media img, .gn-card:hover .gn-media img, .gn-hero__lead:hover .gn-media img, .gn-hero__mini:hover .gn-media img { transform: scale(1.04); }

/* 섹션 헤드 (홈 · 상세 공용) */
.gn-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.gn-sec__t { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.gn-sec__t::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 10px; vertical-align: 2px; }
.gn-sec__count { color: var(--ink-3); font-size: 13px; }
.gn-more { color: var(--mint); font-size: 13.5px; font-weight: 700; }
.gn-more:hover { color: var(--mint-2); text-decoration: underline; }

/* 스킵 링크 */
.gn-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--mint);
  color: #121418;
  font-weight: 800;
  transition: top .15s;
}
.gn-skip:focus { top: 12px; }
