/* ================================================
   OBSIDIAN PUBLISH BASE THEME
   ================================================ */

/* CSS Variables for Easy Customization */
:root {
  /* Colors */
  --background-primary: #ffffff;
  --background-secondary: #f5f5f5;
  --text-normal: #2e3338;
  --text-muted: #6c6c6c;
  --text-faint: #999999;
  --text-accent: #705dcf;
  --text-accent-hover: #5940a5;

  /* Interactive elements */
  --interactive-normal: #f0f0f0;
  --interactive-hover: #e0e0e0;
  --interactive-accent: #705dcf;
  --interactive-accent-hover: #5940a5;

  /* Borders and dividers */
  --background-modifier-border: #e0e0e0;
  --background-modifier-border-hover: #c0c0c0;
  --background-modifier-border-focus: #705dcf;

  /* Code */
  --code-background: #f5f5f5;
  --code-normal: #d73a49;
  --code-comment: #6a737d;

  /* Typography */
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-monospace: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
    monospace;
  --font-interface: var(--font-text);

  /* Sizing */
  --font-text-size: 16px;
  --line-height-normal: 1.6;
  --line-width: 700px;
  --file-line-width: 700px;

  /* Spacing */
  --size-2-1: 2px;
  --size-2-2: 4px;
  --size-2-3: 6px;
  --size-4-1: 8px;
  --size-4-2: 12px;
  --size-4-3: 16px;
  --size-4-4: 24px;
  --size-4-5: 32px;
  --size-4-6: 48px;
  --size-4-8: 64px;

  /* Heading colors - green gradient */
  --heading-h1: #091009;
  --heading-h2: #1a2e1a;
  --heading-h3: #2a4b2a;
  --heading-h4: #2a4b2a;
  --heading-h5: #4b864b;
  --heading-h6: #5ca35c;

  /* Override Obsidian's default heading colors */
  --h1-color: var(--heading-h1);
  --h2-color: var(--heading-h2);
  --h3-color: var(--heading-h3);
  --h4-color: var(--heading-h4);
  --h5-color: var(--heading-h5);
  --h6-color: var(--heading-h6);
}

/* Dark mode variables */
.theme-dark {
  --background-primary: #1e1e1e;
  --background-secondary: #252525;
  --text-normal: #dcddde;
  --text-muted: #999999;
  --text-faint: #666666;
  --text-accent: #a88bf5;
  --text-accent-hover: #b8a0f7;

  --interactive-normal: #2a2a2a;
  --interactive-hover: #333333;
  --interactive-accent: #705dcf;
  --interactive-accent-hover: #8875df;

  --background-modifier-border: #333333;
  --background-modifier-border-hover: #444444;

  --code-background: #2a2a2a;
  --code-normal: #f97583;
  --code-comment: #8b949e;

  /* Heading colors for dark mode - green gradient */
  --heading-h1: #eff6ef;
  --heading-h2: #d1e5d1;
  --heading-h3: #bfdbbf;
  --heading-h4: #97c497;
  --heading-h5: #79b479;
  --heading-h6: #5ca35c;

  /* Override Obsidian's default heading colors for dark mode */
  --h1-color: var(--heading-h1);
  --h2-color: var(--heading-h2);
  --h3-color: var(--heading-h3);
  --h4-color: var(--heading-h4);
  --h5-color: var(--heading-h5);
  --h6-color: var(--heading-h6);
}

/* ================================================
   BASE LAYOUT & TYPOGRAPHY
   ================================================ */

body {
  font-family: var(--font-text);
  font-size: var(--font-text-size);
  line-height: var(--line-height-normal);
  color: var(--text-normal);
  background-color: var(--background-primary);
  margin: 0;
  padding: 0;
}

/* Don't center or constrain markdown content - it needs to fit within the center column */
.markdown-preview-view,
.markdown-rendered {
  /* Let the parent .site-body-center-column control width */
  padding: var(--size-4-4);
}

/* Constrain the inner content for better readability */
.markdown-preview-sizer {
  max-width: var(--file-line-width);
  margin: 0 auto;
}

/* ================================================
   HEADINGS
   ================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2em;
  margin-top: 0;
  color: var(--heading-h1);
}
h2 {
  font-size: 1.6em;
  color: var(--heading-h2);
}
h3 {
  font-size: 1.4em;
  color: var(--heading-h3);
}
h4 {
  font-size: 1.2em;
  color: var(--heading-h4);
}
h5 {
  font-size: 1.1em;
  color: var(--heading-h5);
}
h6 {
  font-size: 1em;
  color: var(--heading-h6);
}

/* ================================================
   LINKS
   ================================================ */

a {
  color: var(--text-accent);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: var(--text-accent-hover);
  text-decoration: underline;
}

/* Internal links */
.internal-link {
  color: var(--text-accent);
  text-decoration: none;
}

.internal-link:hover {
  color: var(--text-accent-hover);
  text-decoration: underline;
}

/* External links */
.external-link {
  color: var(--text-accent);
  text-decoration: none;
}

.external-link:hover {
  color: var(--text-accent-hover);
  text-decoration: underline;
}

/* ================================================
   TEXT FORMATTING
   ================================================ */

strong {
  font-weight: 600;
  color: var(--text-normal);
}

em {
  font-style: italic;
  color: var(--text-normal);
}

mark {
  background-color: rgba(255, 208, 0, 0.4);
  color: var(--text-normal);
  padding: 2px 4px;
  border-radius: 2px;
}

/* ================================================
   PARAGRAPHS & SPACING
   ================================================ */

p {
  margin-top: 0;
  margin-bottom: 1em;
}

