/***************************************
 * Markdown CSS
 * Purpose: Style markdown content
 ***************************************/

/* General Markdown Styles */
.markdown-preview {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0 auto;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: var(--color-heading);
}

.markdown-preview h1 {
    font-size: 2.5em;
}

.markdown-preview h2 {
    font-size: 2em;
}

.markdown-preview h3 {
    font-size: 1.75em;
}

.markdown-preview h4 {
    font-size: 1.5em;
}

.markdown-preview h5 {
    font-size: 1.25em;
}

.markdown-preview h6 {
    font-size: 1em;
}

/* Paragraphs */
.markdown-preview p {
    margin-bottom: 1em;
}

/* Links */
.markdown-preview a {
    color: var(--color-link);
    text-decoration: none;
}

.markdown-preview a:hover {
    text-decoration: underline;
}

/* Lists */
.markdown-preview ul, .markdown-preview ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.markdown-preview ul {
    list-style-type: disc; /* Default bullet style for unordered lists */
    margin-left: 1.5em; /* Indentation for unordered lists */
}

.markdown-preview ol {
    list-style-type: decimal; /* Default numbering style for ordered lists */
    margin-left: 1.5em; /* Indentation for ordered lists */
}

.markdown-preview li {
    margin-bottom: 0.5em;
}

/* Blockquotes */
.markdown-preview blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 4px solid var(--color-blockquote-border);
    background: var(--color-note-bg);
    color: var(--color-quote);
}

/* Code */
.markdown-preview pre, .markdown-preview code {
    font-family: 'Courier New', monospace;
    background: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.markdown-preview pre {
    overflow-x: auto;
    padding: 1em;
}

.markdown-preview code {
    font-size: 0.9em;
}

/* Tables */
.markdown-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.markdown-preview th, .markdown-preview td {
    padding: 0.5em;
    border: 1px solid var(--color-border);
}

.markdown-preview th {
    background: var(--color-table-header-bg);
    color: var(--color-text);
    text-align: left;
}

/* Images - prevent oversized images from filling the screen */
.markdown-preview img {
    max-width: 100%;
    max-width: min(100%, 800px);
    max-height: 600px;
    height: auto;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 1em auto;
    border-radius: 0.5rem;
}

@media screen and (max-width: 768px) {
  .markdown-preview ul,
  .markdown-preview ol {
    padding-left: 1em; /* Reduced from 1.5em */
    margin-left: 1em;  /* Reduced from 1.5em */
  }
  .markdown-preview h1 {
    margin-top: 0; /* Remove top margin for h1 on mobile */
  }
}