/* A static look-alike of Obsidian's default theme, reading view. Written from scratch for this project, using the
   default theme's published variable values (colors, sizes, fonts), so notes look the way they do in the app.
   Light and dark follow the system; the header button switches and remembers (theme.js).

   One fixed theme: when a site sets "theme": "light" or "dark" in blog.config.json, lib/blog.mjs (fixedThemeCss)
   cuts the marked parts out of the copy it writes. "theme-switch" parts exist only to follow the system setting
   and to draw the header button; "theme-dark" parts hold the dark values. Keep every such rule inside its markers.
   @date Last edited 2026-11-13 */

:root {
  --font-default: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --font-monospace-default: ui-monospace, SFMono-Regular, "Cascadia Mono", "Roboto Mono", "DejaVu Sans Mono", "Liberation Mono", Menlo, Monaco, Consolas, "Source Code Pro", monospace;
  --font-text: var(--font-default);
  --font-interface: var(--font-default);
  --font-monospace: var(--font-monospace-default);
  --font-text-size: 16px;
  --font-smaller: 0.875em;
  --font-smallest: 0.8em;
  --font-ui-small: 13px;
  --font-ui-smaller: 12px;
  --line-height-normal: 1.5;
  --line-height-tight: 1.3;
  --file-line-width: 700px;
  --size-4-1: 4px; --size-4-2: 8px; --size-4-3: 12px; --size-4-4: 16px; --size-4-6: 24px; --size-4-8: 32px; --size-4-12: 48px;
  --radius-s: 4px; --radius-m: 8px; --radius-l: 12px;

  --h1-size: 1.802em; --h2-size: 1.602em; --h3-size: 1.424em; --h4-size: 1.266em; --h5-size: 1.125em; --h6-size: 1em;
  --h1-weight: 700; --h2-weight: 600; --h3-weight: 600; --h4-weight: 600; --h5-weight: 600; --h6-weight: 600;
  --h1-line-height: 1.2; --h2-line-height: 1.2; --h3-line-height: 1.3; --h4-line-height: 1.4; --h5-line-height: 1.5; --h6-line-height: 1.5;

  --accent-h: 258; --accent-s: 88%; --accent-l: 66%;

  /* light */
  --color-red-rgb: 233, 49, 71; --color-orange-rgb: 236, 117, 0; --color-yellow-rgb: 224, 172, 0; --color-green-rgb: 8, 185, 78;
  --color-cyan-rgb: 0, 191, 188; --color-blue-rgb: 8, 109, 221; --color-purple-rgb: 120, 82, 238; --color-pink-rgb: 213, 57, 132;
  --color-base-00: #ffffff; --color-base-05: #fcfcfc; --color-base-10: #fafafa; --color-base-20: #f6f6f6; --color-base-25: #e3e3e3;
  --color-base-30: #e0e0e0; --color-base-35: #d4d4d4; --color-base-40: #bdbdbd; --color-base-50: #ababab; --color-base-60: #707070;
  --color-base-70: #5c5c5c; --color-base-100: #222222;
  --color-accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --color-accent-1: hsl(calc(var(--accent-h) - 1), calc(var(--accent-s) * 1.01), calc(var(--accent-l) * 1.075));
  --color-accent-2: hsl(calc(var(--accent-h) - 3), calc(var(--accent-s) * 1.02), calc(var(--accent-l) * 1.15));
  --text-accent: var(--color-accent);
  --text-accent-hover: var(--color-accent-2);
  --highlight: rgba(255, 208, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}


:root {
  --background-primary: var(--color-base-00);
  --background-primary-alt: var(--color-base-10);
  --background-secondary: var(--color-base-20);
  --background-modifier-border: var(--color-base-30);
  --background-modifier-hover: rgba(var(--mono-rgb-100, 0, 0, 0), 0.075);
  --text-normal: var(--color-base-100);
  --text-muted: var(--color-base-70);
  --text-faint: var(--color-base-50);
  --interactive-accent: var(--color-accent);
  --interactive-accent-hsl: var(--accent-h), var(--accent-s), var(--accent-l);
  --link-color: var(--text-accent);
  --link-color-hover: var(--text-accent-hover);
  --tag-color: var(--text-accent);
  --tag-background: hsla(var(--interactive-accent-hsl), 0.1);
  --tag-background-hover: hsla(var(--interactive-accent-hsl), 0.2);
  --code-background: var(--background-primary-alt);
  --code-normal: var(--text-muted);
  --blockquote-border-color: var(--interactive-accent);
  --hr-color: var(--background-modifier-border);
  --table-border-color: var(--background-modifier-border);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background-primary); color: var(--text-normal);
  font-family: var(--font-text); font-size: var(--font-text-size); line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
}
.svg-icon { width: 18px; height: 18px; stroke-width: 1.75px; vertical-align: middle; }

