/*
  Novadust color scheme on Obsidian, Publish style
*/

/* === NOVADUST COLOR PALETTE === */
:root {
  --darkest-blue: #18222b;
  --mid-blue: #273341;
  --light-blue: #303f51;
  --dark-blue: #1d2833;
  --soft-dark-blue: #2c3a4a;
  --ocean-blue: #2c4f64;
  --ocean-blue-rgb: 44, 79, 100;
  --bright-blue: #5dcbc3;
  --bright-blue-rgb: 93, 203, 195;
  --percy-blue: #84dca1;
  --percy-blue-rgb: 132, 220, 161;
  --bright-green: #b9e678;
  --bright-green-rgb: 185, 230, 120;
  --soft-yellow: #ffd580;
  --soft-yellow-rgb: 255, 213, 128;
  --bright-yellow: #f8c260;
  --bright-yellow-rgb: 248, 194, 96;
  --bright-orange: #ffa161;
  --bright-orange-rgb: 255, 161, 97;
  --bright-red: #ff695d;
  --bright-red-rgb: 255, 105, 93;
  --bright-purple: #d689e3;
  --bright-purple-rgb: 214, 137, 227;
  --washed-blue: #74859a;
  --washed-blue-rgb: 116, 133, 154;
  --almost-white: #f7f5e9;
  --soft-white: #eeead1;
  --basic-gray: #cfd1d1;
  --blue-gray: #c4d1d1;
}

/* === REMOVING OBSIDIAN FOOTER WATERMARK === */
.site-footer a {
  display: none;
}

body {
  /* Accent: Novadust percy-blue (mint green) */
  --accent-h: 140;
  --accent-s: 56%;
  --accent-l: 69%;

  --bold-weight: var(--font-bold);
  --italic-color: var(--color-italic);
  --code-normal: var(--text-muted);
  --blockquote-color: var(--color-muted);

  --background-primary: var(--color-base-00);
  --background-secondary: var(--color-base-20);

  --callout-padding: 0px;
  --callout-title-padding: 11px;
  --callout-content-padding: 0 11px 0 27px;

  --embed-padding: 13px 23px;
  --list-indent: 37px;

  /* Novadust geometry — rounder */
  --border: 1px solid var(--tab-outline-color);
  --button-radius: 5px;
  --panel-radius: 10px;
  --window-radius: 20px;
  --button-padding-icon: 7px;
  --button-padding-long: 7px 15px;

  --background-fourth: var(--color-base-00-0);
  --background-fifth: var(--color-base-20-0);
  --panel-shadow: 0 1px 3px var(--color-base-shadow);
  --panel-shadow-hover: 0 3px 5px var(--color-base-shadow-hover);

  --color-strikethrough: var(--text-faint);
  --italic-color: var(--color-italic);
  --inline-code-color: var(--color-red);
}

/* Light theme: Novadust palette adapted for light */
.theme-light {
  --color-base-00: hsl(210, 25%, 96%);
  --color-base-05: hsl(210, 22%, 92%);
  --color-base-10: hsl(210, 22%, 92%);
  --color-base-20: hsl(210, 25%, 94%);
  --color-base-00-0: hsl(210, 25%, 98%);
  --color-base-20-0: hsla(210, 25%, 85%, 0.15);
  --color-base-shadow: hsla(210, 35%, 15%, 0.1);
  --color-base-shadow-hover: hsla(210, 35%, 15%, 0.2);
  --color-base-hover: var(--color-base-shadow-hover);

  --color-base-35: hsl(210, 20%, 68%);
  --color-base-50: hsl(210, 18%, 50%);
  --color-base-70: hsl(210, 25%, 32%);
  --color-base-100: hsl(210, 30%, 14%);

  --color-accent: hsl(140, 45%, 45%);
  --color-accent-1: hsl(140, 45%, 52%);
  --color-accent-2: hsl(140, 45%, 38%);

  --color-red: #d94f46;
  --color-muted: var(--color-base-70);
  --color-italic: hsl(38, 80%, 38%);
  --color-highlight: var(--color-base-100);

  /* rainbow headings — Novadust light (vivid, saturated, space-retro) */
  --h1-color: #e8321e;
  /* neon red    */
  --h2-color: #e86818;
  /* neon orange */
  --h3-color: #b87800;
  /* retro amber */
  --h4-color: #508a08;
  /* vivid lime  */
  --h5-color: #0e9048;
  /* vivid emerald */
  --h6-color: #10a098;
  /* neon teal   */

  --inline-title-color: #0e9048;

  /* bold */
  --bold-color: #508a08;

  /* tags */
  --tag-color: #508a08;
  --tag-background: rgba(80, 138, 8, 0.1);
  --tag-border-color: transparent;
  --tag-border-width: 0px;
  --tag-radius: 15px;

  /* links */
  --link-color: #e86818;
  --link-color-hover: rgba(232, 104, 24, 0.8);
  --link-external-color: #10a098;
  --link-external-color-hover: rgba(16, 160, 152, 0.8);
  --link-unresolved-color: var(--color-base-50);

  /* highlights */
  --text-highlight-bg: rgba(80, 138, 8, 0.15);
}

