.gallery-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(min(100%, 300px), 300px));
    gap:20px;
    justify-content:center;
}

.gallery-grid.gallery-center{
    display:grid;
}

.gallery-grid > div{
    box-sizing:border-box;
    width:100%;
    min-width:0;
    padding:12px;
    border:1px solid #f0e6d2;
    border-radius:var(--radius);
    background:#fff;
    box-shadow:0 8px 20px rgba(68, 30, 34, .08);
    text-align:center;
}

.gallery-grid > div > p,
.gallery-grid > div > b,
.gallery-center:not(.gallery-grid) > div > p,
.gallery-center:not(.gallery-grid) > div > b{
    display:block;
    margin:0;
    color:var(--primary);
    line-height:1.5;
}

.gallery-grid img,
.group-photo{
    display:block;
    width:100%;
    max-width:300px;
    height:400px;
    box-sizing:border-box;
    margin:0 auto 12px;
    object-fit:contain;
    border-radius:10px;
    cursor:pointer;
    transition:var(--transition);
}

.gallery-center:not(.gallery-grid) > div{
    flex:0 1 300px;
    min-width:0;
}

.gallery-center{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    flex-wrap:wrap;
}

.gallery-center:not(.gallery-grid) > div{
    box-sizing:border-box;
    padding:12px;
    border:1px solid #f0e6d2;
    border-radius:var(--radius);
    background:#fff;
    box-shadow:0 8px 20px rgba(68, 30, 34, .08);
    text-align:center;
}

.gallery-center > img.group-photo{
    box-sizing:border-box;
    max-width:324px;
    height:224px;
    padding:12px;
    border:1px solid #f0e6d2;
    background:#fff;
    box-shadow:0 8px 20px rgba(68, 30, 34, .08);
}

.gallery-grid img:hover{
    transform:scale(1.02);
}

#garde .details-content > h3,
#jugendtanzgruppen .details-content > h3{
    margin:0 0 16px;
}

#garde .gallery-grid:not(.gallery-center) img{
    height:225px;
}

#garde .gallery-grid:not(.gallery-center) p{
    margin:0;
    line-height:1.3;
}

#garde .gallery-grid:not(.gallery-center) p br{
    display:none;
}

#garde .group-photo,
#jugendtanzgruppen .group-photo{
    height:200px;
}

#trainer > .gallery-grid:last-of-type{
    margin-bottom:32px;
}

#jugendtanzgruppen .gallery-center > img.group-photo{
    width:min(100%, 524px);
    max-width:524px;
    height:324px;
}

#garde .gallery-center + h3,
#garde .gallery-grid + h3,
#jugendtanzgruppen .gallery-center + h3{
    margin-top:24px;
}

@media (max-width:600px){
    .gallery-grid{
        grid-template-columns:1fr;
        justify-items:center;
    }

    .gallery-grid img,
    .group-photo{
        height:360px;
    }
}