/* GitHub/Obsidian-like markdown styling */

.markdown-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #24292e;
  word-wrap: break-word;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

.markdown-content h1 {
  font-size: 2em;
}

.markdown-content h2 {
  font-size: 1.5em;
}

.markdown-content h3 {
  font-size: 1.25em;
}

.markdown-content h4 {
  font-size: 1em;
}

.markdown-content h5 {
  font-size: 0.875em;
}

.markdown-content h6 {
  font-size: 0.85em;
  color: #6a737d;
}

.markdown-content p {
  margin-bottom: 16px;
}

.markdown-content a {
  color: #0366d6;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

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

.markdown-content em {
  font-style: italic;
}

.markdown-content code {
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85em;
  padding: 0.2em 0.4em;
  margin: 0;
}

.markdown-content pre {
  background-color: #f6f8fa;
  border-radius: 6px;
  padding: 16px;
  overflow: auto;
  margin-bottom: 16px;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.9em;
  color: #24292e;
}

.markdown-content blockquote {
  border-left: 4px solid #dfe2e5;
  color: #6a737d;
  padding: 0 1em;
  margin: 0 0 16px 0;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 16px;
  padding-left: 2em;
}

.markdown-content li {
  margin-bottom: 8px;
}

.markdown-content ul ul,
.markdown-content ul ol,
.markdown-content ol ul,
.markdown-content ol ol {
  margin-top: 8px;
  margin-bottom: 0;
}

.markdown-content table {
  border-collapse: collapse;
  margin-bottom: 16px;
  width: 100%;
}

.markdown-content table th,
.markdown-content table td {
  border: 1px solid #dfe2e5;
  padding: 6px 13px;
  text-align: left;
}

.markdown-content table tr:nth-child(2n) {
  background-color: #f6f8fa;
}

.markdown-content hr {
  background-color: #e1e4e8;
  border: 0;
  height: 0.25em;
  margin-bottom: 24px;
  margin-top: 24px;
  padding: 0;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* Obsidian-style callouts */
.callout {
  border-left: 4px solid #999;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background-color: #f9f9f9;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-title::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.callout-quote {
  border-left-color: #858585;
  background-color: #f9f9f9;
}

.callout-quote .callout-title::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-4.716-5-7-5"/><path d="M15 21c3 0 7-1 7-8V5c0-1.25-4.716-5-7-5"/></svg>');
  background-size: contain;
}

.callout-quote .callout-content {
  font-style: italic;
  margin-bottom: 12px;
}

.callout-quote .callout-author {
  font-style: normal;
  text-align: right;
  color: #555;
  font-size: 0.95em;
}

.callout-info {
  border-left-color: #0066cc;
  background-color: #e8f4f8;
}

.callout-info .callout-title {
  color: #0066cc;
}

.callout-info .callout-title::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/><text x="12" y="16" text-anchor="middle" font-size="14" fill="white" font-weight="bold">i</text></svg>');
  background-size: contain;
}

.callout-tip {
  border-left-color: #10a835;
  background-color: #ebf5eb;
}

.callout-tip .callout-title {
  color: #10a835;
}

.callout-tip .callout-title::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
  background-size: contain;
}

.callout-warning {
  border-left-color: #e69f00;
  background-color: #fff8e6;
}

.callout-warning .callout-title {
  color: #b8700f;
}

.callout-warning .callout-title::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>');
  background-size: contain;
}

.callout-danger {
  border-left-color: #d32f2f;
  background-color: #ffebee;
}

.callout-danger .callout-title {
  color: #d32f2f;
}

.callout-danger .callout-title::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>');
  background-size: contain;
}

.callout-content {
  color: #555;
  line-height: 1.5;
}

.callout-content p {
  margin-bottom: 8px;
}

.callout-content p:last-child {
  margin-bottom: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .markdown-content {
    color: #c9d1d9;
    background-color: #0d1117;
  }

  .markdown-content h1,
  .markdown-content h2,
  .markdown-content h3,
  .markdown-content h4,
  .markdown-content h5,
  .markdown-content h6 {
    border-bottom-color: #30363d;
  }

  .markdown-content code {
    background-color: rgba(110, 118, 129, 0.4);
    color: #e6edf3;
  }

  .markdown-content pre {
    background-color: #161b22;
    color: #c9d1d9;
  }

  .markdown-content pre code {
    color: #c9d1d9;
  }

  .markdown-content blockquote {
    border-left-color: #30363d;
    color: #8b949e;
  }

  .markdown-content a {
    color: #58a6ff;
  }

  .markdown-content table th,
  .markdown-content table td {
    border-color: #30363d;
  }

  .markdown-content table tr:nth-child(2n) {
    background-color: #161b22;
  }

  .markdown-content hr {
    background-color: #21262d;
  }

  .callout {
    background-color: #161b22;
    border-left-color: #444;
  }

  .callout-quote {
    border-left-color: #666;
  }

  .callout-quote .callout-author {
    color: #8b949e;
  }

  .callout-info {
    border-left-color: #1f6feb;
    background-color: #0d1a2a;
  }

  .callout-info .callout-title {
    color: #58a6ff;
  }

  .callout-tip {
    border-left-color: #3fb950;
    background-color: #0d2818;
  }

  .callout-tip .callout-title {
    color: #3fb950;
  }

  .callout-warning {
    border-left-color: #d29922;
    background-color: #2b2300;
  }

  .callout-warning .callout-title {
    color: #e0ad0f;
  }

  .callout-danger {
    border-left-color: #f85149;
    background-color: #2d1113;
  }

  .callout-danger .callout-title {
    color: #f85149;
  }

  .callout-content {
    color: #8b949e;
  }
}
