:root {
  color-scheme: light;
  --ink: #222a32;
  --muted: #65717e;
  --accent: #3d607c;
  --line: #e2e7eb;
  --soft: #f6f8fa;
  /* 작성자 식별은 JavaScript에서 수행한다. 색상은 그 결과를 표현하는 수단이다. */
  --author: #edf3f8;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: #fff; color: var(--ink);
  font: 16px/1.75 system-ui, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, select, input {
  border: 1px solid #d5dde4; border-radius: 5px; background: white; padding: 8px 12px;
  min-height: 42px; max-width: 100%;
}
button:hover { background: var(--soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; top: -80px; left: 12px; padding: 10px; background: white; z-index: 5; }
.skip:focus { top: 8px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1120px; margin: auto; padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.brand { font: 700 25px/1.3 ui-monospace, Consolas, monospace; letter-spacing: -1px; color: var(--ink); }
.header-author, .handle { color: var(--muted); font: 13px/1.5 ui-monospace, Consolas, monospace; }
/* 영역별 역할이 다르다고 해서 가용 공간이 늘어나는 것은 아니다. 본문 폭을 우선 확보한다. */
.layout {
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 44px 32px 64px;
  display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 54px; flex: 1;
}
.sidebar { min-width: 0; padding-right: 24px; border-right: 1px solid var(--line); }
.profile { margin-bottom: 28px; }
.avatar {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 8px;
  font: 700 24px ui-monospace, Consolas, monospace; color: var(--accent);
}
.profile-name { display: block; font-weight: 700; color: var(--ink); font-size: 19px; }
.profile p { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.mode-panel { padding: 16px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mode-panel label, .nav-title { display: block; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .03em; margin-bottom: 8px; }
.mode-panel select { width: 100%; padding: 8px 6px; font-size: 12px; }
.mode-panel small { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; }
#sidePanel > summary { display: none; }
.sidebar nav { margin-top: 25px; }
.nav-link { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 8px; margin: 2px -8px; border-radius: 4px; color: var(--ink); font-size: 14px; }
.nav-link.active { background: var(--soft); color: var(--accent); font-weight: 700; }
.nav-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
main { min-width: 0; max-width: 780px; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.45; letter-spacing: -.025em; }
h1 { font-size: clamp(25px, 3.4vw, 34px); margin: 0 0 14px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
.eyebrow { color: var(--accent); font: 600 12px/1.5 ui-monospace, Consolas, monospace; margin: 0 0 10px; }
.muted, .meta { color: var(--muted); font-size: 13px; }
.meta { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: baseline; }
.meta a { color: var(--muted); }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 12px; }
.searchbar input { flex: 1 1 190px; min-width: 0; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 4px; }
.list-tools select { font-size: 13px; padding: 5px 10px; }
.post-card { padding: 25px 0; border-bottom: 1px solid var(--line); }
.post-card h2 { margin: 6px 0 9px; font-size: 21px; }
.post-card h2 a { color: var(--ink); }
.post-card p { color: #4f5b66; margin: 0 0 12px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.draft { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; vertical-align: middle; font-weight: 400; white-space: nowrap; }
.pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 30px 0; }
.pagination a { border: 1px solid var(--line); min-width: 38px; text-align: center; padding: 6px 10px; border-radius: 4px; }
.pagination a[aria-current] { background: var(--soft); border-color: var(--accent); font-weight: 700; }
.back { display: inline-block; font-size: 13px; margin-bottom: 24px; }
.post-header { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 32px; }
.post-header .meta { margin-top: 16px; }
.post-body { font-size: 16px; line-height: 1.95; }
.post-body p { margin: 0 0 1.4em; }
.post-body h2, .post-body h3 { margin: 2em 0 .75em; }
blockquote { margin: 22px 0; border-left: 3px solid #b9c9d6; padding: 10px 16px; background: var(--soft); color: #4e5a65; }
pre { margin: 22px 0; padding: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 5px; overflow-x: auto; word-break: normal; overflow-wrap: normal; line-height: 1.65; }
code { font: .88em/1.65 ui-monospace, Consolas, monospace; background: var(--soft); }
p code { padding: 2px 4px; border-radius: 3px; }
.math { margin: 20px 0; padding: 14px; text-align: center; overflow-x: auto; font: 20px/1.65 "Cambria Math", "Times New Roman", serif; background: var(--soft); white-space: pre-wrap; }
/* 표와 코드의 폭 때문에 문서 전체에 가로 스크롤이 발생하지 않도록 한다. */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 320px; }
th, td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
th { background: var(--soft); }
figure { margin: 24px 0; }
figure img { display: block; max-width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: 13px; }
.section { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 20px; }
.section h2 { margin: 0 0 14px; }
.section ul { margin: 0; padding-left: 20px; }
.section li { margin: 7px 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 20px; }
.post-nav > :last-child { text-align: right; }
.post-nav small { display: block; color: var(--muted); }
.thread { margin: 0 0 24px; }
.comment { padding: 14px 16px; border: 1px solid var(--line); border-radius: 5px; background: white; scroll-margin-top: 20px; }
.comment.is-author { background: var(--author); border-color: #dce5ed; }
.comment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; }
.comment-head a { font-weight: 650; color: var(--ink); }
.author-mark { color: var(--accent); font-weight: 500; }
.comment p { margin: 8px 0 0; font-size: 14px; white-space: pre-wrap; line-height: 1.8; }
.comment:target, .comment.highlight { outline: 2px solid #9ab1c4; outline-offset: 2px; }
/* 대화가 길어진다고 화면의 가로 길이가 증가하지는 않는다. 들여쓰기는 한 단계로 제한한다. */
.replies { margin: 9px 0 0 18px; padding-left: 16px; border-left: 2px solid #dce4eb; display: grid; gap: 8px; }
.reply-to { color: var(--accent); font-size: 12px; margin-top: 6px; }
.comment-archive { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-archive p { white-space: pre-wrap; margin: 8px 0; }
.empty { padding: 30px 0; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); text-align: center; padding: 24px 20px; font-size: 12px; }
.site-footer p { margin: 4px 0; }
/* 작은 화면에서는 카테고리보다 읽을 내용을 먼저 확보한다. */
@media (max-width: 760px) {
  .header-inner { padding: 18px 20px; }
  .brand { font-size: 21px; }
  .layout { display: block; padding: 24px 20px 42px; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 20px; margin-bottom: 26px; }
  .profile { margin-bottom: 14px; }
  .avatar { display: none; }
  .profile p { margin-top: 6px; }
  .mode-panel { padding: 12px 0; }
  .mode-panel select { width: auto; min-width: 220px; }
  #sidePanel > summary { display: list-item; font-size: 14px; color: var(--accent); margin-top: 14px; cursor: pointer; }
  .sidebar nav { margin-top: 15px; }
  .post-card h2 { font-size: 19px; }
  .post-body { line-height: 1.85; }
  .replies { margin-left: 8px; padding-left: 8px; }
  .comment { padding: 12px; }
}
