/* ==========================================================================
   RELEVATE DIRECTORY — publish.css
   Brand theme for Obsidian Publish (publish.obsidian.md/relevate)

   Install: put this file in the ROOT of your vault, named exactly
   "publish.css", then tick it in Publish changes → Publish.

   Brand tokens (from relevate.com.au):
     Lime      #99CC00   accents, bars, buttons, graph highlight
     Charcoal  #1E2529   text, dark mode background
     Grey      #7F7F80   secondary UI
     Font      Poppins
   Lime is too light for text on white (1.9:1), so links in light mode
   use a deeper "ink" green (#557300, 5.5:1). Lime is used for text only
   in dark mode, where it passes comfortably (8:1 on charcoal).
   ========================================================================== */

/* Poppins (latin) — loaded with @font-face rather than @import so the rest
   of this stylesheet applies immediately instead of waiting on Google. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiEyp8kv8JHgFVrJJfecg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLCz7Z1xlFQ.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: italic; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiGyp8kv8JHgFVrJJLucHtA.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: italic; font-weight: 500; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiDyp8kv8JHgFVrJJLmg1hVF9eO.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }


/* --------------------------------------------------------------------------
   1. Brand tokens + typography (shared by both themes)
   -------------------------------------------------------------------------- */
body {
  --rv-lime: #99CC00;
  --rv-lime-rgb: 153, 204, 0;
  --rv-lime-deep: #8AB800;
  --rv-charcoal: #1E2529;
  --rv-grey: #7F7F80;

  /* Obsidian accent = Relevate lime */
  --accent-h: 75;
  --accent-s: 100%;
  --accent-l: 40%;

  /* Fonts: Publish needs both the -theme and the resolved variable */
  --font-text-theme: 'Poppins', sans-serif;
  --font-interface-theme: 'Poppins', sans-serif;
  --font-text: 'Poppins', var(--font-default);
  --font-interface: 'Poppins', var(--font-default);
  --font-text-size: 16px;
  --line-height-normal: 1.7;

  /* Headings */
  --h1-weight: 700;
  --h2-weight: 600;
  --h3-weight: 600;
  --h4-weight: 600;
  --h1-size: 1.9em;
  --h2-size: 1.45em;
  --h3-size: 1.2em;
  --h4-size: 1.05em;
  --h1-line-height: 1.2;
  --h2-line-height: 1.3;
  --h1-letter-spacing: -0.01em;
  --h2-letter-spacing: -0.005em;

  /* Lists, quotes, rules */
  --list-marker-color: var(--rv-lime);
  --blockquote-border-color: var(--rv-lime);
  --blockquote-border-thickness: 3px;
  --hr-thickness: 1px;

  /* Tags → pills */
  --tag-radius: 999px;
  --tag-border-width: 0;
  --tag-padding-x: 0.75em;
  --tag-padding-y: 0.3em;
  --tag-weight: 500;

  /* Callouts */
  --callout-radius: 10px;
  --callout-padding: 14px 18px;

  /* Code */
  --code-radius: 6px;

  /* Graph — must live on body: Publish samples these from a <div> it
     appends to <body>, outside .published-container */
  --graph-node: var(--rv-grey);
  --graph-node-focused: var(--rv-lime);
  --graph-node-unresolved: var(--text-faint);
  --graph-line: var(--background-modifier-border-hover);
  --graph-text: var(--text-normal);
}

/* ---------- Light theme ---------- */
.theme-light {
  --background-primary: #FFFFFF;
  --background-primary-alt: #F7F8FB;
  --background-secondary: #F7F8FB;
  --background-secondary-alt: #EEF1F4;
  --background-modifier-border: #E3E6E9;
  --background-modifier-border-hover: #CFD4D8;
  --background-modifier-border-focus: var(--rv-lime);
  --background-modifier-hover: rgba(var(--rv-lime-rgb), 0.12);
  --background-modifier-active-hover: rgba(var(--rv-lime-rgb), 0.18);

  --text-normal: #1E2529;
  --text-muted: #5C6166;
  --text-faint: #8A9096;
  --text-accent: #557300;          /* lime "ink" — readable on white */
  --text-accent-hover: #3F5600;
  --text-on-accent: #1E2529;       /* charcoal on lime buttons */
  --text-selection: rgba(var(--rv-lime-rgb), 0.28);

  --interactive-accent: var(--rv-lime);
  --interactive-accent-hover: var(--rv-lime-deep);

  --blockquote-background-color: rgba(var(--rv-lime-rgb), 0.06);
  --callout-default: 85, 115, 0;   /* default/note callouts in ink green */
  --tag-background: rgba(var(--rv-lime-rgb), 0.16);
  --tag-background-hover: rgba(var(--rv-lime-rgb), 0.3);
  --tag-color: #3F5600;
  --tag-color-hover: #2E3F00;
  --code-background: #F3F5F7;
}