/* ---------- the tab header (breadcrumbs + actions), like the top of a note pane */
.view-header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--size-4-2);
  height: 40px; padding: 0 var(--size-4-3); background: var(--background-primary);
  border-bottom: 1px solid var(--background-modifier-border); font-family: var(--font-interface); font-size: var(--font-ui-small);
}
.view-header-breadcrumbs { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 2px; overflow: hidden; white-space: nowrap; }
.view-header-breadcrumb { color: var(--text-muted); text-decoration: none; padding: 2px 6px; border-radius: var(--radius-s); overflow: hidden; text-overflow: ellipsis; }
.view-header-breadcrumb:last-child { color: var(--text-normal); }
.view-header-breadcrumb:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.view-header-breadcrumb-separator { color: var(--text-faint); padding: 0 2px; }
.view-actions { position: absolute; right: var(--size-4-3); display: flex; gap: 2px; }
.clickable-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text-muted); cursor: pointer; }
.clickable-icon:hover { background: var(--background-modifier-hover); color: var(--text-normal); }

/* ---------- reading view */
.markdown-preview-view { padding: var(--size-4-8) var(--size-4-8) 0; }
.markdown-preview-sizer { max-width: var(--file-line-width); margin: 0 auto; padding-bottom: 120px; }
@media (max-width: 600px) { .markdown-preview-view { padding: var(--size-4-6) var(--size-4-4) 0; } .view-header-breadcrumbs { justify-content: flex-start; } }

.inline-title {
  font-size: var(--h1-size); font-weight: var(--h1-weight); line-height: var(--h1-line-height); letter-spacing: -0.015em;
  margin: 0 0 0.5em; overflow-wrap: anywhere;
}
.markdown-rendered { overflow-wrap: break-word; }
.markdown-rendered p { margin-block: 1em; }
.markdown-rendered h1, .markdown-rendered h2, .markdown-rendered h3, .markdown-rendered h4, .markdown-rendered h5, .markdown-rendered h6 {
  margin: 1.5em 0 0.5em; letter-spacing: -0.015em; scroll-margin-top: 56px; }
.markdown-rendered h1 { font-size: var(--h1-size); font-weight: var(--h1-weight); line-height: var(--h1-line-height); }
.markdown-rendered h2 { font-size: var(--h2-size); font-weight: var(--h2-weight); line-height: var(--h2-line-height); }
.markdown-rendered h3 { font-size: var(--h3-size); font-weight: var(--h3-weight); line-height: var(--h3-line-height); }
.markdown-rendered h4 { font-size: var(--h4-size); font-weight: var(--h4-weight); line-height: var(--h4-line-height); }
.markdown-rendered h5 { font-size: var(--h5-size); font-weight: var(--h5-weight); line-height: var(--h5-line-height); }
.markdown-rendered h6 { font-size: var(--h6-size); font-weight: var(--h6-weight); line-height: var(--h6-line-height); }
.markdown-rendered strong { font-weight: 700; }
.markdown-rendered a { color: var(--link-color); text-decoration-line: underline; text-decoration-thickness: auto; text-underline-offset: 2px; }
.markdown-rendered a:hover { color: var(--link-color-hover); }
.markdown-rendered a.external-link { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
  background-position: right 1px center; background-repeat: no-repeat; background-size: 0.8em; padding-right: 1em; }
.internal-link.is-unresolved { color: inherit; text-decoration: none; }
.markdown-rendered mark { background: var(--highlight); color: var(--text-normal); padding: 0 1px; }
.markdown-rendered hr { border: 0; border-top: 2px solid var(--hr-color); margin: 2em 0; }
.markdown-rendered img { max-width: 100%; height: auto; border-radius: 0; }
.markdown-rendered ul, .markdown-rendered ol { padding-inline-start: 2.25em; margin-block: 0.5em; }
.markdown-rendered ul ul, .markdown-rendered ol ol, .markdown-rendered ul ol, .markdown-rendered ol ul { margin-block: 0; }
.markdown-rendered li { margin-block: 0.125em; }
.markdown-rendered li::marker { color: var(--text-faint); }
.markdown-rendered ul > li::marker { font-size: 0.9em; }
.markdown-rendered ul.contains-task-list { padding-inline-start: 1.4em; }
.markdown-rendered .task-list-item { list-style: none; }
.markdown-rendered .task-list-item.is-checked { color: var(--text-muted); text-decoration: line-through; }
.task-list-item-checkbox, .metadata-input-checkbox {
  appearance: none; -webkit-appearance: none; width: var(--font-text-size); height: var(--font-text-size); margin: 0 6px 0 -1.4em;
  vertical-align: -0.15em; border: 1px solid var(--text-faint); border-radius: var(--radius-s); background: none; position: relative; }