/* Dark theme: Novadust */
.theme-dark {
  /* backgrounds */
  --color-base-00: #1d2833;
  --color-base-05: rgba(29, 40, 51, 0.7);
  --color-base-10: #1d2833;
  --color-base-20: #1d2833;
  --color-base-00-0: #2c3a4a;
  --color-base-20-0: rgba(48, 63, 81, 0.25);
  --color-base-shadow: rgba(24, 34, 43, 0.35);
  --color-base-shadow-hover: rgba(24, 34, 43, 0.5);
  --color-base-hover: #273341;
  --color-base-30: #18222b;
  --color-base-35: #273341;

  /* foreground */
  --color-base-50: #74859a;
  /* washed-blue — muted */
  --color-base-70: #cfd1d1;
  /* basic-gray  — text  */
  --color-base-100: #eeead1;
  /* soft-white  — main  */
  --color-base-120: #f7f5e9;
  /* almost-white — highlight */

  /* accent: percy-blue (mint green) */
  --color-accent: #84dca1;
  --color-accent-1: #a0e8b8;
  --color-accent-2: #6bc888;

  /* semantic */
  --color-red: #ff695d;
  --color-muted: #74859a;
  --color-italic: #f8c260;

  /* highlights */
  --color-highlight: #eeead1;
  --text-highlight-bg: rgba(132, 220, 161, 0.5);

  /* rainbow headings — Novadust order */
  --h1-color: #ff695d;
  /* bright-red    */
  --h2-color: #ffa161;
  /* bright-orange */
  --h3-color: #f8c260;
  /* bright-yellow */
  --h4-color: #b9e678;
  /* bright-green  */
  --h5-color: #84dca1;
  /* percy-blue    */
  --h6-color: #5dcbc3;
  /* bright-blue   */

  /* tags */
  --tag-color: #b9e678;
  --tag-background: rgba(44, 79, 100, 0.5);
  --tag-border-color: transparent;
  --tag-border-width: 0px;
  --tag-radius: 15px;
  --inline-title-color: #84dca1;

  /* bold */
  --bold-color: #b9e678;

  /* links */
  --link-color: #ffa161;
  --link-color-hover: rgba(255, 161, 97, 0.85);
  --link-external-color: #5dcbc3;
  --link-external-color-hover: rgba(93, 203, 195, 0.85);
  --link-unresolved-color: #74859a;

  /* border — Novadust mid-blue */
  --tab-outline-color: #273341;
}


/* === BACKGROUND === */

body {
  background-color: var(--background-secondary);
}


/* === SCROLLBAR (hidden until hovered) === */

::-webkit-scrollbar-thumb {
  visibility: hidden;
}

::-webkit-scrollbar-thumb:hover {
  visibility: initial;
}

/* Hide horizontal scroll on center column, keep vertical */
.site-body-center,
.site-body-center-column,
.markdown-preview-view {
  overflow-x: hidden !important;
}

