/* Custom prose styles for markdown rendering */
/* Since @tailwindcss/typography is not installed, we create our own */

.prose {
  color: inherit;
  max-width: 65ch;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.25em;
}

/* Headings */
.prose h1 {
  font-size: 2.25em;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 0.8em;
}

.prose h2 {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.prose h3 {
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}

.prose h4 {
  font-size: 1em;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
}

.prose h5,
.prose h6 {
  font-size: 0.875em;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
}

/* Remove anchor styling from heading anchors */
.prose h1 > a.anchor,
.prose h2 > a.anchor,
.prose h3 > a.anchor,
.prose h4 > a.anchor,
.prose h5 > a.anchor,
.prose h6 > a.anchor {
  display: none;
}

/* Paragraphs */
.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose p:first-child {
  margin-top: 0;
}

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

/* Links */
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 500;
}

.prose a:hover {
  color: color-mix(in oklab, var(--color-primary) 80%, transparent);
}

/* Bold/Strong */
.prose strong {
  font-weight: 600;
}

/* Italic */
.prose em {
  font-style: italic;
}

/* Code inline */
.prose code {
  background-color: var(--color-base-300);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Code blocks */
.prose pre {
  background-color: var(--color-base-300);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: 0.875em;
}

/* Blockquotes - styled like VS Code/Obsidian with visible border and background */
.prose blockquote {
  border-left: 4px solid #3b82f6 !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  padding: 1em 1em 1em 1.5em !important;
  margin: 1.5em 0 !important;
  border-radius: 0 0.5rem 0.5rem 0 !important;
  font-style: normal !important;
}

.prose blockquote p:first-child {
  margin-top: 0;
}

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

/* Nested blockquotes */
.prose blockquote blockquote {
  margin-top: 1em;
  margin-bottom: 1em;
  border-left-color: #8b5cf6 !important;
}

/* Lists */
.prose ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Horizontal rule */
.prose hr {
  border: 0;
  border-top: 1px solid var(--color-base-300);
  margin-top: 2em;
  margin-bottom: 2em;
}

/* Tables */
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.prose th {
  background-color: var(--color-base-200);
  font-weight: 600;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  border: 1px solid var(--color-base-300);
}

.prose td {
  vertical-align: top;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  border: 1px solid var(--color-base-300);
}

.prose table code {
  white-space: pre-wrap;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

/* Max width none utility */
.prose.max-w-none {
  max-width: none;
}
