/* =========================================================
   "Flowershow-style" theme for Obsidian Publish
   - warm near-black background, serif body, bold sans titles
   - shorter line length for readability
   Put in the ROOT of your vault as publish.css and publish it.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Lora:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ---------- Fonts, sizes, width ---------- */
body,
.published-container {
  --font-text-theme: 'Lora', Georgia, serif;
  --font-interface-theme: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-monospace-theme: ui-monospace, 'SF Mono', Menlo, monospace;

  --font-text-size: 19px;
  --line-height-normal: 1.85;

  /* shorter lines than Flowershow (~65–70 characters) */
  --page-width: 660px;
  --file-line-width: 660px;
  --page-side-padding: 28px;
  --sidebar-left-width: 380px;

  --site-name-font: 'Inter', sans-serif;
  --site-name-size: 24px;
  --site-name-weight: 700;
  --page-title-font: 'Inter', sans-serif;
  --page-title-weight: 700;
}

/* ---------- Colors: dark (main look) ---------- */
.theme-dark {
  --background-primary: #0d0c0b;
  --background-primary-alt: #151412;
  --background-secondary: #0d0c0b;
  --background-secondary-alt: #1a1917;
  --background-modifier-border: #2a2826;

  --text-normal: #cfccc6;         /* soft warm grey body text */
  --text-muted: #9a968f;          /* sidebar items */
  --text-faint: #6b6862;
  --h1-color: #ffffff; --h2-color: #f5f3ef; --h3-color: #f0eee9;
  --h4-color: #f0eee9; --h5-color: #f0eee9; --h6-color: #f0eee9;

  --text-accent: #ffffff;
  --link-color: #e8e5df;
  --link-color-hover: #ffffff;
  --link-external-color: #e8e5df;
  --link-unresolved-color: #9a968f;

  --code-background: #1a1917;
  --blockquote-border-color: #3a3835;
}

/* ---------- Colors: light (matching warm version) ---------- */
.theme-light {
  --background-primary: #fbfaf8;
  --background-primary-alt: #f3f1ed;
  --background-secondary: #fbfaf8;
  --background-secondary-alt: #efece7;
  --background-modifier-border: #e3dfd8;

  --text-normal: #3a3733;
  --text-muted: #7a766f;
  --text-faint: #a8a39b;
  --h1-color: #111; --h2-color: #161514; --h3-color: #1c1b19;
  --h4-color: #1c1b19; --h5-color: #1c1b19; --h6-color: #1c1b19;

  --text-accent: #111;
  --link-color: #1c1b19;
  --link-color-hover: #000;
  --link-external-color: #1c1b19;
  --link-unresolved-color: #7a766f;

  --code-background: #efece7;
  --blockquote-border-color: #d6d1c8;
}

/* ---------- Page background everywhere ---------- */
body,
.published-container,
.site-body,
.site-body-left-column,
.site-body-center-column,
.site-body-right-column,
.site-header,
.markdown-preview-view {
  background-color: var(--background-primary) !important;
}

/* ---------- Header: logo + bold site name, no bar ---------- */
.site-header {
  border: none !important;
  box-shadow: none !important;
}
.site-body-left-column-site-name,
.site-header-text {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--h1-color) !important;
}
.site-body-left-column-site-logo img,
.site-header-logo img {
  border-radius: 2px;
}

/* ---------- Left sidebar: quiet sans list ---------- */
.site-body-left-column {
  border: none !important;
}
.site-body-left-column {
  width: var(--sidebar-left-width) !important;
  min-width: var(--sidebar-left-width) !important;
  max-width: var(--sidebar-left-width) !important;
  flex: 0 0 var(--sidebar-left-width) !important;
}
.site-body-left-column-inner { padding-left: 24px !important; padding-right: 14px !important; }
.nav-view-outer { padding-top: 24px; }
.nav-view,
.tree-item-self,
.tree-item-inner {
  font-family: 'Inter', sans-serif !important;
}
.tree-item-self {
  font-size: 13.5px !important;
  line-height: 1.35 !important;   /* tight inside a wrapped title */
  color: var(--text-muted) !important;
  padding-top: 5px !important;    /* more air between titles */
  padding-bottom: 5px !important;
  margin-bottom: 2px !important;
  min-height: 0 !important;
  background: none !important;
  border-radius: 0 !important;
}
.tree-item-children { padding-left: 6px !important; margin-left: 6px !important; }
.tree-item-children .tree-item-self { font-size: 13px !important; }
.tree-item-icon svg,
.collapse-icon svg { width: 12px; height: 12px; }
.tree-item-self:hover {
  color: var(--h1-color) !important;
  background: none !important;
}
.tree-item-self.mod-active,
.tree-item-self.is-active {
  color: var(--h1-color) !important;
  background: none !important;
  font-weight: 500;
}
.tree-item-icon,
.collapse-icon { color: var(--text-muted) !important; }