/* Center column: z-index so it stacks above both sidebars */
.site-body-center,
.site-body-center-column {
  position: relative;
  z-index: 1 !important;
}

/* Sidebar edge shadows (Novadust) */
.site-body-left-column::after,
.site-body-right-column::before {
  content: "";
  position: absolute;
  top: 0;
  width: 32px;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.site-body-left-column::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.12) 30%, rgba(0, 0, 0, 0.05) 65%, transparent 100%);
}

.site-body-right-column::before {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.12) 30%, rgba(0, 0, 0, 0.05) 65%, transparent 100%);
}


/* === IMAGES === */

img {
  max-width: 100%;
  border-radius: var(--panel-radius);
}


/* === HIGHLIGHTS === */

mark {
  color: var(--color-highlight);
}

.theme-dark mark {
  background: var(--text-highlight-bg);
  color: var(--color-highlight);
  border-bottom: none;
  border-radius: 2px;
  padding: 0 2px;
}

.theme-light mark {
  background: var(--text-highlight-bg);
  color: var(--color-highlight);
  border-bottom: none;
  border-radius: 2px;
  padding: 0 2px;
}


/* === HORIZONTAL RULES === */

.theme-dark hr {
  border-color: #84dca1;
}

.theme-light hr {
  border-color: #0e9048;
}


/* === SUP / SUB === */

sup,
sub {
  font-size: 0.85em;
}

.footnote-ref {
  vertical-align: super;
}


/* === ITALICS === */

em {
  font-weight: bold;
}


/* === HEADINGS === */

:is(h1, h2, h3, h4, h5, h6),
.markdown-rendered :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 33px;
}

.markdown-preview-view h1 {
  margin-top: 73px;
}

/* No border under headings */
:is(h1, h2, h3, h4, h5, h6),
.markdown-rendered :is(h1, h2, h3, h4, h5, h6) {
  border-bottom: none !important;
}

/* Rainbow heading colors — Novadust dark */
.theme-dark h1,
.theme-dark .markdown-rendered h1 {
  color: var(--h1-color);
}

.theme-dark h2,
.theme-dark .markdown-rendered h2 {
  color: var(--h2-color);
}

.theme-dark h3,
.theme-dark .markdown-rendered h3 {
  color: var(--h3-color);
}

.theme-dark h4,
.theme-dark .markdown-rendered h4 {
  color: var(--h4-color);
}

.theme-dark h5,
.theme-dark .markdown-rendered h5 {
  color: var(--h5-color);
}

.theme-dark h6,
.theme-dark .markdown-rendered h6 {
  color: var(--h6-color);
}

/* Rainbow heading colors — Novadust light */
.theme-light h1,
.theme-light .markdown-rendered h1 {
  color: var(--h1-color);
}

.theme-light h2,
.theme-light .markdown-rendered h2 {
  color: var(--h2-color);
}

.theme-light h3,
.theme-light .markdown-rendered h3 {
  color: var(--h3-color);
}

.theme-light h4,
.theme-light .markdown-rendered h4 {
  color: var(--h4-color);
}

.theme-light h5,
.theme-light .markdown-rendered h5 {
  color: var(--h5-color);
}

.theme-light h6,
.theme-light .markdown-rendered h6 {
  color: var(--h6-color);
}

/* Inline page title */
.theme-dark .inline-title {
  color: var(--inline-title-color);
}

.theme-light .inline-title {
  color: var(--inline-title-color);
}


/* === LISTS === */

ul,
ol {
  padding: 7px 0 13px;
}

.callout-content> :is(ul, ol) {
  padding-block: 0;
}

blockquote> :is(ul, ol) {
  padding-block: 7px;
}

ol>li::marker,
ul>li::marker {
  margin-right: 3px;
}

.markdown-preview-sizer>div> :is(ul, ol) {
  padding-inline: 7px;
}

.markdown-preview-sizer>div ul li a:not(.tag),
div.callout ul li a:not(.tag) {
  word-break: break-all;
}

/* Rainbow ordered list markers — dark */
.theme-dark ol> :nth-child(6n + 1)::marker {
  color: #ff695d !important;
}