.metadata-input-checkbox { margin: 0; }
.task-list-item-checkbox:checked, .metadata-input-checkbox:checked { background: var(--interactive-accent); border-color: var(--interactive-accent); }
.task-list-item-checkbox:checked::after, .metadata-input-checkbox:checked::after { content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 80% no-repeat; }

/* blockquote */
.markdown-rendered blockquote { margin: 1em 0; padding: 0 0 0 var(--size-4-6); border-inline-start: 2px solid var(--blockquote-border-color); color: inherit; font-style: normal; }

/* code */
.markdown-rendered code { font-family: var(--font-monospace); font-size: var(--font-smaller); color: var(--code-normal);
  background: var(--code-background); border-radius: var(--radius-s); padding: 0.1em 0.25em; }
.markdown-rendered .code-block { position: relative; margin: 1em 0; }
.markdown-rendered pre { margin: 0; padding: var(--size-4-3) var(--size-4-4); background: var(--code-background); border-radius: var(--radius-s);
  overflow-x: auto; white-space: pre; line-height: var(--line-height-normal); }
.markdown-rendered pre code { padding: 0; background: none; font-size: var(--font-smaller); color: var(--text-normal); }
.markdown-rendered .code-lang { position: absolute; top: 6px; right: 10px; font-family: var(--font-interface); font-size: var(--font-ui-smaller); color: var(--text-faint); }

/* tables */
.markdown-rendered .table-wrapper { overflow-x: auto; margin: 1em 0; }
.markdown-rendered table { border-collapse: collapse; font-size: var(--font-text-size); }
.markdown-rendered th, .markdown-rendered td { border: 1px solid var(--table-border-color); padding: var(--size-4-1) var(--size-4-3); text-align: start; vertical-align: top; }
.markdown-rendered th { font-weight: 600; }

/* tags */
a.tag, .tag {
  display: inline-block; background: var(--tag-background); color: var(--tag-color); border-radius: 2em; padding: 0.15em 0.65em;
  font-size: var(--font-smaller); line-height: 1; text-decoration: none; vertical-align: baseline; }
a.tag:hover { background: var(--tag-background-hover); color: var(--tag-color); }
.markdown-rendered a.tag { text-decoration: none; }
.tag-title { font-size: 0.7em; padding: 0.2em 0.6em; }

/* ---------- callouts */
.callout {
  --callout-color: var(--color-blue-rgb);
  overflow: hidden; margin: 1em 0; padding: var(--size-4-3) var(--size-4-3) var(--size-4-3) var(--size-4-6);
  border-radius: var(--radius-s); background: rgba(var(--callout-color), 0.1); mix-blend-mode: normal; }
.callout[data-callout="abstract"] { --callout-color: var(--color-cyan-rgb); }
.callout[data-callout="info"] { --callout-color: var(--color-blue-rgb); }
.callout[data-callout="todo"] { --callout-color: var(--color-blue-rgb); }
.callout[data-callout="tip"] { --callout-color: var(--color-cyan-rgb); }
.callout[data-callout="success"] { --callout-color: var(--color-green-rgb); }
.callout[data-callout="question"] { --callout-color: var(--color-orange-rgb); }
.callout[data-callout="warning"] { --callout-color: var(--color-orange-rgb); }
.callout[data-callout="failure"], .callout[data-callout="danger"], .callout[data-callout="bug"] { --callout-color: var(--color-red-rgb); }
.callout[data-callout="example"] { --callout-color: var(--color-purple-rgb); }
.callout[data-callout="quote"] { --callout-color: 158, 158, 158; }
.callout-title { display: flex; gap: var(--size-4-1); align-items: flex-start; color: rgb(var(--callout-color)); font-weight: 600; line-height: var(--line-height-tight); }
summary.callout-title { list-style: none; cursor: pointer; }
summary.callout-title::-webkit-details-marker { display: none; }
.callout-icon { flex: 0 0 auto; display: flex; align-items: center; }
.callout-icon .svg-icon { width: 18px; height: 18px; stroke-width: 2px; color: rgb(var(--callout-color)); }
.callout-title-inner { flex: 0 1 auto; }
.callout-title-inner p { margin: 0; }
.callout-fold { display: flex; align-items: center; padding-inline-end: 8px; }
.callout-fold .svg-icon { transition: transform 100ms ease-in-out; }
details.callout:not([open]) .callout-fold .svg-icon { transform: rotate(-90deg); }
.callout-content { overflow-x: auto; padding: 0; background: transparent; }
.callout-content > :first-child { margin-top: var(--size-4-2); }
.callout-content > :last-child { margin-bottom: 0; }