/* ---------- Dark theme ---------- */
.theme-dark {
  --background-primary: #1E2529;
  --background-primary-alt: #232C31;
  --background-secondary: #182023;
  --background-secondary-alt: #141A1D;
  --background-modifier-border: #2F3A40;
  --background-modifier-border-hover: #3E4B52;
  --background-modifier-border-focus: var(--rv-lime);
  --background-modifier-hover: rgba(var(--rv-lime-rgb), 0.10);
  --background-modifier-active-hover: rgba(var(--rv-lime-rgb), 0.16);

  --text-normal: #E6E9EB;
  --text-muted: #9AA3A9;
  --text-faint: #6F787E;
  --text-accent: #99CC00;
  --text-accent-hover: #B8E336;
  --text-on-accent: #1E2529;
  --text-selection: rgba(var(--rv-lime-rgb), 0.25);

  --interactive-accent: var(--rv-lime);
  --interactive-accent-hover: #B8E336;

  --blockquote-background-color: rgba(var(--rv-lime-rgb), 0.07);
  --callout-default: 153, 204, 0;
  --tag-background: rgba(var(--rv-lime-rgb), 0.14);
  --tag-background-hover: rgba(var(--rv-lime-rgb), 0.26);
  --tag-color: #B8E336;
  --tag-color-hover: #C9EC5E;
  --code-background: #182023;
}


/* --------------------------------------------------------------------------
   2. Publish layout variables
   -------------------------------------------------------------------------- */
.published-container {
  --page-width: 820px;
  --page-side-padding: 48px;

  /* Site name (top of left sidebar / mobile header) */
  --site-name-font: 'Poppins', sans-serif;
  --site-name-size: 19px;
  --site-name-weight: 700;
  --site-name-color: var(--text-normal);
  --site-name-color-hover: var(--text-accent);

  /* Page title */
  --page-title-font: 'Poppins', sans-serif;
  --page-title-size: 2.3em;
  --page-title-weight: 700;
  --page-title-line-height: 1.15;
  --page-title-color: var(--text-normal);

  /* Sidebar section titles ("Interactive graph", "On this page") */
  --component-title-font: 'Poppins', sans-serif;
  --component-title-size: 11px;
  --component-title-weight: 600;
  --component-title-transform: uppercase;
  --component-title-color: var(--text-muted);

  /* Left sidebar + navigation */
  --sidebar-left-background: var(--background-secondary);
  --sidebar-left-border-color: var(--background-modifier-border);
  --sidebar-left-border-width: 1px;
  --nav-item-size: 14px;
  --nav-item-radius: 6px;
  --nav-item-color: var(--text-muted);
  --nav-item-color-hover: var(--text-normal);
  --nav-item-color-active: var(--text-normal);
  --nav-item-background-hover: rgba(var(--rv-lime-rgb), 0.12);
  --nav-item-background-active: rgba(var(--rv-lime-rgb), 0.18);
  --nav-item-weight-active: 600;
  --nav-parent-item-color: var(--text-normal);
  --nav-parent-item-weight: 600;
  --nav-collapse-icon-color: var(--rv-grey);
  --nav-collapse-icon-color-collapsed: var(--rv-grey);

  /* Outline ("On this page") */
  --outline-heading-color: var(--text-muted);
  --outline-heading-color-hover: var(--text-normal);
  --outline-heading-color-active: var(--text-accent);

  /* Links */
  --link-color: var(--text-accent);
  --link-color-hover: var(--text-accent-hover);
  --link-external-color: var(--text-accent);
  --link-external-color-hover: var(--text-accent-hover);
  --link-weight: 500;
  --link-unresolved-color: var(--text-muted);
  --link-unresolved-opacity: 1;
  --link-unresolved-decoration-style: dashed;
  --link-unresolved-decoration-color: var(--text-faint);

  /* Mobile header + logo */
  --header-background: var(--background-primary);
  --logo-radius: 0;

  /* Tables */
  --table-header-background: var(--background-secondary);
  --table-header-weight: 600;
  --table-border-color: var(--background-modifier-border);
}


/* --------------------------------------------------------------------------
   3. Site name, header, sidebar
   -------------------------------------------------------------------------- */