.theme-dark ol> :nth-child(6n + 2)::marker {
  color: #ffa161 !important;
}

.theme-dark ol> :nth-child(6n + 3)::marker {
  color: #ffd580 !important;
}

.theme-dark ol> :nth-child(6n + 4)::marker {
  color: #b9e678 !important;
}

.theme-dark ol> :nth-child(6n + 5)::marker {
  color: #84dca1 !important;
}

.theme-dark ol> :nth-child(6n + 6)::marker {
  color: #5dcbc3 !important;
}

/* Rainbow ordered list markers — light */
.theme-light ol> :nth-child(6n + 1)::marker {
  color: #e8321e !important;
}

.theme-light ol> :nth-child(6n + 2)::marker {
  color: #e86818 !important;
}

.theme-light ol> :nth-child(6n + 3)::marker {
  color: #b87800 !important;
}

.theme-light ol> :nth-child(6n + 4)::marker {
  color: #508a08 !important;
}

.theme-light ol> :nth-child(6n + 5)::marker {
  color: #0e9048 !important;
}

.theme-light ol> :nth-child(6n + 6)::marker {
  color: #10a098 !important;
}

/* Rainbow unordered list markers — dark */
.theme-dark ul> :nth-child(6n + 1)::marker {
  color: #ff695d !important;
}

.theme-dark ul> :nth-child(6n + 2)::marker {
  color: #ffa161 !important;
}

.theme-dark ul> :nth-child(6n + 3)::marker {
  color: #ffd580 !important;
}

.theme-dark ul> :nth-child(6n + 4)::marker {
  color: #b9e678 !important;
}

.theme-dark ul> :nth-child(6n + 5)::marker {
  color: #84dca1 !important;
}

.theme-dark ul> :nth-child(6n + 6)::marker {
  color: #5dcbc3 !important;
}

/* Rainbow unordered list markers — light */
.theme-light ul> :nth-child(6n + 1)::marker {
  color: #e8321e !important;
}

.theme-light ul> :nth-child(6n + 2)::marker {
  color: #e86818 !important;
}

.theme-light ul> :nth-child(6n + 3)::marker {
  color: #b87800 !important;
}

.theme-light ul> :nth-child(6n + 4)::marker {
  color: #508a08 !important;
}

.theme-light ul> :nth-child(6n + 5)::marker {
  color: #0e9048 !important;
}

.theme-light ul> :nth-child(6n + 6)::marker {
  color: #10a098 !important;
}


/* === TABLES === */

table {
  margin: 11px 7px;
  overflow: hidden;
  border-radius: var(--button-radius);
  /* separate (not collapse) is required for border-radius to actually render */
  border-collapse: separate;
  border-spacing: 0;
}

.theme-dark table {
  border: 1px solid var(--mid-blue);
}

.theme-dark thead th {
  background-color: var(--bright-red);
  color: var(--almost-white);
  border-bottom: 2px solid var(--darkest-blue);
}

.theme-dark tbody td {
  background-color: var(--light-blue);
  border-bottom: 1px solid var(--dark-blue);
}

.theme-dark tbody tr:last-child td {
  border-bottom: none;
}

.markdown-rendered :is(td, th) {
  padding: 4px 13px;
}


/* === STRIKETHROUGH === */

del {
  color: var(--color-strikethrough);
}

ul>li.task-list-item.is-checked {
  text-decoration-color: var(--color-strikethrough);
}


/* === CODE === */

code {
  --code-normal: var(--blockquote-color);
  margin-inline: 3px;
}

.markdown-rendered :not(pre)>code {
  color: var(--inline-code-color);
}

.markdown-rendered pre {
  overflow-x: auto;
}

/* Code block background — slightly lighter than the page bg */
.theme-dark pre,
.theme-dark .markdown-rendered pre {
  background-color: var(--soft-dark-blue);
  /* #2c3a4a — one step up from #1d2833 */
  border-radius: var(--button-radius);
}

