/* Shared markdown/article rendering */
:root {
    --markdown-primary: var(--primary, var(--admin-primary, #00205b));
    --markdown-gold: var(--gold, var(--admin-accent, #c5a561));
    --markdown-gold-hover: var(--gold-hover, #b09050);
}

.blog-single__content,
.editor-preview {
    color: #333;
    font-size: 1rem;
    line-height: 1.7;
}

.blog-single__content h2,
.blog-single__content h3,
.blog-single__content h4,
.editor-preview h2,
.editor-preview h3,
.editor-preview h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--markdown-primary);
    font-weight: 600;
    line-height: 1.4;
}

.blog-single__content h2,
.editor-preview h2 {
    font-size: 1.5rem;
    border-bottom: 3px solid var(--markdown-gold);
    padding-bottom: 0.75rem;
}

.blog-single__content h3,
.editor-preview h3 {
    font-size: 1.25rem;
}

.blog-single__content h4,
.editor-preview h4 {
    font-size: 1.1rem;
}

.blog-single__content p,
.editor-preview p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.blog-single__content img,
.editor-preview img {
    max-width: 80%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.article-image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 0 0;
    align-items: start;
}

.article-image-grid img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    object-position: center;
    margin: 0;
}

.article-image-grid img:nth-child(odd):last-child {
    grid-column: 1 / -1;
    max-height: 560px;
    width: min(70%, 420px);
    justify-self: center;
}

@media (max-width: 767px) {
    .article-image-grid {
        grid-template-columns: 1fr;
    }

    .article-image-grid img,
    .article-image-grid img:nth-child(odd):last-child,
    .blog-single__content > img,
    .editor-preview > img {
        width: auto;
        max-width: 100%;
        margin: auto;
    }
}

.blog-single__content ul,
.blog-single__content ol,
.editor-preview ul,
.editor-preview ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-single__content li,
.editor-preview li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.blog-single__content ul li::marker,
.blog-single__content ol li::marker,
.editor-preview ul li::marker,
.editor-preview ol li::marker {
    color: var(--markdown-gold);
    font-weight: 600;
}

.blog-single__content blockquote,
.editor-preview blockquote {
    border-left: 4px solid var(--markdown-gold);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #f8f9fa;
    font-style: italic;
    color: #555;
    border-radius: 4px;
}

.blog-single__content strong,
.blog-single__content b,
.editor-preview strong,
.editor-preview b {
    color: var(--markdown-primary);
    font-weight: 700;
}

.blog-single__content em,
.blog-single__content i,
.editor-preview em,
.editor-preview i {
    font-style: italic;
}

.blog-single__content a,
.editor-preview a {
    color: var(--markdown-gold);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.24s ease;
}

.blog-single__content a:hover,
.editor-preview a:hover {
    border-bottom-color: var(--markdown-gold);
    color: var(--markdown-gold-hover);
}

/* Image galleries */
.markdown-image-row,
.article-image-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
    margin: 1.5rem 0;
}

.markdown-image-row img,
.article-image-grid img {
    height: 520px;
    width: auto;
    max-width: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
    margin: 0;
}

.article-image-grid img:nth-child(odd):last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: auto;
    height: 560px;
    max-width: 100%;
}

@media (max-width: 700px) {
    .markdown-image-row,
    .article-image-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .markdown-image-row img,
    .article-image-grid img,
    .article-image-grid img:nth-child(odd):last-child {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 520px;
    }
}
