/*
   Shared article content layout.
   Loaded by both the custom admin editor and the public article details page.
   Image width is stored as a percentage, so the editor preview and published
   page use the same geometry.
*/


/* Public article details intentionally mirrors the admin preview geometry. */
.article-details-page .article-reading-layout {
    display: block;
    width: 100%;
    max-width: none;
}

.article-details-page .article-reading-aside {
    display: none;
}

.article-details-page .article-prose {
    width: min(100%, var(--container-reading, 780px));
    margin-inline: auto;
}

.article-details-page .article-prose,
.article-editor-preview .article-prose {
    display: flow-root;
    min-width: 0;
}

.article-details-page .article-prose p,
.article-editor-preview .article-prose p {
    min-width: 0;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Custom inline image object. It may live inside a paragraph at any caret position. */
.article-details-page .article-prose .content-image-object,
.article-editor-preview .article-prose .content-image-object {
    position: relative;
    box-sizing: border-box;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    vertical-align: top;
}

.article-details-page .article-prose .content-image-object > img,
.article-details-page .article-prose .content-image-object > a > img,
.article-editor-preview .article-prose .content-image-object > img,
.article-editor-preview .article-prose .content-image-object > a > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 !important;
    float: none !important;
    object-fit: contain;
}

/* Stari sadržaji koji su sačuvani sa eksperimentalnim "both" rasporedom
   više se ne prikazuju u tri kolone. Tekst ostaje normalan, a slika se
   ponaša kao zaseban blok dok se članak ponovo ne sačuva kroz editor. */
.article-details-page .article-prose .content-image-both-flow,
.article-editor-preview .article-prose .content-image-both-flow {
    display: block !important;
    width: 100%;
}

.article-details-page .article-prose .content-image-both-flow__before,
.article-details-page .article-prose .content-image-both-flow__after,
.article-editor-preview .article-prose .content-image-both-flow__before,
.article-editor-preview .article-prose .content-image-both-flow__after {
    display: inline;
}

.article-details-page .article-prose .content-image-object--both,
.article-editor-preview .article-prose .content-image-object--both {
    display: block !important;
    width: min(100%, 520px) !important;
    max-width: 100% !important;
    margin: 24px auto !important;
    float: none !important;
    clear: both !important;
}

.article-details-page .article-prose .content-image-object--float-left,
.article-editor-preview .article-prose .content-image-object--float-left {
    display: block;
    float: left !important;
    clear: none !important;
    max-width: 55%;
}

.article-details-page .article-prose .content-image-object--float-right,
.article-editor-preview .article-prose .content-image-object--float-right {
    display: block;
    float: right !important;
    clear: none !important;
    max-width: 55%;
}

.article-details-page .article-prose .content-image-object--block,
.article-editor-preview .article-prose .content-image-object--block {
    display: block;
    float: none !important;
    clear: both !important;
    max-width: 100%;
}

.article-details-page .article-prose .content-image-object--full,
.article-editor-preview .article-prose .content-image-object--full {
    display: block;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
}

.article-details-page .article-prose .content-image-caption,
.article-editor-preview .article-prose .content-image-caption {
    display: block;
    padding-top: 8px;
    color: #667077;
    font-family: var(--font-sans, Arial, sans-serif);
    font-size: .78rem;
    line-height: 1.45;
    text-align: center;
}

/* Featured image generated by ArticleContentLayoutService and mirrored in editor. */
.article-details-page .article-prose .article-flow-image,
.article-editor-preview .article-prose .article-flow-image {
    display: block;
    box-sizing: border-box;
    width: min(31%, 270px);
    margin: 8px 28px 22px 0;
}

.article-details-page .article-prose .article-flow-image--left,
.article-editor-preview .article-prose .article-flow-image--left {
    float: left;
}

.article-details-page .article-prose .article-flow-image--right,
.article-editor-preview .article-prose .article-flow-image--right {
    float: right;
    margin-right: 0;
    margin-left: 28px;
}

.article-details-page .article-prose .article-flow-image--portrait,
.article-editor-preview .article-prose .article-flow-image--portrait {
    width: min(27%, 230px);
}

.article-details-page .article-prose .article-flow-image--landscape,
.article-editor-preview .article-prose .article-flow-image--landscape {
    width: min(39%, 360px);
}

.article-details-page .article-prose .article-flow-image--featured,
.article-editor-preview .article-prose .article-flow-image--featured {
    width: min(38%, 360px);
}