.theme-light pre,
.theme-light .markdown-rendered pre {
  background-color: var(--color-base-05);
  /* hsl(210,22%,92%) — slightly darker than page bg */
  border-radius: var(--button-radius);
}

/* Mermaid diagrams and similar wide content */
.mermaid,
pre.mermaid,
.language-mermaid {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
}


/* === BLOCKQUOTES === */

.markdown-preview-view blockquote {
  margin: 13px 0;
  padding: 17px 27px 17px 37px;
  border-radius: var(--panel-radius);
  background: var(--background-secondary);
  border: var(--border);
  color: var(--blockquote-color);
  position: relative;
}

.markdown-preview-view blockquote::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 3px;
  height: calc(100% - 14px);
  background: var(--color-accent-1);
  border-radius: var(--button-radius);
}


/* === EMBEDS === */

.markdown-embed {
  border: var(--border);
  border-radius: var(--panel-radius);
  padding: var(--embed-padding);
}

.markdown-embed-content p:first-child {
  margin-top: 1em;
}


/* === CALLOUTS === */

.callout {
  border: 2px solid rgba(var(--callout-color), 0.3);
  border-radius: 10px;
  background-color: rgba(var(--callout-color), 0.07);
}

.callout-title {
  gap: var(--size-4-3);
  align-items: center;
  background-color: rgba(var(--callout-color), 0.07);
  border-bottom: 1px solid transparent;
  transition: border 0.3s;
}

.callout-icon,
.callout-fold {
  margin: 0;
  align-self: center;
}

.callout:not(.is-collapsed)>.callout-title:has(+ .callout-content) {
  border-bottom: 1px solid rgba(var(--callout-color), 0.3);
}


/* === CHECKBOXES === */

.markdown-preview-view .task-list-item-checkbox {
  padding: 11px;
  top: 5px;
}

input[type=checkbox]:checked::after {
  -webkit-mask-size: 73%;
  -webkit-mask-position: 73% 60%;
  width: 100%;
  height: 100%;
}


/* === OBSIDIAN-STYLE CARDS (HTML) === */
/* Use: <div class="obsidian-cards-grid"> ... <a class="obsidian-card" href="..."> ... </a> ... </div> */
.obsidian-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 1.5rem 0;
}

.obsidian-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--background-fourth);
  border: var(--border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  text-decoration: none;
  color: var(--text-normal);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.obsidian-card:hover {
  background: var(--background-fifth);
  box-shadow: var(--panel-shadow-hover);
  transform: translateY(-2px);
}

.obsidian-card strong,
.obsidian-card .obsidian-card-title {
  display: block;
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-normal);
}

.obsidian-card p,
.obsidian-card .obsidian-card-desc {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-muted);
  line-height: 1.4;
}

/* === OBSIDIAN-STYLE MUSIC CARDS (HTML) === */
.obsidian-music-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 1.5rem 0;
}

.obsidian-music-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--background-fourth);
  border: var(--border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  text-decoration: none;
  color: var(--text-normal);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.obsidian-music-card:hover {
  background: var(--background-fifth);
  box-shadow: var(--panel-shadow-hover);
  transform: translateY(-2px);
}

.obsidian-music-card strong,
.obsidian-music-card .obsidian-music-card-title {
  display: block;
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-normal);
}

.obsidian-music-card p,
.obsidian-music-card .obsidian-music-card-desc {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-muted);
  line-height: 1.4;
}

.obsidian-music-card img,
.obsidian-music-card .obsidian-music-card-img {
  width: 100%;
}

/* ============================================================
   SITE-SPECIFIC CUSTOMIZATIONS
   ============================================================ */

/* metadata-tag: custom tag links in frontmatter metadata block */
.frontmatter-metadata .metadata-tag {
  color: var(--color-accent-2) !important;
}

.frontmatter-metadata .metadata-tag:hover {
  color: var(--color-base-100) !important;
}


/* === SIDEBAR WIDTHS & MAIN CONTENT === */
/* Main content fills all space between sidebars */
:is(.site-body, .published-container .site-body) {
  display: flex !important;
}