/* One line per title: long titles end in "…" (full title shows on hover) */
.tree-item-self { align-items: center !important; }
.tree-item-inner {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}



/* ---------- Search box (if enabled) ---------- */
.search-view-outer input,
.published-search-input {
  font-family: 'Inter', sans-serif !important;
  background: var(--background-primary-alt) !important;
  border: 1px solid var(--background-modifier-border) !important;
  border-radius: 8px !important;
}

/* ---------- Body text: serif ---------- */
.markdown-rendered,
.markdown-preview-view,
.markdown-rendered p,
.markdown-rendered li {
  font-family: 'Lora', Georgia, serif !important;
  font-size: 19px;
  line-height: 1.85;
  color: var(--text-normal);
  -webkit-font-smoothing: antialiased;
}
.markdown-rendered p { margin: 0 0 1.35em; }

/* keep the reading column narrow */
.markdown-preview-view .markdown-preview-sizer,
.published-container .markdown-preview-sizer,
.page-header {
  max-width: 660px !important;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Page title: big bold sans + rule under it ---------- */
.page-header,
.markdown-rendered .inline-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  font-size: 64px !important;
  line-height: 1.1 !important;
  letter-spacing: -0.035em !important;
  color: var(--h1-color) !important;
  margin-top: 56px !important;
  padding-bottom: 40px !important;
  margin-bottom: 44px !important;
  border-bottom: 1px solid var(--background-modifier-border) !important;
}

/* ---------- Headings in the text ---------- */
.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  border: none;
}
.markdown-rendered h1 { font-size: 2.1em; margin: 1.6em 0 0.6em; }
.markdown-rendered h2 { font-size: 1.6em; margin: 1.8em 0 0.6em; }
.markdown-rendered h3 { font-size: 1.3em; margin: 1.6em 0 0.5em; }
.markdown-rendered h4 { font-size: 1.1em; margin: 1.4em 0 0.4em; }

/* ---------- Links: underlined, text-coloured ---------- */
.markdown-rendered a,
.markdown-rendered .internal-link,
.markdown-rendered .external-link {
  color: var(--link-color) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 4px !important;
}
.markdown-rendered a:hover { color: var(--link-color-hover) !important; }
.markdown-rendered .external-link {
  background-image: none !important;   /* no ↗ icon */
  padding-right: 0 !important;
}

/* ---------- Horizontal rules: thin, generous space ---------- */
.markdown-rendered hr {
  border: none !important;
  border-top: 1px solid var(--background-modifier-border) !important;
  margin: 3.5em 0 !important;
}

/* ---------- Quotes, code, images, callouts ---------- */
.markdown-rendered blockquote {
  border-left: 2px solid var(--blockquote-border-color) !important;
  background: none !important;
  padding: 0.1em 0 0.1em 1.3em !important;
  margin: 1.8em 0 !important;
  color: var(--text-muted);
  font-style: italic;
}
.markdown-rendered code {
  font-size: 0.85em;
  border-radius: 4px;
  padding: 0.12em 0.35em;
}
.markdown-rendered pre {
  border: 1px solid var(--background-modifier-border);
  border-radius: 10px;
  padding: 1em 1.2em;
}
.markdown-rendered img { border-radius: 6px; }
.callout {
  border-radius: 10px !important;
  font-family: 'Inter', sans-serif;
  font-size: 0.9em;
}

/* ---------- Backlinks / footer: small and quiet ---------- */
.backlinks {
  font-family: 'Inter', sans-serif !important;
  border-top: 1px solid var(--background-modifier-border);
  margin-top: 4em;
  padding-top: 1.5em;
  font-size: 15px;
  color: var(--text-muted);
}

/* =========================================================
   Homepage (a note with   cssclasses: home   in its properties)
   ========================================================= */
.home .page-header,
.home .inline-title { display: none !important; }

