/* Strenges Raster-Grid (Behält die Reihenfolge exakt von links nach rechts bei) */
.anderles-masonry-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.anderles-gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    /* Schneidet die Bilder optisch passend zu, damit das Raster sauber aussieht */
    aspect-ratio: 4 / 3; 
}

.anderles-gallery-item:hover {
    transform: scale(1.02);
}

.anderles-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
	border-radius: 0px;
}

/* Modalbox & Zoom-Modus */
.anderles-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.anderles-modal-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 85vw;
    max-height: 85vh;
    z-index: 100000;
    position: relative;
}

.anderles-modal-content {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0px;
}

/* Alt-Text im Zoom-Modus (sichtbar) */
#anderles-modal-caption {
    margin-top: 15px;
    color: #ccc;
    font-size: 18px;
    text-align: center;
    line-height: 1.4;
    max-width: 800px;
}

/* Modalbox schließen */
.anderles-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 100002;
}

.anderles-modal-close:hover,
.anderles-modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Weiter / Zurück Pfeile */
.anderles-modal-prev, 
.anderles-modal-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 100001;
    text-decoration: none;
}

.anderles-modal-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.anderles-modal-prev {
    left: 0;
}

.anderles-modal-prev:hover, 
.anderles-modal-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Damit das Copyright absolut auf dem Vorschaubild platziert werden kann */
.anderles-gallery-item {
    position: relative;
}

/* Styling für das Copyright im Modal (unter dem Alt-Text) */
#anderles-modal-alt {
    margin-bottom: 6px;
}

#anderles-modal-copy {
    color: #ccc;
    font-size: 15px;
    font-weight: 600;
}