.site-body-center,
.site-body-center-column {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Let markdown content use full available width */
.markdown-preview-view .markdown-preview-sizer,
.publish-renderer .markdown-preview-sizer {
  max-width: 100% !important;
}

/* Sidebar widths */
:is(.published-container, .site-body) .site-body-left-column,
.site-body-left-column {
  width: 250px !important;
  min-width: 180px !important;
  flex: 0 0 250px !important;
  position: relative;
  z-index: 0 !important;
}

:is(.published-container, .site-body) .site-body-right-column,
.site-body-right-column {
  width: 200px !important;
  min-width: 180px !important;
  max-width: 200px !important;
  flex: 0 0 200px !important;
  position: relative;
  z-index: 0 !important;
}


/* Hide Recent writeups & Recently edited from sidebar nav */
.tree-item-self[data-path="Recent writeups.md"],
.tree-item-self[data-path="Tags.md"],
.tree-item-self[data-path="Recently edited.md"] {
  display: none !important;
}


/* === LEFT SIDEBAR TOGGLE === */

#left-sidebar-toggle,
#right-sidebar-toggle {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  background: var(--background-secondary);
  border: var(--border);
  padding: 10px 6px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease;
  line-height: 1;
  font-size: 12px;
  color: var(--text-muted);
  user-select: none;
}

#left-sidebar-toggle {
  left: 0;
  border-left: none;
  border-radius: 0 var(--button-radius) var(--button-radius) 0;
}

#right-sidebar-toggle {
  right: 0;
  border-right: none;
  border-radius: var(--button-radius) 0 0 var(--button-radius);
}

#left-sidebar-toggle:hover,
#right-sidebar-toggle:hover {
  opacity: 1;
}

.site-body-left-column {
  transition: width 0.3s ease, opacity 0.3s ease, min-width 0.3s ease, max-width 0.3s ease, flex 0.3s ease;
  overflow: hidden;
}

.left-sidebar-hidden .site-body-left-column {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.left-sidebar-hidden {
  --line-width: 100% !important;
  --file-line-width: 100% !important;
}

.left-sidebar-hidden :is(.site-body-center, .site-body-center-column, .markdown-preview-view, .markdown-preview-sizer, .publish-renderer, .markdown-rendered) {
  max-width: none !important;
}


/* === RIGHT SIDEBAR TOGGLE === */

.site-body-right-column {
  transition: width 0.3s ease, opacity 0.3s ease, min-width 0.3s ease, max-width 0.3s ease;
  overflow: visible;
}

.right-sidebar-hidden .site-body-right-column {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

.right-sidebar-hidden {
  --line-width: 100% !important;
  --file-line-width: 100% !important;
}

.right-sidebar-hidden :is(.site-body-center, .site-body-center-column, .markdown-preview-view, .markdown-preview-sizer, .publish-renderer, .markdown-rendered) {
  max-width: none !important;
  width: 100% !important;
}

.right-sidebar-hidden #right-sidebar-toggle {
  right: 0;
}


/* === FOCUS MODE (pure CSS hover) === */
/* Sidebar blurs when hovering over the main content area — disabled by .focus-blur-off on body */

/* Focus mode: blur sidebars when hovering center (pure CSS) */
body:not(.focus-blur-off) .site-body:has(.site-body-center:hover, .markdown-preview-view:hover, .page-header:hover) .site-body-left-column,
body:not(.focus-blur-off) .site-body:has(.site-body-center:hover, .markdown-preview-view:hover, .page-header:hover) .site-body-right-column {
  pointer-events: none;
}

body:not(.focus-blur-off) .site-body:has(.site-body-center:hover, .markdown-preview-view:hover, .page-header:hover) .site-body-left-column .site-body-left-column-inner,
body:not(.focus-blur-off) .site-body:has(.site-body-center:hover, .markdown-preview-view:hover, .page-header:hover) .site-body-right-column>* {
  opacity: 0.25;
  filter: blur(2px);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.site-body-left-column-inner,
.site-body-right-column>* {
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* === FOCUS BLUR TOGGLE BUTTON === */
#focus-blur-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  height: 24px;
  padding: 0 8px;
  margin-left: 30px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--button-radius);
  opacity: 0.5;
  transition: opacity 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

#focus-blur-toggle:hover {
  opacity: 1;
}

#focus-blur-toggle.is-active {
  opacity: 1;
  color: var(--color-accent);
}


