/* Yoso — Obsidian Publish styling
   Gold accent (#c9af69). Rubik font, sizes and H1 copied from yoso.one. */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500&display=swap');

body {
  --font-text-theme: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-text: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-interface: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-text-size: 19px;

  --h1-size: 42px;
  --h1-line-height: 1.5;
  --page-title-size: 42px;
  --page-title-line-height: 1.5;
  --page-title-weight: 300;
  --h2-size: 30px;
  --h3-size: 20.5px;
  --h4-size: 1.2em;
  --h5-size: 1.1em;
  --h6-size: 0.85em;
  --h1-weight: 300;
  --h2-weight: 300;
  --h3-weight: 300;
  --h4-weight: 400;
  --h5-weight: 400;
  --h6-weight: 300;
}

/* Light mode: slightly darker gold so links stay readable on white */
.theme-light {
  --background-primary: #ffffff;
  --h1-color: #000000;
  --h6-color: #827f7f;

  --text-accent: #a38a45;
  --text-accent-hover: #86702f;
  --interactive-accent: #c9af69;
  --interactive-accent-hover: #b89b52;
  --link-color: #a38a45;
  --link-color-hover: #86702f;
  --link-external-color: #a38a45;
  --link-external-color-hover: #86702f;
  --text-highlight-bg: rgba(201, 175, 105, 0.45);
}

/* Dark mode: the exact vault gold */
.theme-dark {
  --background-primary: #1d1d1d;
  --h1-color: #ffffff;
  --h6-color: #827f7f;

  --text-accent: #c9af69;
  --text-accent-hover: #ddc588;
  --interactive-accent: #c9af69;
  --interactive-accent-hover: #ddc588;
  --link-color: #c9af69;
  --link-color-hover: #ddc588;
  --link-external-color: #c9af69;
  --link-external-color-hover: #ddc588;
  --text-highlight-bg: rgba(201, 175, 105, 0.45);
}

mark {
  background-color: rgba(201, 175, 105, 0.45);
  color: inherit;
}

/* Remove "powered by" */
.site-footer a {
  display: none;
}

/* Site logo size */
.published-container {
  --logo-width: 48px;
  --logo-height: 48px;
  --logo-max-width: 48px;
  --logo-max-height: 48px;

  /* Hide site name (variable is the documented route) */
  --site-name-size: 0;
}

/* Hide site name (class used in the sidebar) */
.site-body-left-column-site-name,
.site-header-text {
  display: none;
}

/* Copyright + local-links notice at the end of every note.
   Publish hides .site-footer on phones, so the text sits in the note itself
   (.markdown-preview-sizer) and shows at every width. */
.markdown-preview-sizer::after {
  content: "© 2026 Yoso · Licensed under CC BY-NC-SA 4.0\A Some links lead to private files and references kept offline, and won't open on your device";
  white-space: pre-line;
  display: block;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--background-modifier-border, #ddd);
  font-size: 0.8rem;
  line-height: 1.6;
  opacity: 0.6;
  text-align: center;
}

/* With publish.js running (custom domain) the same notice is real markup, so the
   licence name is a working link. publish.js adds body.yoso-footer-js and the .yoso-footer
   element at the end of the note; the CSS text above is then switched off. */
body.yoso-footer-js .markdown-preview-sizer::after {
  display: none;
}
.yoso-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--background-modifier-border, #ddd);
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: center;
}
.yoso-footer-notice {
  opacity: 0.6;
}

/* Mailing list above the footer (added by publish.js): one Buttondown list for all Yoso sites */
.yoso-signup {
  max-width: 28rem;
  margin: 0 auto 2rem;
  text-align: left;
}
.yoso-signup p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
.yoso-signup .yoso-signup-title {
  margin-bottom: 0.25rem;
  font-size: var(--h3-size);
  font-weight: 300;
  color: var(--h1-color);
}
.yoso-signup label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.yoso-signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.yoso-signup input[type="email"] {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text-normal);
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border, #ddd);
  border-radius: 4px;
}
.yoso-signup input[type="email"]:focus-visible {
  outline: 2px solid var(--interactive-accent);
  outline-offset: 1px;
  border-color: var(--interactive-accent);
}
.yoso-signup button {
  min-height: 44px;
  padding: 0 1.25rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1d1d1d;
  background: var(--interactive-accent);
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
}
.yoso-signup button:hover {
  background: var(--interactive-accent-hover);
}
.yoso-signup button:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}
/* Newsletter tick-boxes (publish.js): undo the small label style above for the choices */
.yoso-signup .list-choice .lc-box {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: normal;
  opacity: 1;
}
.yoso-signup .yoso-signup-note {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  opacity: 0.6;
}
.yoso-footer a {
  color: var(--text-accent);
}
.yoso-footer a:hover {
  color: var(--text-accent-hover);
}