/* Wordmark-style site name with a lime bar, echoing the logo */
.site-body-left-column-site-name,
.site-header-text {
  font-family: var(--site-name-font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.site-body-left-column-site-name::after {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--rv-lime);
}

/* Mobile / tablet header: thin lime rule under the bar */
.site-header {
  border-bottom: 3px solid var(--rv-lime) !important;
}

/* Active page in the nav: lime marker on the left */
.nav-view-outer .tree-item-self {
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-view-outer .tree-item-self.mod-active {
  box-shadow: inset 3px 0 0 var(--rv-lime);
}

/* Keep the theme files themselves out of the sidebar */
.nav-view-outer .tree-item:has(> .tree-item-self:is([data-path="publish.css"], [data-path="publish.css.md"],
                                                    [data-path="publish.js"], [data-path="publish.js.md"])) {
  display: none;
}

/* Logo (Site options → Logo): the JPG logo has a white background, so
   blend it into the grey sidebar in light mode, and round it in dark mode */
.theme-light .site-body-left-column-site-logo img,
.theme-light .site-header-logo img {
  mix-blend-mode: multiply;
}
.theme-dark .site-body-left-column-site-logo img,
.theme-dark .site-header-logo img {
  border-radius: 8px;
}

/* Search box */
.search-view-container .search-bar {
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-primary);
  font-family: var(--font-interface);
}
.search-view-container .search-bar:focus {
  border-color: var(--rv-lime);
  box-shadow: 0 0 0 3px rgba(var(--rv-lime-rgb), 0.25);
}

/* Right-hand graph card */
.graph-view-container {
  border-radius: 10px;
  border-color: var(--background-modifier-border);
}

/* Section titles get a small lime tick */
.published-section-header {
  letter-spacing: 0.08em;
}
.published-section-header::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--rv-lime);
  vertical-align: 1px;
}


/* --------------------------------------------------------------------------
   4. Page content
   -------------------------------------------------------------------------- */

/* Remove Publish's default underline rules on H1/H2 */
.published-container .markdown-rendered h1,
.published-container .markdown-rendered h2 {
  border-bottom: none;
  padding-bottom: 0;
}

/* Page title with a lime brand bar beneath */
.published-container .markdown-rendered h1.page-header::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 0.4em;
  border-radius: 2px;
  background: var(--rv-lime);
}

/* H2 — lime bar on the left */
.markdown-rendered h2 {
  border-left: 4px solid var(--rv-lime);
  padding-left: 14px;
  margin-left: -18px;
}
@media screen and (max-width: 750px) {
  .markdown-rendered h2 { margin-left: 0; }
}

.markdown-rendered h3 { color: var(--text-normal); }
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85em;
}

.markdown-rendered strong { font-weight: 600; }

/* Links: ink-green text, lime underline, soft lime highlight on hover */
.markdown-rendered a.internal-link:not(.is-unresolved),
.markdown-rendered a.external-link {
  text-decoration-line: underline;
  text-decoration-color: rgba(var(--rv-lime-rgb), 0.75);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  border-radius: 3px;
  transition: background-color 0.15s ease, color 0.15s ease, text-decoration-color 0.15s ease;
}
.markdown-rendered a.internal-link:not(.is-unresolved):hover,
.markdown-rendered a.external-link:hover {
  background-color: rgba(var(--rv-lime-rgb), 0.16);
  text-decoration-color: var(--rv-lime);
}
/* Links to pages that aren't published yet */
.markdown-rendered a.internal-link.is-unresolved {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* List bullets in lime */
.markdown-rendered ul > li::marker { color: var(--rv-lime); }
.markdown-rendered ol > li::marker { color: var(--text-accent); font-weight: 600; }

/* Blockquotes */
.markdown-rendered blockquote {
  border-radius: 0 8px 8px 0;
  padding: 0.6em 1.1em;
}

/* Horizontal rule — short lime dash in the middle of a hairline */
.markdown-rendered hr {
  border: none;
  height: 1px;
  background: var(--background-modifier-border);
  overflow: visible;
  position: relative;
  margin: 2.5em 0;
}
.markdown-rendered hr::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -1px;
  width: 40px;
  height: 3px;
  margin-left: -20px;
  border-radius: 2px;
  background: var(--rv-lime);
}

/* Tables — lime rule under the header row */
.published-container .markdown-rendered table thead th {
  border-bottom: 2px solid var(--rv-lime);
}

/* Images */
.markdown-rendered img { border-radius: 8px; }

/* Text selection */
.published-container ::selection { background: var(--text-selection); }


/* --------------------------------------------------------------------------
   5. Buttons (affiliate / call-to-action)
   Obsidian Publish doesn't run community plugins, so the Buttons plugin's
   ```button blocks show up as raw code. Use a plain HTML link instead:

     <a class="rv-button" href="https://…" target="_blank" rel="sponsored noopener">Get Zoho Commerce</a>

   Put it on its own line with a blank line above and below.
   Fallback colours mean this works even without the brand tokens above.
   -------------------------------------------------------------------------- */
.markdown-rendered a.rv-button {
  display: inline-block;
  margin: 0.4em 0;
  padding: 0.7em 1.4em;
  border-radius: 8px;
  background-color: var(--rv-lime, #99CC00);
  background-image: none;              /* drop Publish's external-link icon */
  color: var(--rv-charcoal, #1E2529);  /* charcoal on lime ≈ 9:1 contrast */
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.markdown-rendered a.rv-button:hover {
  background-color: var(--rv-lime-deep, #8AB800);
  color: var(--rv-charcoal, #1E2529);
  text-decoration: none;
  transform: translateY(-1px);
}
.markdown-rendered a.rv-button:focus-visible {
  outline: 3px solid rgba(153, 204, 0, 0.45);
  outline-offset: 2px;
}
