/* ===== Narrower container for readability ===== */
.container-narrow {
  max-width: 760px;
  width: 92%;
}

/* ===== Note article ===== */
.note {
  padding-top: 10px;
}

.note-header {
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.note-meta {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: .02rem;
}
.note-category {
  color: var(--accent);
  font-weight: 600;
}
.note-dot {
  color: var(--border-faint);
  margin: 0 4px;
}

/* ===== Note body — Korean readability tuned ===== */
.note-body {
  font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.65rem;
  line-height: 1.85;
  color: var(--text-secondary);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.note-body h1,
.note-body h2,
.note-body h3,
.note-body h4 {
  font-weight: 700;
  letter-spacing: -.02rem;
  color: var(--heading);
  line-height: 1.35;
  margin-top: 2.2em;
  margin-bottom: 0.7em;
}

.note-body h1 {
  font-size: 2.8rem;
  border-bottom: 2px solid var(--heading-strong);
  padding-bottom: 8px;
  margin-top: 1.2em;
}
.note-body h2 {
  font-size: 2.2rem;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 6px;
}
.note-body h3 {
  font-size: 1.85rem;
}
.note-body h4 {
  font-size: 1.65rem;
  color: var(--text-tertiary);
}

.note-body p {
  margin: 0 0 1.1em 0;
}

.note-body a {
  color: var(--link-hover);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.note-body a:hover {
  text-decoration: none;
  border-bottom-color: var(--link-hover);
}

.note-body strong,
.note-body b {
  color: var(--heading);
  font-weight: 700;
}

.note-body ul,
.note-body ol {
  list-style-position: outside;
  padding-left: 1.8em;
  margin: 0.5em 0 1.2em 0;
}
.note-body ol { list-style-type: decimal; }
.note-body ul { list-style-type: disc; }
.note-body ol ol { list-style-type: lower-alpha; }
.note-body ul ul { list-style-type: circle; }
.note-body li {
  margin-bottom: 0.35em;
  padding-left: 0.2em;
}
.note-body li::marker {
  color: var(--marker);
  font-weight: 600;
}
.note-body li > p {
  margin: 0.3em 0;
}

.note-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 16px;
  margin: 1em 0;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
}
.note-body blockquote p {
  margin: 0.4em 0;
}

.note-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

.note-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em auto;
  border-radius: 4px;
}

.note-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95em;
}
.note-body th,
.note-body td {
  border: 1px solid var(--border-table);
  padding: 8px 12px;
  text-align: left;
}
.note-body th {
  background: var(--bg-table-head);
  font-weight: 700;
}

/* ===== Inline code ===== */
.note-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--code-text);
}

/* ===== Code blocks (always dark theme, both modes) ===== */
.note-body pre,
.note-body div.highlighter-rouge pre,
.note-body div.highlight pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.35rem;
  line-height: 1.6;
  background: #1b1f24;
  color: #f6f8fa;
  padding: 14px 18px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
  white-space: pre;
}
.note-body pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}
.note-body div.highlighter-rouge,
.note-body div.highlight {
  background: transparent;
  margin: 1em 0;
}
.note-body div.highlight pre,
.note-body div.highlighter-rouge pre {
  margin: 0;
}

/* ===== KaTeX-rendered math (override dark code-block styling) ===== */
.note-body pre.math-rendered {
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 1em 0;
  border-radius: 0;
  overflow-x: auto;
  white-space: normal;
  text-align: center;
}
.note-body code.math-rendered {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
}

/* ===== Rouge syntax highlight (minimal, for dark code blocks) ===== */
.highlight .c, .highlight .c1, .highlight .cm { color: #7c8590; font-style: italic; } /* comment */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #ff7b72; } /* keyword */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .se, .highlight .si { color: #a5d6ff; } /* string */
.highlight .mi, .highlight .mf, .highlight .il { color: #79c0ff; } /* number */
.highlight .nf, .highlight .nc { color: #d2a8ff; } /* function/class name */
.highlight .nb { color: #ffa657; } /* builtin */
.highlight .nn { color: #d2a8ff; } /* namespace */
.highlight .o, .highlight .ow { color: #ff7b72; } /* operator */
.highlight .p { color: #e8e8e8; } /* punctuation */

/* ===== Notes index page ===== */
.notes-index-title {
  font-size: 3.2rem;
  margin: 0 0 4px 0;
  letter-spacing: -.04rem;
  color: var(--heading);
}
.notes-index-sub {
  color: var(--text-muted);
  font-size: 1.5rem;
  margin: 0;
}
.notes-category {
  margin-top: 36px;
}
.notes-category h2 {
  font-size: 1.9rem;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 4px !important;
  color: var(--heading);
}
.category-subtitle {
  margin: 0 0 14px 0 !important;
  font-size: 1.4rem;
  color: var(--text-muted);
  letter-spacing: .01rem;
}
.notes-desc {
  color: var(--text-faint);
  font-size: 1.35rem;
  margin-top: 2px !important;
  line-height: 1.55;
}

/* ===== Comments (giscus) ===== */
.comments-section {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  letter-spacing: -.02rem;
}
.comments-section .giscus,
.comments-section .giscus-frame {
  width: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .container-narrow {
    width: 92%;
  }
  .note-body {
    font-size: 1.55rem;
    line-height: 1.8;
  }
  .note-body h1 { font-size: 2.4rem; }
  .note-body h2 { font-size: 1.95rem; }
  .note-body h3 { font-size: 1.7rem; }
  .note-body pre {
    font-size: 1.25rem;
    padding: 12px 14px;
  }
}
