/* Mitglieder-Galerie (Bootstrap 3 kompatibel) */

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px 0;
}

.gallery-item {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
    text-align: center;
    border-radius: 5px;
    overflow: hidden;
}

/* Desktop: 3 Spalten ab ~992px */
@media (min-width: 992px) {
    .gallery-item {
        flex: 1 1 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
    }
}

/* Mobile: 1 Spalte */
@media (max-width: 768px) {
    .gallery-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.img-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    overflow: hidden;
}

.img-container img {
    width: 200px;
    height: 250px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
    background: #f2f2f2;
}

.img-container:hover img {
    transform: scale(1.05);
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.img-container:hover .overlay,
.img-container.active .overlay {
    opacity: 1;
}

.overlay-content {
    width: 100%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.img-container:hover .overlay-content,
.img-container.active .overlay-content {
    opacity: 1;
    transform: translateY(0);
}

.overlay-top { display: flex; flex-direction: column; }
.overlay-top > div { margin-bottom: 12px; }

.overlay-referat {
    font-size: 16px;
    font-weight: bold;
}

.overlay-studiengang { font-size: 15px; }
.overlay-alter { font-size: 14px; color: #ddd; }

.overlay-membership {
    font-size: 14px;
    color: #ccc;
    margin-top: auto;
}

/* Name unter dem Bild */
.member-name {
    background-color: #e6e6e6;
    color: #000000;
    padding: 8px;
    font-weight: bold;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    width: 200px;
    margin: -7px auto 0 auto;
    text-align: center;
}

/* Glyphicons im Overlay */
.overlay .glyphicon {
    margin-right: 6px;
}


.gallery-item .overlay a,
.gallery-item .overlay a:link,
.gallery-item .overlay a:visited,
.gallery-item .overlay a:hover,
.gallery-item .overlay a:active,
.gallery-item .overlay a:focus {
    color: #fff;
    text-decoration: none;
}
