/*
 * Article body styles – shared by the site and the CKEditor 5 admin editor.
 *
 * Loaded by base.html (after styles-2025.css) and imported by ckeditor5.css,
 * so editors see article text the way readers do. Every rule lists both
 * contexts:
 *
 *   article …, .article-content …             the published article
 *   .ck.ck-editor__editable.ck-content …       the admin editor (the extra
 *                                              classes outrank Django admin
 *                                              styles that would leak in)
 *
 * Keep this file self-contained (plain colour values, no var()): the admin
 * loads it without styles-2025.css.
 */


/* ==========================================================================
   Headings, paragraphs, links
   ========================================================================== */

article h2,
article h3,
article h4,
article h5,
article h6,
article p strong,
.ck.ck-editor__editable.ck-content h2,
.ck.ck-editor__editable.ck-content h3,
.ck.ck-editor__editable.ck-content h4,
.ck.ck-editor__editable.ck-content h5,
.ck.ck-editor__editable.ck-content h6,
.ck.ck-editor__editable.ck-content p strong {
    color: #333333;
    font-weight: 500;
}

article h4,
.ck.ck-editor__editable.ck-content h4 {
    line-height: 30px;
}

article p,
.ck.ck-editor__editable.ck-content p {
    font-size: 16px;
    line-height: 24px;
    color: #333333;
    margin-bottom: 16px;
}

article p.bold,
article p b,
.ck.ck-editor__editable.ck-content p.bold,
.ck.ck-editor__editable.ck-content p b {
    font-weight: 500;
}

/* Photo credit: a bold line in the image's paragraph, or in the paragraph
   right after an image (CKEditor 4 <p><img>, CKEditor 5 <figure>). */
article p:has(img) strong,
article p:has(img) + p > strong,
article figure.image + p > strong,
.ck.ck-editor__editable.ck-content p:has(img) strong,
.ck.ck-editor__editable.ck-content p:has(img) + p > strong,
.ck.ck-editor__editable.ck-content figure.image + p > strong {
    background-color: lightgrey;
    font-weight: 400;
    text-align: right;
    display: block;
    padding: 4px 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

article p:has(img),
.ck.ck-editor__editable.ck-content p:has(img) {
    margin-bottom: 0;
}

article a,
.ck.ck-editor__editable.ck-content a {
    color: #189ADB;
}

article p:empty,
article h2:empty,
article h3:empty,
article h4:empty,
article h5:empty,
.ck.ck-editor__editable.ck-content p:empty,
.ck.ck-editor__editable.ck-content h2:empty,
.ck.ck-editor__editable.ck-content h3:empty,
.ck.ck-editor__editable.ck-content h4:empty,
.ck.ck-editor__editable.ck-content h5:empty {
    display: none;
}


/* ==========================================================================
   Lists
   ========================================================================== */

article ul,
article ol,
.ck.ck-editor__editable.ck-content ul,
.ck.ck-editor__editable.ck-content ol {
    padding-inline-start: 25px;
    margin-bottom: 16px;
}

article ul li,
article ol li,
.ck.ck-editor__editable.ck-content ul li,
.ck.ck-editor__editable.ck-content ol li {
    font-size: 16px;
    line-height: 24px;
    color: #333333;
    margin-bottom: 6px;
}

article ul li::marker,
article ol li::marker,
.ck.ck-editor__editable.ck-content ul li::marker,
.ck.ck-editor__editable.ck-content ol li::marker {
    text-align: center;
    font-weight: 500;
    font-family: sans-serif;
}


/* ==========================================================================
   CKEditor 5 markup: images, tables, embedded media
   ========================================================================== */

.article-content figure,
.ck.ck-editor__editable.ck-content figure {
    margin: 0 0 16px 0;
}

.article-content figure.image,
.ck.ck-editor__editable.ck-content figure.image {
    display: table;
    clear: both;
    text-align: center;
    margin: 16px auto;
}

.article-content figure.image img,
.ck.ck-editor__editable.ck-content figure.image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.article-content figure.image.image_resized img,
.ck.ck-editor__editable.ck-content figure.image.image_resized img {
    width: 100%;
}

.article-content figure.image figcaption,
.ck.ck-editor__editable.ck-content figure.image figcaption {
    display: table-caption;
    caption-side: bottom;
    font-size: 14px;
    color: #666666;
    padding: 6px 0;
}

.article-content .image-style-align-left,
.ck.ck-editor__editable.ck-content .image-style-align-left {
    float: left;
    max-width: 50%;
    margin: 5px 16px 10px 0;
}

.article-content .image-style-side,
.article-content .image-style-align-right,
.ck.ck-editor__editable.ck-content .image-style-side,
.ck.ck-editor__editable.ck-content .image-style-align-right {
    float: right;
    max-width: 50%;
    margin: 5px 0 10px 16px;
}

.article-content .image-style-align-center,
.ck.ck-editor__editable.ck-content .image-style-align-center {
    margin-left: auto;
    margin-right: auto;
}

.article-content figure.table,
.ck.ck-editor__editable.ck-content figure.table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.article-content figure.table table,
.ck.ck-editor__editable.ck-content figure.table table {
    width: 100%;
}

.article-content figure.media,
.ck.ck-editor__editable.ck-content figure.media {
    position: relative;
    width: 100%;
}

.article-content figure.media iframe,
.ck.ck-editor__editable.ck-content figure.media iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    border: 0;
}
