/* note-reader.css — LOCKED design from note-reader-v3.html
   Full-screen reader: minimal 48px side-nav + centered article column.
   Adapted to use CSS tokens (var(--bg), var(--text), ...). */

/* When the reader view is active, the <main> goes full width and shows the reader.
   Overrides the default #main column layout (see base.css). */
main.reader-mode {
  display: flex;
  flex-direction: row;
  flex: 1;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ============ MINIMAL SIDE NAV (48px wide) ============ */
.side-nav {
  width: 48px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  flex-shrink: 0;
  gap: 4px;
  border-right: 1px solid var(--border);
}

.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s;
  position: relative;
  padding: 0;
  font-family: inherit;
}
.nav-btn:hover { color: var(--text); }
.nav-btn:hover .tip { opacity: 1; }
.nav-btn .ico { width: 18px; height: 18px; }

.tip {
  position: absolute;
  left: 100%;
  margin-left: 12px;
  background: var(--text);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-weight: 500;
  z-index: 10;
}

.nav-progress {
  width: 2px;
  height: 160px;
  background: var(--border);
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}
.nav-progress .fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: var(--text-3);
  transition: height 0.06s linear;
}

.nav-spacer { flex: 1; }

/* ============ READER CONTENT ============ */
.reader-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 0;
}
.reader-content::-webkit-scrollbar { width: 8px; }
.reader-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.reader-article {
  max-width: 680px;
  width: 100%;
  padding: 96px 56px 200px;
}

/* Slim meta + title (no subtitle, no "OCR'd" badge — locked) */
.article-meta {
  font-size: var(--fs-md);
  color: var(--text-3);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.article-meta .sep { color: var(--text-4); margin: 0 8px; }

.article-title {
  font-size: var(--fs-4xl);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 56px;
  color: var(--text);
}

/* ============ PROSE — minimal ============ */
.prose { font-size: 16px; line-height: 1.75; color: var(--text); }

.prose h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin: 48px 0 16px;
}
.prose h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 48px 0 14px;
}
.prose h3 {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
  margin: 24px 0 8px;
}
.prose h4 {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  margin: 18px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prose p { margin-bottom: 18px; color: var(--text); }
.prose ul, .prose ol { margin: 14px 0 22px 0; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--text-4); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text-2); font-style: italic; }
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.prose a {
  color: var(--text);
  border-bottom: 1px solid var(--border-hi);
}
.prose a:hover { border-bottom-color: var(--text); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.prose pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 18px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.prose pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: var(--text);
  font-size: inherit;
}

.prose blockquote {
  border: none;
  padding: 0 0 0 22px;
  position: relative;
  color: var(--text-2);
  margin: 24px 0;
  font-style: italic;
}
.prose blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--border-hi);
}

/* Math (clean inline-feel even when display) — used for our fallback prose math
   classes if KaTeX is not loaded. KaTeX has its own styles. */
.math-display {
  font-family: var(--font-math);
  font-size: 17px;
  color: var(--text);
  margin: 24px 0;
  text-align: center;
}
.math-inline {
  font-family: var(--font-math);
  color: var(--text);
}
.frac { display: inline-block; vertical-align: middle; text-align: center; }
.frac > .num { display: block; border-bottom: 1px solid currentColor; padding: 0 6px; }
.frac > .den { display: block; padding: 0 6px; }
.sub { font-size: 0.7em; vertical-align: sub; }
.sup { font-size: 0.7em; vertical-align: super; }

/* KaTeX overrides — keep display equations centered and tone color */
.prose .katex { color: var(--text); }
.prose .katex-display {
  margin: 24px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* ============ CALLOUTS — pure text, no borders, no colors ============ */
.callout {
  margin: 24px 0;
  padding: 0;
  background: none;
  border: none;
}
.callout .ct {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 4px;
}
.callout p {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 0;
}

/* Obsidian-style `> [!info]` callouts rendered via marked end up as
   blockquotes — we leave them styled as blockquotes (above). */

/* Tables — minimal */
.prose table {
  border-collapse: collapse;
  margin: 28px 0;
  font-size: var(--fs-base);
  width: 100%;
}
.prose th {
  text-align: left;
  padding: 8px 14px 8px 0;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-hi);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.prose tr:last-child td { border-bottom: none; }

.end {
  color: var(--text-4);
  text-align: center;
  padding: 48px 0 0;
  font-size: var(--fs-md);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hide chrome (sidebar) when in reader mode — full-screen reader */
body.reader-mode .sidebar { display: none; }
body.reader-mode #pomodoro { display: none; }

/* Mermaid diagrams */
.mermaid-rendered {
  margin: 24px 0;
  display: flex;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow-x: auto;
}
.mermaid-rendered svg {
  max-width: 100%;
  height: auto;
}
.mermaid-error {
  margin: 16px 0;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-md);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

/* Obsidian-style callouts */
.cb {
  margin: 20px 0;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  border-left: 3px solid var(--text-3);
  overflow: hidden;
}
.cb-h {
  padding: 10px 16px 6px;
  font-weight: 600;
  font-size: var(--fs-md);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}
.cb-b {
  padding: 0 16px 12px;
  font-size: var(--fs-lg);
  color: var(--text-2);
  line-height: 1.6;
}
.cb-b > *:first-child { margin-top: 0; }
.cb-b > *:last-child { margin-bottom: 0; }
.cb-info       { border-left-color: var(--accent); }
.cb-info .cb-h { color: var(--accent); }
.cb-warning, .cb-warn { border-left-color: var(--orange); }
.cb-warning .cb-h, .cb-warn .cb-h { color: var(--orange); }
.cb-danger, .cb-error, .cb-bug { border-left-color: var(--red); }
.cb-danger .cb-h, .cb-error .cb-h, .cb-bug .cb-h { color: var(--red); }
.cb-success, .cb-tip, .cb-check { border-left-color: var(--green); }
.cb-success .cb-h, .cb-tip .cb-h, .cb-check .cb-h { color: var(--green); }
.cb-example, .cb-quote { border-left-color: var(--text-3); }
.cb-note { border-left-color: var(--text-3); }
.cb-note .cb-h { color: var(--text-2); }
.cb-todo { border-left-color: var(--yellow); }
.cb-todo .cb-h { color: var(--yellow); }

/* Hide KaTeX accessibility duplicates from selection (cosmetic) */
.katex-mathml { user-select: none; }