/* === IMAGE ZOOM ON CLICK (lightbox) === */
/* Images are clickable; JS shows overlay with enlarged view */

.markdown-preview-view img {
  max-width: 100%;
  cursor: pointer;
}

#image-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

#image-lightbox-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  cursor: default;
  margin: 0;
}

/* === FILE AND FOLDER ICONS === */
/* Obsidian Publish uses .tree-item-self + .tree-item-inner (not nav-folder/nav-file) */

body {
  --nav-icon-size: 16px;
  --nav-icon-gap: 7px;
}

/* Publish sidebar: tree-item-inner (nav-* is app-only, unused on published site) */
.tree-item-inner {
  position: relative;
  padding-left: calc(var(--nav-icon-size) + var(--nav-icon-gap)) !important;
  display: block;
}

.tree-item-inner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  background-color: currentColor;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
}

/* Closed folder */
.tree-item-self.mod-collapsible.is-collapsed .tree-item-inner::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/></svg>");
}

/* Open folder */
.tree-item-self.mod-collapsible:not(.is-collapsed) .tree-item-inner::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2'/></svg>");
}

/* File */
.tree-item-self:not(.mod-collapsible):not(.mod-root) .tree-item-inner::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 2v4'/><path d='M12 2v4'/><path d='M16 2v4'/><rect width='16' height='18' x='4' y='4' rx='2'/><path d='M8 10h6'/><path d='M8 14h8'/><path d='M8 18h5'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 2v4'/><path d='M12 2v4'/><path d='M16 2v4'/><rect width='16' height='18' x='4' y='4' rx='2'/><path d='M8 10h6'/><path d='M8 14h8'/><path d='M8 18h5'/></svg>");
}

/* === IMAGE SHADOW AND BORDER === */
img {
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}


/* === RECENTLY EDITED & TAG INDEX PAGES === */
/* cssclasses are applied to .markdown-preview-view in Obsidian Publish */
.recently-edited.markdown-preview-view,
.recently-edited .markdown-preview-sizer,
.tag-index-page.markdown-preview-view,
.tag-index-page .markdown-preview-sizer {
  max-width: 100%;
}

.recently-edited.markdown-preview-view table,
.recently-edited .markdown-rendered table,
.tag-index-page.markdown-preview-view table,
.tag-index-page .markdown-rendered table {
  width: 100%;
  margin: 0;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.recently-edited.markdown-preview-view thead th,
.recently-edited .markdown-rendered thead th,
.tag-index-page.markdown-preview-view thead th,
.tag-index-page .markdown-rendered thead th {
  background: transparent !important;
  color: var(--washed-blue) !important;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid rgba(116, 133, 154, 0.3) !important;
  padding: 0 13px 10px 13px;
}

.recently-edited.markdown-preview-view tbody td,
.recently-edited .markdown-rendered tbody td,
.tag-index-page.markdown-preview-view tbody td,
.tag-index-page .markdown-rendered tbody td {
  background: transparent !important;
  border-bottom: 1px solid rgba(116, 133, 154, 0.12) !important;
  padding: 12px 13px;
}

.recently-edited.markdown-preview-view tbody tr:last-child td,
.recently-edited .markdown-rendered tbody tr:last-child td,
.tag-index-page.markdown-preview-view tbody tr:last-child td,
.tag-index-page .markdown-rendered tbody tr:last-child td {
  border-bottom: none !important;
}

.recently-edited.markdown-preview-view tbody tr:hover td,
.recently-edited .markdown-rendered tbody tr:hover td,
.tag-index-page.markdown-preview-view tbody tr:hover td,
.tag-index-page .markdown-rendered tbody tr:hover td {
  background: rgba(93, 203, 195, 0.05) !important;
}