/* ============================================================
   WordPress native editor content
   Klasy emitowane przez klasyczny edytor (TinyMCE) / ACF WYSIWYG
   oraz bibliotekę mediów: wyrównania, podpisy, galerie, rozmiary.
   Ładowane globalnie, więc obejmują każdą sekcję renderującą WYSIWYG.
   ============================================================ */

/* --- Wyrównania obrazków / bloków -------------------------- */
.alignleft {
    float: left;
    margin: 0.4em 1.5em 1em 0;
}

.alignright {
    float: right;
    margin: 0.4em 0 1em 1.5em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignnone {
    margin: 0.4em 0 1em;
}

img.alignleft,
img.alignright,
img.aligncenter,
img.alignnone {
    height: auto;
    max-width: 100%;
}

figure.alignleft,
figure.alignright,
figure.aligncenter {
    max-width: 100%;
}

/* --- Podpisy (caption / figcaption) ------------------------ */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1.1em;
}

.wp-caption img {
    display: block;
    height: auto;
    max-width: 100%;
}

.wp-caption-text,
figcaption {
    margin: 0.5em 0 0;
    font-family: var(--lre-font-sans, sans-serif);
    font-size: 13px;
    font-style: italic;
    line-height: 1.4;
    color: var(--lre-color-ink-muted, rgba(31, 26, 20, 0.7));
}

.wp-caption .wp-caption-text {
    text-align: center;
}

/* --- Galerie (add_theme_support 'gallery') ----------------- */
.gallery {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px 1.1em;
}

.gallery-item {
    margin: 0 8px 16px;
    text-align: center;
}

.gallery-columns-2 .gallery-item { width: calc(50% - 16px); }
.gallery-columns-3 .gallery-item { width: calc(33.3333% - 16px); }
.gallery-columns-4 .gallery-item { width: calc(25% - 16px); }
.gallery-columns-5 .gallery-item { width: calc(20% - 16px); }
.gallery-columns-6 .gallery-item { width: calc(16.6666% - 16px); }

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}

.gallery-caption {
    display: block;
    margin-top: 0.4em;
    font-family: var(--lre-font-sans, sans-serif);
    font-size: 13px;
    font-style: italic;
    color: var(--lre-color-ink-muted, rgba(31, 26, 20, 0.7));
}

/* --- Pomocnicze wyrównanie tekstu (blok / klasyczny) ------- */
.has-text-align-left   { text-align: left; }
.has-text-align-center { text-align: center; }
.has-text-align-right  { text-align: right; }

/* --- Bezpieczeństwo obrazków z biblioteki mediów ----------- */
img[class*="wp-image-"] {
    height: auto;
    max-width: 100%;
}

/* --- Mobile: pływające obrazki w pionie -------------------- */
@media (max-width: 600px) {
    .alignleft,
    .alignright {
        float: none;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}
