@charset "UTF-8";

/* Pretendard: 한글 가독성을 위한 본문 폰트 (동적 서브셋) */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css");

:root {
  --bg: #eceef1;
  --card: #ffffff;
  --text: #2b2f36;
  --heading: #15181d;
  --muted: #6b7280;
  --border: #e6e8eb;
  --border-strong: #d7dadf;
  --accent: #2f9e8f;          /* 링크/포인트(브랜드 틸) */
  --accent-soft: #80ed99;     /* 밑줄/인용 포인트(브랜드 민트) */
  --code-bg: #f2f4f6;
  --code-text: #b03060;

  --font-sans: "Pretendard Variable", Pretendard, -apple-system,
    BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, "Segoe UI", Roboto,
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "D2Coding", Menlo, Consolas,
    "Liberation Mono", monospace;

  --maxw: 920px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media screen and (max-width: 740px) {
  html {
    font-size: 15.5px;
  }
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* ── 상단 네비게이션: 홈으로 가기 (글 상세페이지 전용) ────────── */
.topnav {
  max-width: var(--maxw);
  margin: 1.6rem auto 0;
  padding: 0 4px;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.15s ease;
}

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

@media screen and (max-width: 740px) {
  .topnav {
    max-width: none;
    margin: 0;
    padding: 1rem 1.25rem 0;
  }
}

/* ── 레이아웃: 가운데 정렬된 흰 리딩 카드 ───────────────────── */
article.article {
  width: 100%;
  margin: 0;
  color: var(--text);
}

article .box {
  width: 100%;
  max-width: var(--maxw);
  margin: 2.5rem auto;
  padding: 3.4rem 3.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20, 23, 28, 0.04),
    0 10px 30px rgba(20, 23, 28, 0.05);
}

@media screen and (max-width: 740px) {
  article .box {
    max-width: none;
    margin: 0;
    padding: 1.8rem 1.25rem 2.4rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ── 제목 ──────────────────────────────────────────────── */
article .box h1,
article .box h2,
article .box h3,
article .box h4 {
  color: var(--heading);
  font-family: var(--font-sans);
  line-height: 1.35;
  letter-spacing: -0.012em;
  word-break: keep-all;
}

article .box h1 {
  font-size: 2.05rem;
  font-weight: 800;
  line-height: 1.28;
  margin: 0 0 1.6rem;
}

article .box h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

article .box h3 {
  font-size: 1.22rem;
  font-weight: 700;
  margin: 2.2rem 0 0.8rem;
}

@media screen and (max-width: 740px) {
  article .box h1 {
    font-size: 1.65rem;
    word-break: keep-all;
  }
  article .box h2 {
    font-size: 1.32rem;
  }
}

/* 헤딩의 자동 생성 앵커는 보이지 않게 */
article .box h1 .anchor,
article .box h2 .anchor,
article .box h3 .anchor,
article .box h4 .anchor {
  display: none;
}

/* ── 본문 ──────────────────────────────────────────────── */
article .box p {
  margin: 1.25rem 0;
  line-height: 1.85;
}

article .box strong {
  font-weight: 700;
  color: var(--heading);
}

article .box a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 158, 143, 0.35);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

article .box a:hover {
  border-bottom-color: var(--accent);
  background: rgba(128, 237, 153, 0.16);
}

article .box a:visited {
  color: #2a7d77;
}

/* ── 목록 ──────────────────────────────────────────────── */
article .box ul,
article .box ol {
  margin: 1.25rem 0;
  padding-left: 1.4rem;
}

article .box li {
  margin: 0.45rem 0;
  line-height: 1.8;
}

article .box li::marker {
  color: var(--muted);
}

/* 인덱스(글 목록) 페이지의 링크 리스트를 살짝 키워 가독성 확보 */
article li:not(:last-child) {
  margin-bottom: 0.6rem;
}

/* ── 인용구 ────────────────────────────────────────────── */
article .box blockquote {
  margin: 1.6rem 0;
  padding: 0.9rem 1.3rem;
  border-left: 3px solid var(--accent-soft);
  background: #f5faf7;
  border-radius: 0 10px 10px 0;
  color: #3c4148;
}

article .box blockquote p {
  margin: 0.4rem 0;
}

/* ── 코드 ──────────────────────────────────────────────── */
article .box code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  word-break: break-all;
}

article .box pre {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: #f6f7f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.84rem;
}

article .box pre code {
  background: none;
  color: #2b2f36;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  word-break: normal;
  white-space: pre;
}

/* ── 표 ────────────────────────────────────────────────── */
article .box table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.94rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

article .box th,
article .box td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0.6rem 0.85rem;
  text-align: left;
  line-height: 1.6;
  vertical-align: top;
}

article .box th:last-child,
article .box td:last-child {
  border-right: none;
}

article .box tbody tr:last-child td {
  border-bottom: none;
}

article .box thead th {
  background: #f1f3f5;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
}

/* 첫 열을 행 머리글처럼 강조 (비교 표 가독성) */
article .box tbody td:first-child {
  background: #f7f8fa;
  font-weight: 600;
}

article .box tbody tr:hover td {
  background: #fafbfc;
}

@media screen and (max-width: 740px) {
  article .box table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ── 이미지 ────────────────────────────────────────────── */
article .box img {
  height: auto;
  max-width: 100%;
  display: block;
  margin: 1.6rem auto;
  border-radius: 8px;
}

/* ── 날짜 ──────────────────────────────────────────────── */
article .box .date {
  display: block;
  text-align: right;
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* ── 푸터 ──────────────────────────────────────────────── */
footer {
  display: flex;
  margin: 0 0 3.5rem;
  width: 100%;
  color: #343a40;
  word-break: keep-all;
  min-width: 100px;
  gap: 20px;
  justify-content: center;
  align-items: center;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

footer:hover {
  opacity: 1;
}
