/* Shared styles for rendered markdown content */
/* Used in both admin preview and public post display */

.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.markdown-content h1 { 
    font-size: 2em; 
    margin: 0.67em 0;
    font-weight: bold;
}

.markdown-content h2 { 
    font-size: 1.5em;
    margin: 0.75em 0;
    font-weight: bold;
}

.markdown-content h3 { 
    font-size: 1.17em;
    margin: 0.83em 0;
    font-weight: bold;
}

.markdown-content h4 { 
    font-size: 1em;
    margin: 1.12em 0;
    font-weight: bold;
}

/* Content headings are shifted down one level (see demote_headings) so the page
   title is the only <h1>; md-hN keeps each heading at its original size. */
.markdown-content .md-h1 { font-size: 2em; margin: 0.67em 0; font-weight: bold; }
.markdown-content .md-h2 { font-size: 1.5em; margin: 0.75em 0; font-weight: bold; }
.markdown-content .md-h3 { font-size: 1.17em; margin: 0.83em 0; font-weight: bold; }
.markdown-content .md-h4 { font-size: 1em; margin: 1.12em 0; font-weight: bold; }
.markdown-content .md-h5 { font-size: 0.83em; margin: 1.5em 0; font-weight: bold; }

.markdown-content p {
    margin: 1em 0;
}

/* File-type icon in front of attachment links (📄 PDF etc.), large enough to spot easily. */
.markdown-content .file-icon {
    display: inline-block; /* keeps the link underline from running under the icon */
    font-size: 1.6em;
    line-height: 1;
    vertical-align: -0.2em;
    margin-right: 0.25em; /* gap without an underlined space before the link text */
}

/* Lists with proper bullets/numbers */
.markdown-content ul {
    list-style: disc outside !important;
    margin: 1em 0 !important;
    padding-left: 40px !important;
}

.markdown-content ol {
    list-style: decimal outside !important;
    margin: 1em 0 !important;
    padding-left: 40px !important;
}

.markdown-content li {
    margin: 0.25em 0 !important;
    display: list-item !important;
}

/* Force bullets to show by using pseudo-elements as backup */
.markdown-content ul > li:before {
    content: "•" !important;
    color: black !important;
    margin-right: 0.5em !important;
    margin-left: -1em !important;
}

/* Nested lists */
.markdown-content ul ul,
.markdown-content ol ul {
    list-style-type: circle;
    margin: 0.5em 0;
}

.markdown-content ul ul ul,
.markdown-content ol ul ul {
    list-style-type: square;
}

/* Code */
.markdown-content pre {
    background: #f4f4f4;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content code {
    background: #f4f4f4;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

/* Blockquotes */
.markdown-content blockquote {
    border-left: 4px solid #ddd;
    margin: 1em 0;
    padding-left: 1em;
    color: #666;
}

/* Tables */
.markdown-content table {
    border-collapse: collapse;
    /* Size to the content (short tables used to stretch across the page) and scroll
       sideways instead of overflowing when a table is wider than the column. */
    display: block;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    margin: 1em 0;
    background: #fff;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #d5dbe1;
    padding: 0.4em 0.8em;
    text-align: left;
    vertical-align: top;
}

.markdown-content th {
    background: #e8eef4;
    font-weight: bold;
}

.markdown-content tbody tr:nth-child(even) td {
    background: #f6f8fa;
}

/* Links */
.markdown-content a {
    color: #0066cc;
    text-decoration: underline;
}

.markdown-content a:hover {
    color: #0052a3;
}

/* Horizontal rules */
.markdown-content hr {
    border: none;
    border-top: 3px solid #444;
    margin: 2em 0;
}

/* Images */
.markdown-content img {
    max-width: 100%;
    height: auto;
}