/* ============================================================
   Mermaid: ported from the vault snippet mermaid-minimal.css
   (Publish does not load vault snippets). Monochrome, full width.
   Dark mode: Publish inverts the diagram (filter), same as the vault.
   - Helvetica Neue: Mermaid sizes each box for this font; Rubik is wider
     and loads late, which clipped the labels.
   - see-through fills: white fills would turn into black blocks in dark mode.
   ============================================================ */

.mermaid {
  width: 100%;
  text-align: center;
}

.mermaid svg {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 80vh;
}

.mermaid svg,
.mermaid svg * {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-variant-numeric: lining-nums;
  letter-spacing: normal !important;
}

.mermaid svg:not(#_) .node rect,
.mermaid svg:not(#_) .node polygon,
.mermaid svg:not(#_) .node circle,
.mermaid svg:not(#_) .node ellipse,
.mermaid svg:not(#_) .node path,
.mermaid svg:not(#_) .cluster rect {
  fill: transparent !important;
}

/* Line-label patch: page colour (white), and in dark mode the colour that the
   inversion turns into Publish's dark page colour #1d1d1d (= #e2e2e2). */
.mermaid svg:not(#_) .edgeLabel,
.mermaid svg:not(#_) .edgeLabel p,
.mermaid svg:not(#_) .edgeLabel span,
.mermaid svg:not(#_) .edgeLabel rect,
.mermaid svg:not(#_) .edgeLabel .labelBkg {
  opacity: 1 !important;
  background-color: #ffffff !important;
  fill: #ffffff !important;
}
.theme-dark .mermaid svg:not(#_) .edgeLabel,
.theme-dark .mermaid svg:not(#_) .edgeLabel p,
.theme-dark .mermaid svg:not(#_) .edgeLabel span,
.theme-dark .mermaid svg:not(#_) .edgeLabel rect,
.theme-dark .mermaid svg:not(#_) .edgeLabel .labelBkg {
  background-color: #e2e2e2 !important;
  fill: #e2e2e2 !important;
}

/* ============================================================
   Dark / light switch pinned to the top right, at every width.
   - Desktop: the switch normally sits at the bottom of the left sidebar.
   - Phone (750px and narrower): the sidebar slides in with a transform, which
     would carry a fixed switch away with it. So the sidebar is slid with
     `left` instead, and raised above the header (z-index 90) so the switch shows.
   ============================================================ */

.site-body-left-column-site-theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  width: auto;
  margin: 0;
  padding: 0;
  z-index: 10;
}

@media screen and (max-width: 750px) {
  .published-container.has-navigation .site-body-left-column {
    transform: none !important;
    left: -100vw;
    transition: left 200ms ease-in-out;
    z-index: 100;
  }
  .published-container.has-navigation.is-left-column-open .site-body-left-column {
    left: 0;
  }
}

/* No underline on links (colour alone marks them), including on hover. */
body {
  --link-decoration: none;
  --link-decoration-hover: none;
  --link-external-decoration: none;
  --link-external-decoration-hover: none;
}

/* Graph icons (expand, global graph), top right of the graph: gold instead of grey */
.graph-icon { color: var(--text-accent); }
.graph-icon:hover { color: var(--text-accent-hover); }

/* Sidebar section labels (On this page, Interactive graph, Links to this page): lighter weight */
.published-section-header { font-weight: 300; }

/* Graph in the note on phones and tablets (1000px and below), just above "Links to this page".
   Publish hides its right column there. publish.js adds body.yoso-mobile-graph and moves the graph
   into the note footer; this styles it, with its two icons just above the square, top right. */
@media screen and (max-width: 1000px) {
  body.yoso-mobile-graph .mod-footer .graph-view-outer { display: block; margin: 0 0 40px; }
  body.yoso-mobile-graph .mod-footer .graph-view-container { margin-top: 36px; }
  body.yoso-mobile-graph .mod-footer .graph-expand { top: -30px; right: 0; }
  body.yoso-mobile-graph .mod-footer .graph-global { top: -30px; right: 24px; }
}

/* Phone header: logo centred on the page, menu icon a lighter grey in dark mode */
@media screen and (max-width: 750px) {
  .published-container.has-navigation .site-header { position: relative; }
  .published-container.has-navigation .site-header-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .published-container.has-navigation .site-header-logo img { margin-right: 0; }
  .theme-dark .published-container.has-navigation .site-header .clickable-icon { color: #b3b3b3; }
  /* Theme switch: 14px from the right edge, mirroring the menu icon on the left
     (its container adds a fixed 24px, hence the negative offset) */
  .site-body-left-column-site-theme-toggle { right: -10px; }
}
@media screen and (max-width: 750px) and (hover: hover) {
  .theme-dark .published-container.has-navigation .site-header .clickable-icon:hover { color: #e0e0e0; }
}

/* Graph on phones and tablets (1000px and below) without publish.js (no custom domain).
   Publish hides its right column there. Here it is pinned to the bottom of the note area and slides
   up in step with scrolling, so it appears at the end of each note, above the copyright footer.
   The footer text moves into the panel, under the graph (the note's own footer is hidden on these pages).
   Needs scroll-driven animations (current Chrome, Safari 26+); elsewhere it stays hidden.
   Not used once publish.js runs (body.yoso-mobile-graph), which places the graph above "Links to this page". */
@media screen and (max-width: 1000px) {
  @supports (animation-timeline: scroll()) {
    body:not(.yoso-mobile-graph) .published-container.has-graph .render-container { timeline-scope: --yoso-page; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .markdown-preview-view { scroll-timeline: --yoso-page block; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .markdown-preview-view::after { content: ""; display: block; height: 500px; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .markdown-preview-sizer::after { display: none; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .site-body-right-column { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; min-width: 0; height: 500px; max-height: 500px; overflow: hidden; border-left: 0; border-top: 1px solid var(--background-modifier-border, #ddd); animation: yoso-graph-in linear both; animation-timeline: --yoso-page; animation-range: calc(100% - 500px) 100%; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .site-body-right-column .site-body-right-column-inner { flex: 0 0 auto; width: 100%; max-width: 100%; margin: 0; padding: 0 16px; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .outline-view-outer { display: none; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .site-body-right-column .graph-view-container { margin-top: 36px; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .site-body-right-column .graph-expand { top: -30px; right: 0; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .site-body-right-column .graph-global { top: -30px; right: 24px; }
    body:not(.yoso-mobile-graph) .published-container.has-graph .site-body-right-column::after {
      content: "© 2026 Yoso · Licensed under CC BY-NC-SA 4.0\A Some links lead to private files and references kept offline, and won't open on your device";
      white-space: pre-line; display: block; margin: 24px 16px 0; padding-top: 1.5rem;
      border-top: 1px solid var(--background-modifier-border, #ddd);
      font-size: 0.8rem; line-height: 1.6; opacity: 0.6; text-align: center;
    }
  }
}
@keyframes yoso-graph-in { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Captions: an italic-only line directly under an embedded image */
.markdown-preview-sizer .el-p:has(.internal-embed) + .el-p > p:has(> em:only-child) {
  font-size: .8rem;
  line-height: 1.5;
  opacity: .7;
}

/* Images and their captions centred */
.markdown-preview-sizer p:has(> .image-embed:only-child),
.markdown-preview-sizer p:has(> img:only-child) { text-align: center; }
.markdown-preview-sizer .el-p:has(.image-embed) + .el-p > p:has(> em:only-child) { text-align: center; }

/* Callouts: every type (info, note, tip, warning, custom...) in gold, same golds as the graph */
.callout[data-callout] {
  --callout-color: 163, 138, 69;
}
.theme-dark .callout[data-callout] {
  --callout-color: 201, 175, 105;
}

/* Private callout: > [!private] shows in Obsidian, hidden on the published site.
   Hidden visually only: the text is still in the published markdown. */
.callout[data-callout="private"] {
  display: none;
}

/* Quotes (> text, not callouts): 1.5 x body text, light weight (Rubik 300, the lightest Rubik loaded) */
.markdown-preview-view blockquote {
  font-size: 1.5em;
  font-weight: 300;
  line-height: 1.5;
}
