.team-grid-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 60px 0;
}

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.team-grid:last-child {
    margin-bottom: 0;
}

.team-grid--leitung .team-grid-card {
    width: calc(33.333% - 1rem);
}

.team-grid--ehrenamt .team-grid-card {
    width: calc(25% - 1.2rem);
}

.team-grid-card {
    perspective: 800px;
    background: transparent;
    border: 2px solid transparent;
    min-width: 200px;
    min-height: 280px;
    transition: transform 0.25s ease, border-color 0.25s ease;
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: default;
}

a.team-grid-card {
    cursor: pointer;
}

.team-grid-card:hover {
    transform: scale(1.04);
}

.team-grid-card--leitung:hover {
    border-color: #FFCE00;
}

.team-grid-card--ehrenamt:hover {
    border-color: rgba(247, 247, 255, 0.3);
}

.team-grid-card__flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.team-grid-card:hover .team-grid-card__flipper {
    transform: rotateY(180deg);
}

.team-grid-card__front,
.team-grid-card__back {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    backface-visibility: hidden;
    background: #161615;
}

.team-grid-card__front {
    position: relative;
}

.team-grid-card__back {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transform: rotateY(180deg);
}

.team-grid-card--leitung .team-grid-card__image-wrap {
    width: 100%;
}

.team-grid-card--leitung .team-grid-card__image {
    width: 100%;
    aspect-ratio: 1014 / 1268;
    object-fit: cover;
    display: block;
}

.team-grid-card--leitung .team-grid-card__info {
    padding: 1rem 1rem 1.25rem;
}

.team-grid-card--leitung .team-grid-card__name {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-grid-card--leitung .team-grid-card__aufgabe {
    color: #FFCE00;
    font-weight: 500;
}

.team-grid-card--ehrenamt .team-grid-card__image-wrap {
    width: 100%;
}

.team-grid-card--ehrenamt .team-grid-card__image {
    width: 100%;
    aspect-ratio: 1014 / 1268;
    object-fit: cover;
    display: block;
}

.team-grid-card--ehrenamt .team-grid-card__info {
    padding: 0.75rem 0.75rem 1rem;
}

.team-grid-card--ehrenamt .team-grid-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
}

.team-grid-card__image-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.team-grid-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.team-grid-card__name {
    font-family: "Montserrat", sans-serif;
    color: #F7F7FF;
    line-height: 1.3;
}

.team-grid-card__back-text {
    font-family: "Roboto", sans-serif;
    color: #F7F7FF;
    font-size: 0.9rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
    padding: 0 0.25rem;
}

.team-grid-card__aufgabe {
    font-family: "Roboto", sans-serif;
    font-size: 0.85rem;
    color: rgba(247, 247, 255, 0.6);
    font-weight: 500;
}

.team-grid-card__placeholder {
    background: rgba(247, 247, 255, 0.05);
    width: 100%;
}

.team-grid-card__placeholder {
    aspect-ratio: 1014 / 1268;
}

@media (max-width: 1024px) {
    .team-grid-wrapper {
        padding: 45px 45px;
    }
}

@media (max-width: 768px) {
    .team-grid--leitung .team-grid-card,
    .team-grid--ehrenamt .team-grid-card {
        width: calc(33.333% - 1rem);
    }
}

@media (max-width: 767px) {
    .team-grid-wrapper {
        padding: 30px 30px;
    }
}

@media (max-width: 480px) {
    .team-grid--leitung .team-grid-card,
    .team-grid--ehrenamt .team-grid-card {
        width: calc(50% - 0.75rem);
    }
}
