h1 {
    text-align: center;
    margin: 20px 0;
}

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

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.gallery-label {
    font-size: 14px;
    text-align: center;
    color: #333;
}

/* Overlay */
#imageOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

#overlayContent {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* WICHTIG: gesamtes Bild zeigen */
#overlayImage {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;   /* statt cover/ohne Angabe */
    border-radius: 4px;
}

/* Schließen-Button oben rechts */
#overlayClose {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 26px;
    color: #ffffff;
    cursor: pointer;
    padding: 5px 10px;
}

/* Pfeile links/rechts */
.overlay-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #ffffff;
    cursor: pointer;
    padding: 10px 20px;          /* größere Klickfläche */
    user-select: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

/* weiter nach innen statt außerhalb des Inhalts */
#overlayPrev {
    left: 10px;
}

#overlayNext {
    right: 10px;
}

/* Caption unten */
#overlayCaption {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 16px;
}

@media (max-width: 768px) {
    .overlay-arrow {
        font-size: 30px;
        padding: 12px 24px;
    }

    #overlayPrev {
        left: -40px;
    }

    #overlayNext {
        right: -40px;
    }

    #overlayClose {
        top: -35px;
    }
}
