:root {
    --pclg-bg-opacity: 0.85;
    --pclg-hover-color: #ff9900;
}

/* ==========================================================================
   1. Thumbnail Grid Layout
   ========================================================================== */
.wrapgallery-wrapper {
    margin: 2em 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Falls Lightbox noch im Fließtext liegt: Eltern-Container via :has() hochheben */
.wrapgallery-wrapper:has(.image-lightbox:target) {
    z-index: 9999999 !important;
}

.gallery-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.gallery-wrapper a {
    display: inline-block;
    line-height: 0;
    text-align: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    max-width:250px;
}

.gallery-wrapper a:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.gallery-wrapper img.shadow {
    display: block;
    height: auto;
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    margin: 0 auto; /* Zentriert das Bild innerhalb des Links */
}

/* ==========================================================================
   2. Global Footer Lightbox Container & Overlay
   ========================================================================== */
.pclg-global-lightboxes {
    position: static;
}

.image-lightbox {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, var(--pclg-bg-opacity, 0.85));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999 !important; /* Überlagert alle Themes, Header & Sidebars */
    box-sizing: border-box !important;
}

/* Aktivierung via Pure CSS :target */
.image-lightbox:target {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* ==========================================================================
   3. Bilddarstellung & Wrappers
   ========================================================================== */
.image-lightbox-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000000;
}

.image-lightbox-wrapper div {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 90vh;
}

.image-lightbox-wrapper img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

.image-lightbox-wrapper p {
    color: #ffffff;
    margin-top: 12px;
    margin-bottom: 0;
    font-size: 15px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   4. Buttons & Controls
   ========================================================================== */
.image-lightbox a.close,
.image-lightbox a.arrows {
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10000001 !important;
}

.image-lightbox a.close:hover,
.image-lightbox a.arrows:hover {
    color: var(--pclg-hover-color, #ff9900);
}

.image-lightbox a.close {
    position: fixed;
    top: 25px;
    right: 25px;
    padding: 10px;
}

.image-lightbox a.close:hover {
    transform: scale(1.15);
}

.image-lightbox a.arrow-left {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    padding: 15px;
}

.image-lightbox a.arrow-left:hover {
    transform: translateY(-50%) scale(1.15);
}

.image-lightbox a.arrow-right {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    padding: 15px;
}

.image-lightbox a.arrow-right:hover {
    transform: translateY(-50%) scale(1.15);
}

.image-lightbox .svg-icon {
    width: 36px;
    height: 36px;
    stroke: currentColor;
    stroke-width: 2.2;
}

.image-lightbox .my-icon-close {
    width: 32px;
    height: 32px;
}