/* ---------- embeds */
.internal-embed.image-embed { display: inline-block; max-width: 100%; }
.internal-embed.is-unresolved { color: var(--text-faint); }
.markdown-embed { position: relative; margin: 1em 0; padding: 0 0 0 var(--size-4-6); border-inline-start: 2px solid var(--interactive-accent); }
.markdown-embed-title { font-size: var(--h4-size); font-weight: 600; margin-bottom: 0.25em; }
.markdown-embed-link { position: absolute; top: 0; right: 0; color: var(--text-faint); text-decoration: none; }

/* ---------- Properties */
.metadata-container { margin: 0 0 var(--size-4-6); padding: var(--size-4-2) 0; font-family: var(--font-interface); font-size: var(--font-smaller); }
.metadata-properties-heading { margin-bottom: var(--size-4-1); }
.metadata-properties-title { font-size: var(--font-ui-small); font-weight: 600; color: var(--text-normal); }
.metadata-content { display: flex; flex-direction: column; gap: 3px; }
.metadata-property { display: flex; align-items: flex-start; border-radius: 6px; min-height: calc(var(--font-text-size) * 1.75); }
.metadata-property-key { display: flex; align-items: center; gap: var(--size-4-1); flex: 0 0 9em; width: 9em; min-height: inherit; padding: 0 var(--size-4-1);
  color: var(--text-muted); overflow: hidden; }
.metadata-property-icon { display: flex; color: var(--text-faint); }
.metadata-property-icon .svg-icon { width: 16px; height: 16px; }
.metadata-property-key-input { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metadata-property-value { flex: 1; min-width: 0; display: flex; align-items: center; min-height: inherit; padding: 0 var(--size-4-1); color: var(--text-normal); }
.metadata-input-longtext { padding: 4px 0; overflow-wrap: anywhere; }
.multi-select-container { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 0; }
.multi-select-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 2em; background: var(--background-modifier-hover);
  color: var(--text-normal); font-size: var(--font-ui-smaller); text-decoration: none; line-height: 1.4; }
.multi-select-pill.tag { background: var(--tag-background); color: var(--tag-color); font-size: var(--font-ui-smaller); padding: 2px 8px; }

/* ---------- Linked mentions (backlinks at the bottom of the note) */
.mod-footer { margin-top: var(--size-4-12); }
.embedded-backlinks { border-top: 1px solid var(--background-modifier-border); padding-top: var(--size-4-4); font-family: var(--font-interface); font-size: var(--font-ui-small); }
.backlink-pane .tree-item-self { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.tree-item-flair { color: var(--text-faint); font-weight: 400; background: var(--background-modifier-hover); border-radius: var(--radius-s); padding: 0 6px; font-size: var(--font-ui-smaller); }
.search-result { margin: 4px 0 10px; }
a.search-result-file-title { color: var(--text-normal); font-weight: 600; }
a.search-result-file-title:hover { color: var(--text-accent); }
.search-result-file-match { margin-left: 12px; padding: 6px 10px; border-radius: var(--radius-s); background: var(--background-secondary); color: var(--text-muted); line-height: 1.45; }
.search-empty-state { color: var(--text-faint); }

/* ---------- blog index and tag pages */
.blog-description { color: var(--text-muted); margin: -0.25em 0 var(--size-4-8); }
.markdown-rendered .post-list, .post-list { list-style: none; margin: 0; padding: 0; }
.post-item { padding: var(--size-4-4) 0; border-bottom: 1px solid var(--background-modifier-border); }
.post-item:first-child { padding-top: 0; }
.post-title { font-size: var(--h4-size); font-weight: 600; text-decoration: none !important; color: var(--text-normal) !important; }
.post-title:hover { color: var(--text-accent) !important; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--font-ui-small); color: var(--text-muted); }
.post-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.post-excerpt { margin: 6px 0 0; color: var(--text-muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* the "simple" front page ("indexStyle": "simple"): bold linked titles, a short preview, a full-width line between posts */
.post-simple .post-title strong { font-weight: 700; color: inherit; }
.post-simple .post-excerpt { font-size: var(--font-smaller); }
/* The preview text is a second link to the post (simple index). It keeps the look of plain preview text. */
.post-simple .post-excerpt-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.markdown-rendered hr.post-divider, hr.post-divider { width: 100%; border: 0; border-top: 1px solid var(--hr-color); margin: var(--size-4-6) 0; }

@media print { .view-header, .mod-footer { display: none; } }
@media (prefers-reduced-motion: reduce) { .callout-fold .svg-icon { transition: none; } }
