/* Simplified Rainbow — Cleaner, lighter accents for Obsidian Publish */
:root {
  --bg: #ffffff;
  --muted: #64707b;
  --text: #0f1724;
  --border: #e6eef8;
  --accent: #5c7be3;
  --accent-gradient: linear-gradient(90deg,#ff6b6b,#ffa94d,#ffd43b,#69db7c,#74c0fc,#b197fc);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  line-height: 1.65;
  -webkit-font-smoothing:antialiased;
}

.markdown-preview-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* Headings: single, consistent rainbow treatment */
h1,h2,h3 {
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
  line-height: 1.15;
}

h1 {
  font-size: 2rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 { font-size: 1.45rem; color: #10203a; }
h3 { font-size: 1.15rem; color: #153046; }

/* Links: subtle color with a rainbow underline beneath the link text only */
a { color: var(--accent); text-decoration: none; transition: color .18s ease; }
/* Apply the decorative rainbow underline as a background on the inline link itself
  so Obsidian's external-link icon (which often uses pseudo-elements) is not overwritten. */
a:not(.external-link) { background-image: var(--accent-gradient); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px; transition: background-size .28s ease, color .18s ease; }
a:not(.external-link):hover { background-size: 100% 2px; color:#3f63d6; }

/* Prevent the decorative underline from filling full-width areas like the site title */
/* Site title element (keeps original class name from Obsidian themes) */
.site-body-left-column-site-name,
.site-body-left-column-site-name a {
  background-image: none !important;
  background-size: 0 !important;
}

/* External links: animated rainbow underline (matching internal links) */
a.external-link {
  color: #ff8566;
  text-decoration: none;
  background-image: var(--accent-gradient) !important;
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  padding-inline-end: 0 !important;
  transition: background-size 0.28s ease, color 0.18s ease;
}

a.external-link:hover {
  background-size: 100% 2px;
  color: #ff6b6b;
  text-decoration: none;
}

/* Table of contents: use same animation as body links */
.table-of-contents a { color: var(--muted); text-decoration: none; }
.table-of-contents a:hover { color: var(--accent); background-size: 100% 2px; }
.table-of-contents .is-active, .table-of-contents a.is-active { color: var(--accent); font-weight: 600; }

/* Code and pre blocks */
code { background:#f3f7fb; padding:.12em .35em; border-radius:6px; color:#0b1220; font-size:.92em; }
pre { background:#fbfdff; border:1px solid var(--border); border-radius:10px; padding:1rem; overflow:auto; }
pre::before { content:''; display:block; height:3px; width:100%; background:var(--accent-gradient); border-radius:8px 8px 0 0; margin:-1rem -1rem 0 -1rem; }

/* Blockquote */
blockquote { border-left:4px solid #dbeafe; background:#f8fbff; padding:1rem 1.25rem; border-radius:0 8px 8px 0; color:var(--muted); }

/* Lists, tables, tags — minimal accents */
ul,ol { padding-left:1.35rem; }
table { width:100%; border-collapse:collapse; margin:1rem 0; }
th,td { padding:.6rem .75rem; border-bottom:1px solid var(--border); }

.tag { display:inline-block; padding:.18rem .5rem; border-radius:999px; background:#f3f7fb; color:#3d4b5b; font-size:.85em; }

/* Small UI tweaks */
.site-body-left-column { border-right:1px solid var(--border); background:transparent; }
.site-footer { 
  border-top:1px solid var(--border); 
  padding:1.25rem; 
  text-align:center;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Scrollbar (light) with proper z-index to stay above graph */
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#74c0fc,#b197fc); border-radius:6px; position: relative; z-index: 999; }

/* Responsive */
@media (max-width:720px) {
  .markdown-preview-view { padding:1rem; }
  h1 { font-size:1.5rem; }
}

/* Print: remove decorative gradients */
@media print {
  h1 { -webkit-text-fill-color: initial; background:none; color:#222; }
  pre::before, a::after { display:none; }
}

/* Main text wiki links: match sidebar link behavior */
.markdown-preview-view a.internal-link {
  text-decoration: none;
  background-image: var(--accent-gradient);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.28s ease, color 0.18s ease;
}

.markdown-preview-view a.internal-link:hover {
  background-size: 100% 2px;
  color: var(--accent);
  text-decoration: none;
}

.el-hr {
  margin: 2rem 0;
}

.el-hr hr {
  border: none;
  height: 1px;
  background: var(--accent-gradient);
  border-radius: 1px;
}

.backlinks,
.outgoing-link-pane {
  border-top: 1px solid transparent;
  border-image: var(--accent-gradient) 1;
  border-image-slice: 1;
  border-radius: 1px
}