.article-details-page .article-prose .article-flow-image img,
.article-editor-preview .article-prose .article-flow-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
}

/* Samo uvodni naslov koji stoji uz naslovnu sliku. */
.article-details-page .article-prose > .article-flow-image--featured:first-child + h1,
.article-details-page .article-prose > .article-flow-image--featured:first-child + h2,
.article-details-page .article-prose > .article-flow-image--featured:first-child + h3,
.article-details-page .article-prose > .article-flow-image--featured:first-child + h4,
.article-editor-preview .article-prose > .article-flow-image--featured:first-child + h1,
.article-editor-preview .article-prose > .article-flow-image--featured:first-child + h2,
.article-editor-preview .article-prose > .article-flow-image--featured:first-child + h3,
.article-editor-preview .article-prose > .article-flow-image--featured:first-child + h4 {
    font-size: clamp(1.65rem, 2.2vw, 2.25rem);
    line-height: 1.12;
}

@media (min-width: 701px) {
    .article-details-page .article-prose > .article-flow-image--featured:first-child,
    .article-editor-preview .article-prose > .article-flow-image--featured:first-child {
        margin-top: 0;
    }

    .article-details-page .article-prose > .article-flow-image--featured:first-child + h1,
    .article-details-page .article-prose > .article-flow-image--featured:first-child + h2,
    .article-details-page .article-prose > .article-flow-image--featured:first-child + h3,
    .article-details-page .article-prose > .article-flow-image--featured:first-child + h4,
    .article-editor-preview .article-prose > .article-flow-image--featured:first-child + h1,
    .article-editor-preview .article-prose > .article-flow-image--featured:first-child + h2,
    .article-editor-preview .article-prose > .article-flow-image--featured:first-child + h3,
    .article-editor-preview .article-prose > .article-flow-image--featured:first-child + h4 {
        margin-top: 0;
    }
}

/* Existing editor format retained for older saved content. */
.article-details-page .article-prose figure.content-figure,
.article-editor-preview .article-prose figure.content-figure {
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
    margin: 8px 0 22px;
    padding: 0;
    border: 0;
    background: transparent;
}

.article-details-page .article-prose figure.content-figure > img,
.article-details-page .article-prose figure.content-figure > a > img,
.article-editor-preview .article-prose figure.content-figure > img,
.article-editor-preview .article-prose figure.content-figure > a > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    float: none !important;
    object-fit: contain;
}

.article-details-page .article-prose figure.content-image--wrap-both,
.article-details-page .article-prose figure.content-image--wrap-left,
.article-details-page .article-prose figure.content-image--wrap-right,
.article-editor-preview .article-prose figure.content-image--wrap-both,
.article-editor-preview .article-prose figure.content-image--wrap-left,
.article-editor-preview .article-prose figure.content-image--wrap-right {
    clear: none !important;
    max-width: 55% !important;
}

.article-details-page .article-prose figure.content-image--side-left,
.article-details-page .article-prose figure.content-image--wrap-left,
.article-editor-preview .article-prose figure.content-image--side-left,
.article-editor-preview .article-prose figure.content-image--wrap-left {
    float: left !important;
    margin-right: 24px;
    margin-left: 0;
}

.article-details-page .article-prose figure.content-image--side-right,
.article-details-page .article-prose figure.content-image--wrap-right,
.article-editor-preview .article-prose figure.content-image--side-right,
.article-editor-preview .article-prose figure.content-image--wrap-right {
    float: right !important;
    margin-right: 0;
    margin-left: 24px;
}

.article-details-page .article-prose figure.content-image--center,
.article-editor-preview .article-prose figure.content-image--center {
    display: block;
    float: none !important;
    clear: both !important;
    max-width: 100% !important;
    margin: 28px auto !important;
}

.article-details-page .article-prose figure.content-image--full,
.article-editor-preview .article-prose figure.content-image--full {
    display: block;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px 0 !important;
}

/* Legacy WordPress classes from scraped articles. */
.article-details-page .article-prose img.alignleft,
.article-details-page .article-prose figure.alignleft,
.article-editor-preview .article-prose img.alignleft,
.article-editor-preview .article-prose figure.alignleft {
    float: left !important;
    clear: none !important;
    width: auto;
    max-width: min(46%, 360px) !important;
    height: auto;
    margin: 8px 26px 18px 0 !important;
}

.article-details-page .article-prose img.alignright,
.article-details-page .article-prose figure.alignright,
.article-editor-preview .article-prose img.alignright,
.article-editor-preview .article-prose figure.alignright {
    float: right !important;
    clear: none !important;
    width: auto;
    max-width: min(46%, 360px) !important;
    height: auto;
    margin: 8px 0 18px 26px !important;
}