hr {
  border: none;
  border-top: 1px solid var(--background-modifier-border);
  margin: 2em 0;
}

/* ================================================
   LISTS
   ================================================ */

ul,
ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.25em;
}

li > p {
  margin-bottom: 0.5em;
}

/* Task lists */
.task-list-item {
  list-style-type: none;
  margin-left: -1.5em;
}

.task-list-item-checkbox {
  margin-right: 0.5em;
  width: 1em;
  height: 1em;
  cursor: pointer;
}

/* ================================================
   BLOCKQUOTES
   ================================================ */

blockquote {
  border-left: 3px solid var(--background-modifier-border);
  padding-left: 1em;
  margin-left: 0;
  margin-right: 0;
  color: var(--text-muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ================================================
   CODE
   ================================================ */

code {
  font-family: var(--font-monospace);
  background-color: var(--code-background);
  color: var(--code-normal);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background-color: var(--code-background);
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1em;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: var(--text-normal);
  font-size: 0.85em;
  line-height: 1.5;
}

/* ================================================
   TABLES
   ================================================ */

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
}

th {
  font-weight: 600;
  text-align: left;
  background-color: var(--background-secondary);
  padding: var(--size-4-2) var(--size-4-3);
  border: 1px solid var(--background-modifier-border);
}

td {
  padding: var(--size-4-2) var(--size-4-3);
  border: 1px solid var(--background-modifier-border);
}

tr:nth-child(even) {
  background-color: var(--background-secondary);
}

/* ================================================
   IMAGES & MEDIA
   ================================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em auto;
  border-radius: 5px;
}

.internal-embed {
  margin: 1em 0;
}

/* ================================================
   NAVIGATION
   ================================================ */

.site-header,
.published-container-header {
  padding: var(--size-4-4);
  border-bottom: 1px solid var(--background-modifier-border);
  margin-bottom: var(--size-4-6);
}

.site-title {
  font-size: 1.5em;
  font-weight: 600;
  margin: 0;
  color: var(--text-normal);
}

.nav-buttons,
.site-nav {
  display: flex;
  gap: var(--size-4-3);
  align-items: center;
  margin-top: var(--size-4-2);
}

.nav-button,
.site-nav a {
  color: var(--text-muted);
  padding: var(--size-4-1) var(--size-4-2);
  border-radius: 5px;
  transition: all 0.2s ease;
}

.nav-button:hover,
.site-nav a:hover {
  background-color: var(--interactive-hover);
  color: var(--text-normal);
  text-decoration: none;
}

/* ================================================
   GRAPH VIEW
   ================================================ */

.graph-view {
  width: 100%;
  height: 500px;
  border: 1px solid var(--background-modifier-border);
  border-radius: 5px;
  margin: 2em 0;
}

/* ================================================
   BACKLINKS & OUTLINE
   ================================================ */

.backlinks,
.outline {
  background-color: var(--background-secondary);
  padding: var(--size-4-4);
  border-radius: 5px;
  margin: 2em 0;
}

.backlinks h3,
.outline h3 {
  margin-top: 0;
  font-size: 1.1em;
  color: var(--text-muted);
}

.backlink-item,
.outline-item {
  padding: var(--size-4-2) 0;
  border-bottom: 1px solid var(--background-modifier-border);
}

.backlink-item:last-child,
.outline-item:last-child {
  border-bottom: none;
}

/* ================================================
   SEARCH
   ================================================ */

.search-input {
  width: 100%;
  padding: var(--size-4-2) var(--size-4-3);
  border: 1px solid var(--background-modifier-border);
  border-radius: 5px;
  background-color: var(--background-primary);
  color: var(--text-normal);
  font-family: var(--font-text);
  font-size: 1em;
}

.search-input:focus {
  outline: none;
  border-color: var(--background-modifier-border-focus);
}

.search-results {
  margin-top: var(--size-4-3);
}

.search-result-item {
  padding: var(--size-4-3);
  border-bottom: 1px solid var(--background-modifier-border);
  cursor: pointer;
}

.search-result-item:hover {
  background-color: var(--interactive-hover);
}

/* ================================================
   CALLOUTS / ADMONITIONS
   ================================================ */

.callout {
  padding: var(--size-4-3);
  margin: 1em 0;
  border-left: 4px solid var(--text-accent);
  border-radius: 5px;
  background-color: var(--background-secondary);
}

.callout-title {
  font-weight: 600;
  margin-bottom: var(--size-4-2);
  display: flex;
  align-items: center;
  gap: var(--size-4-2);
}

.callout-content {
  color: var(--text-normal);
}

/* ================================================
   TAGS
   ================================================ */

.tag {
  display: inline-block;
  background-color: var(--interactive-normal);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.9em;
  margin: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag:hover {
  background-color: var(--interactive-hover);
  color: var(--text-normal);
}

/* ================================================
   FOOTER
   ================================================ */

.site-footer {
  border-top: 1px solid var(--background-modifier-border);
  padding: var(--size-4-6) var(--size-4-4);
  margin-top: var(--size-4-8);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9em;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
  .published-container,
  .markdown-preview-view,
  .markdown-rendered {
    padding: var(--size-4-3);
  }

  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75em;
  }
  h2 {
    font-size: 1.5em;
  }
  h3 {
    font-size: 1.3em;
  }
  h4 {
    font-size: 1.15em;
  }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.center-text {
  text-align: center;
}

.muted {
  color: var(--text-muted);
}

.small-text {
  font-size: 0.9em;
}

.hidden {
  display: none;
}

/* ================================================
   HIDE OBSIDIAN FOOTER
   ================================================ */

.site-footer {
  display: none;
}