.home .home-hero {
  padding: 2.5em 0 2.2em;
  margin-bottom: 1.5em;
  border-bottom: 1px solid var(--background-modifier-border);
}
.home .home-hero h1 {
  font-size: 64px !important;
  letter-spacing: -0.035em;
  margin: 0 0 0.35em !important;
  color: var(--h1-color);
}
.home .home-hero p {
  font-size: 21px;
  color: var(--text-muted);
  margin: 0;
}
.home h2 {
  font-size: 13px !important;
  text-transform: uppercase;
  letter-spacing: 0.12em !important;
  color: var(--text-faint) !important;
  margin-top: 2.5em !important;
}
.home .post-item {
  padding: 1.3em 0;
  border-bottom: 1px solid var(--background-modifier-border);
}
.home .post-item h3 { font-size: 1.5em; margin: 0.15em 0 0.3em; }
.home .post-item h3 a {
  text-decoration: none !important;
  color: var(--h1-color) !important;
}
.home .post-item h3 a:hover {
  text-decoration: underline !important;
}
.home .post-item p { margin: 0; color: var(--text-muted); }
.home .post-date {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.home .home-footer {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- Scrollbar against the window edge ----------
   The (unused) right sidebar was taking up space to the right of the
   scrolling area. Remove it and let the text column fill to the edge. */
.site-body-right-column { display: none !important; }
.site-body { max-width: none !important; }
.site-body-center-column {
  flex: 1 1 auto !important;
  max-width: none !important;
  margin-right: 0 !important;
}

/* ---------- Center the text on the whole screen ----------
   Pads the right side of the text area by up to the sidebar's width,
   so the article sits in the middle of the WINDOW, not the space
   beside the sidebar. On narrower windows it gets as close to
   centered as it can without squeezing the text. */
/* (the centering itself is done by publish.js, which pads the inside of
   the scrolling area so the scrollbar stays at the window edge) */
.site-body-center-column { padding-right: 0 !important; }

/* ---------- Mobile ---------- */
@media (max-width: 750px) {
  .markdown-rendered,
  .markdown-rendered p,
  .markdown-rendered li { font-size: 17.5px; line-height: 1.75; }
  .page-header,
  .markdown-rendered .inline-title,
  .home .home-hero h1 {
    font-size: 40px !important;
    margin-top: 24px !important;
    padding-bottom: 24px !important;
    margin-bottom: 28px !important;
  }
  .home .home-hero p { font-size: 18px; }

  /* Mobile menu: wider drawer, smaller text, less indent */
  .site-body-left-column {
    width: min(85vw, 340px) !important;
    min-width: min(85vw, 340px) !important;
    max-width: min(85vw, 340px) !important;
    flex: 0 0 min(85vw, 340px) !important;
  }
  .site-body-left-column-inner { padding-left: 16px !important; padding-right: 16px !important; }
  .tree-item-self {
    font-size: 15px !important;
    line-height: 1.3 !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    margin-bottom: 3px !important;
  }
  .tree-item-children { padding-left: 4px !important; margin-left: 4px !important; }
  .tree-item-children .tree-item-self { font-size: 14px !important; }
}

/* pull-to-refresh indicator (used by publish.js) */
#iwg-ptr {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -60px);
  z-index: 9999;
  font: 500 13px 'Inter', sans-serif;
  color: var(--text-muted);
  background: var(--background-primary-alt);
  border: 1px solid var(--background-modifier-border);
  border-radius: 999px;
  padding: 6px 14px;
  transition: transform 0.15s;
  pointer-events: none;
}


/* =========================================================
   Nav titles: forceful one-line + wider sidebar
   (targets every element in the left column, whatever
   Publish happens to call them; publish.js reinforces this)
   ========================================================= */
@media (min-width: 751px) {
  .site-body-left-column,
  .site-body-left-column > *,
  .site-body-left-column-inner,
  .site-body-left-column .nav-view-outer,
  .site-body-left-column .nav-view {
    width: var(--sidebar-left-width) !important;
    min-width: var(--sidebar-left-width) !important;
    max-width: var(--sidebar-left-width) !important;
    box-sizing: border-box !important;
  }
}
.site-body-left-column [class*="tree-item"],
.site-body-left-column [class*="nav-file"],
.site-body-left-column [class*="nav-folder"] {
  min-width: 0 !important;
}
.site-body-left-column .tree-item-inner,
.site-body-left-column [class*="title-content"],
.site-body-left-column .tree-item-self > a,
.site-body-left-column .tree-item-self > span,
.site-body-left-column .tree-item-self > div:not(.tree-item-icon):not(.collapse-icon) {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
