/* =========================
   IMAGE BLOCK
========================= */

.image-block {
    width: 100%;
    max-width: 100%;
}

/* 🔥 CMS CONTAINER FIX (WICHTIG) */
.layout-center .image-block,
.cms-layout-center .image-block {
    max-width: 848px;
    margin: 0 auto;
}

/* =========================
   IMAGE
========================= */

.cms-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* =========================
   IMAGE SIZES
========================= */

.image-small {
    max-width: 300px;
}

.image-medium {
    max-width: 700px;
}

.image-large {
    max-width: 100%;
}

.image-full {
    width: 100%;
    max-width: 100%;
}

/* =========================
   ALIGNMENTS
========================= */

.align-left {
    text-align: left;
}

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

.align-right {
    text-align: right;
}

.align-left .cms-image {
    margin-right: auto;
}

.align-center .cms-image {
    margin-left: auto;
    margin-right: auto;
}

.align-right .cms-image {
    margin-left: auto;
}

/* =========================
   IMAGE TEXT
========================= */

.image-text {
    margin-top: 15px;
}

.image-text h3 {
    margin-bottom: 10px;
}

.image-text p {
    line-height: 1.6;
}

/* =========================
   OVERLAY
========================= */

.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay-text {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;

    background: rgba(0,0,0,0.45);
    color: white;

    padding: 20px;
}

/* =========================
   SIDE LAYOUT
========================= */

.image-side-layout {
    display: flex;
    gap: 30px;
    align-items: center;

    width: 100%;
    max-width: 100%;
}

/* 🔥 WICHTIG: verhindert Full-Width Breakout */
.layout-center .image-side-layout,
.cms-layout-center .image-side-layout {
    max-width: 848px;
    margin: 0 auto;
}

.image-side-image {
    flex: 1;
    min-width: 0;
}

.image-side-text {
    flex: 1;
    min-width: 0;
}

/* =========================
   OBJECT FIT
========================= */

.fit-cover {
    object-fit: cover;
}

.fit-contain {
    object-fit: contain;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .image-side-layout {
        flex-direction: column;
    }

    .image-small,
    .image-medium,
    .image-large {
        max-width: 100%;
    }
}

.cms-block .image-block,
.cms-block .image-side-layout,
.cms-block .media-text {
    max-width: 848px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* =========================
   CLICK LIGHTBOX
========================= */

.cms-lightbox-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    font: inherit;
}

.image-block.align-left .cms-lightbox-trigger {
    margin-right: auto;
}

.image-block.align-center .cms-lightbox-trigger {
    margin-left: auto;
    margin-right: auto;
}

.image-block.align-right .cms-lightbox-trigger {
    margin-left: auto;
}

.cms-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.86);
    cursor: zoom-out;
}

.cms-lightbox-overlay img {
    max-width: 95vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

body.cms-lightbox-open {
    overflow: hidden;
}