.article-details-page .article-prose img.aligncenter,
.article-details-page .article-prose figure.aligncenter,
.article-details-page .article-prose img.alignnone,
.article-details-page .article-prose figure.alignnone,
.article-editor-preview .article-prose img.aligncenter,
.article-editor-preview .article-prose figure.aligncenter,
.article-editor-preview .article-prose img.alignnone,
.article-editor-preview .article-prose figure.alignnone {
    display: block;
    float: none !important;
    clear: both !important;
    width: auto;
    max-width: 100% !important;
    height: auto;
    margin: 26px auto !important;
}

.article-details-page .article-prose img.size-thumbnail,
.article-editor-preview .article-prose img.size-thumbnail { max-width: 150px !important; }
.article-details-page .article-prose img.size-medium,
.article-editor-preview .article-prose img.size-medium { max-width: min(46%, 360px) !important; }
.article-details-page .article-prose img.size-large,
.article-editor-preview .article-prose img.size-large { max-width: min(100%, 760px) !important; }
.article-details-page .article-prose img.size-full,
.article-editor-preview .article-prose img.size-full { width: 100% !important; max-width: 100% !important; }

/* Two/three-column galleries created by the article editor. */
.article-details-page .article-prose .article-image-grid,
.article-editor-preview .article-prose .article-image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 1.8vw, 18px);
    clear: both;
    width: 100%;
    margin: 32px 0;
}

.article-details-page .article-prose .article-image-grid--3,
.article-editor-preview .article-prose .article-image-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-details-page .article-prose .article-image-grid__item,
.article-editor-preview .article-prose .article-image-grid__item {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.article-details-page .article-prose .article-image-grid__item img,
.article-editor-preview .article-prose .article-image-grid__item img {
    display: block;
    width: 100%;
    max-width: 100% !important;
    height: clamp(190px, 28vw, 340px);
    margin: 0 !important;
    float: none !important;
    object-fit: contain;
}

@media (max-width: 700px) {
    .article-details-page .article-prose .content-image-object,
    .article-details-page .article-prose .content-image-object--both,
    .article-details-page .article-prose .content-image-object--float-left,
    .article-details-page .article-prose .content-image-object--float-right,
    .article-details-page .article-prose .content-image-object--block,
    .article-details-page .article-prose .content-image-object--full,
    .article-editor-preview .article-prose .content-image-object,
    .article-editor-preview .article-prose .content-image-object--both,
    .article-editor-preview .article-prose .content-image-object--float-left,
    .article-editor-preview .article-prose .content-image-object--float-right,
    .article-editor-preview .article-prose .content-image-object--block,
    .article-editor-preview .article-prose .content-image-object--full,
    .article-details-page .article-prose figure.content-figure,
    .article-editor-preview .article-prose figure.content-figure,
    .article-details-page .article-prose .article-flow-image,
    .article-editor-preview .article-prose .article-flow-image,
    .article-details-page .article-prose img.alignleft,
    .article-details-page .article-prose img.alignright,
    .article-details-page .article-prose img.aligncenter,
    .article-details-page .article-prose img.alignnone,
    .article-editor-preview .article-prose img.alignleft,
    .article-editor-preview .article-prose img.alignright,
    .article-editor-preview .article-prose img.aligncenter,
    .article-editor-preview .article-prose img.alignnone {
        display: block !important;
        float: none !important;
        clear: both !important;
        width: min(100%, 520px) !important;
        max-width: 100% !important;
        margin: 24px auto !important;
    }

    .article-details-page .article-prose .article-image-grid,
    .article-details-page .article-prose .article-image-grid--3,
    .article-editor-preview .article-prose .article-image-grid,
    .article-editor-preview .article-prose .article-image-grid--3 {
        grid-template-columns: 1fr;
    }

    .article-details-page .article-prose .article-image-grid__item img,
    .article-editor-preview .article-prose .article-image-grid__item img {
        width: 100%;
        height: auto;
        max-height: 520px;
    }
}

/* Mobile public article spacing. This file is loaded after details.css,
   so the final width must also be defined here. */
@media (max-width: 620px) {
    .article-details-page .article-reading-layout {
        width: 90%;
        max-width: none;
        margin-inline: auto;
    }

    .article-details-page .article-prose {
        width: 100%;
        max-width: none;
    }
}
