/* ---------- 기본 배경 / 타이포 ---------- */

:root {
  --notes-bg: #f5f6f7;
  --notes-grid: #e0e2e5;
  --notes-panel-bg: #ffffff;
  --notes-panel-border: #111111;
  --notes-accent: #111111;
  --notes-muted: #747b85;
  --notes-link: #0b7cff;
  --notes-link-hover: #004dda;
}

body {
  background-color: var(--notes-bg);
  color: #111;
  font-family: "Noto Sans KR", "Pretendard", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;

  /* 바둑판 느낌 그리드 배경 */
  background-image: linear-gradient(
      to right,
      var(--notes-grid) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, var(--notes-grid) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* 종이 질감 같은 노이즈 오버레이 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.12'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* docsify 기본 anchor 밑줄 제거 + 색상 */
.markdown-section a {
  color: var(--notes-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(11, 124, 255, 0.35);
}

.markdown-section a:hover {
  color: var(--notes-link-hover);
  border-bottom-color: rgba(0, 77, 218, 0.7);
}

/* ---------- 레이아웃 조정 ---------- */

/* 전체 레이아웃 폭 살짝 줄이기 */
.content {
  max-width: 980px;
}

/* 컨텐츠 영역을 패널처럼 */
.markdown-section {
  background-color: var(--notes-panel-bg);
  border: 1px solid var(--notes-panel-border);
  box-shadow: 0 12px 0 #11111110;
  padding: 32px 40px 40px;
  margin: 68px auto 80px;
  border-radius: 6px;
}

/* 상단 Notes / About 영역 사이 여백 */
.markdown-section h1 {
  font-family: "Pretendard", system-ui, sans-serif;
  font-size: 32px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* 2~3단계 헤딩들 */
.markdown-section h2,
.markdown-section h3 {
  font-family: "Pretendard", system-ui, sans-serif;
}

.markdown-section h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 12px;
}

.markdown-section h3 {
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 10px;
}

/* 본문과 제목에서 단어가 중간에 잘리지 않도록 */
.markdown-section,
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section p,
.markdown-section li {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 리스트 간격 조금 줄이기 */
.markdown-section ul {
  margin: 10px 0 14px;
  padding-left: 20px;
}

.markdown-section li {
  margin: 2px 0;
}

/* 노트 요약(meta) 줄은 살짝 연해 보이게 */
.note-meta {
  color: var(--notes-muted);
}

.note-meta a {
  color: inherit; /* 혹시 링크 들어가도 회색 유지 */
}

.note-meta::before {
  content: " ";
}

/* 귀여운 강아지 WIP 뱃지 */
.note-puppy {
  display: inline-block;
  height: 2em; /* 글자 높이랑 비슷하게 */
  margin-left: 4px; /* 글자랑 살짝 띄우기 */
  vertical-align: middle; /* 글줄 가운데 정렬 */
}

/* 움직이는 거 싫은 사람들(접근성) 배려용 */
@media (prefers-reduced-motion: reduce) {
  .markdown-section li .note-puppy {
    display: none;
  }
}

/* ---------- 사이드바 (가독성 + 테크데모 느낌) ---------- */

.sidebar {
  background-color: rgba(245, 246, 247, 0.92);
  border-right: 1px solid #11111130;
  backdrop-filter: blur(4px);
}

.sidebar .search {
  padding: 8px 16px 12px;
}

/* 사이드바 제목(로고) */
.app-name {
  font-family: "Noto Sans KR", "Pretendard", system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

/* 사이드바 항목 전체 줄 간격/패딩 조절 */
.sidebar-nav li a {
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 18px;
  border-radius: 4px;
  display: block;
  /* 긴 제목 줄바꿈/가독성 */
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: keep-all;
}

/* 길이가 길어도 줄바꿈은 허용하되, 너무 넓지 않게 */
.sidebar-nav {
  padding: 12px 8px 24px;
}

.sidebar-nav ul ul {
  padding-left: 10px;
}

/* 현재 페이지 강조 (테크데모식 아웃라인 느낌) */
.sidebar-nav li.active > a {
  background-color: #11111105;
  border: 1px solid #11111180;
  box-shadow: 0 0 0 1px #ffffff;
}

/* hover 시 라벨 강조 */
.sidebar-nav li a:hover {
  background-color: #11111108;
}

/* ---------- 상단 navbar (있다면) ---------- */

body .app-nav {
  font-family: "Pretendard", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 500;
}

/* ---------- 코드블록 / 인라인 코드 / quote (Dracula-ish) ---------- */

:root {
  --notes-code-bg: #eaeaf2;
  --notes-code-border: #1d1e26;
  --notes-code-text: #111111;
  --notes-code-comment: #5b6bb0;
  --notes-code-keyword: #c47dff;
  --notes-code-string: #7fdc6e;
  --notes-code-number: #ff9b4a;
}

/* 블록 코드 */
.markdown-section pre {
  background-color: var(--notes-code-bg);
  color: var(--notes-code-text);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25);
  border: 1px solid var(--notes-code-border);
  overflow-x: auto;
}

/* 블록 안의 코드 */
.markdown-section pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  background: transparent;
  padding: 0;
  color: inherit;
}

/* 인라인 코드 */
.markdown-section p code,
.markdown-section li code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background-color: #eaeaf2;
  color: #222;
  border: 1px solid #dedee8;
}

/* Prism / highlight.js 토큰 공통적으로 맞춰주기 (있으면 적용됨) */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--notes-code-comment);
}

.token.keyword,
.token.operator,
.token.boolean,
.token.function {
  color: var(--notes-code-keyword);
}

.token.string,
.token.char,
.token.symbol,
.token.inserted {
  color: var(--notes-code-string);
}

.token.number,
.token.constant,
.token.builtin {
  color: var(--notes-code-number);
}

/* 인용문은 카드 느낌으로 좀 더 밝게 */
.markdown-section blockquote {
  margin: 16px 0;
  padding: 10px 12px;
  border-left: 3px solid #c2c7d0;
  background-color: #f5f7fa;
  color: #444;
  border-radius: 4px;
}

/* ---------- 홈 루트 전용 사이드바 숨김 / 레이아웃 ---------- */

html.no-sidebar {
  --sidebar-width: 0;
}

html.no-sidebar .sidebar {
  display: none !important;
}

html.no-sidebar .sidebar-toggle {
  display: none !important;
}

html.no-sidebar .content {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
}

/* ---------- 모바일 대응(간단) ---------- */

@media (max-width: 768px) {
  .markdown-section {
    margin: 24px 12px 48px;
    padding: 20px 18px 24px;
  }

  .sidebar {
    width: 260px;
  }
}
