/* ==========================================================================
   Team Section
   Grid of team member cards: circular photo, name, title, description.
   4 columns on desktop, 2 on tablet, 1 on mobile.
   Flexbox used instead of grid so incomplete rows centre horizontally.
   ========================================================================== */

.team {
    padding-block: var(--section-padding);
}

.team__header {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.team__heading {
    font-size: clamp(1.625rem, 3.5vw, 2.5rem);
    color: var(--color-navy);
    line-height: 1.2;
    margin-top: var(--space-xs);
}

.team__description {
    font-size: var(--font-size-body);
    color: var(--color-text-light);
    line-height: 1.75;
    max-width: 720px;
    margin: var(--space-sm) auto 0;
}

.team__description p {
    margin: 0 0 var(--space-sm);
}

.team__description p:last-child {
    margin-bottom: 0;
}

/* Flex grid: centres incomplete rows, spreads items evenly */
.team__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: var(--space-lg) var(--space-xl);
}

/* Card - full width on mobile */
.team__card {
    text-align: center;
    width: 100%;
    max-width: 280px;
}

.team__photo-wrap {
    width: 160px;
    height: 160px;
    margin-inline: auto;
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-full);
    overflow: hidden;
    background-color: var(--color-grey);
}

.team__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team__name {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-navy);
    line-height: 1.3;
}

.team__title {
    font-size: var(--font-size-body-small);
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.team__bio {
    font-size: var(--font-size-body-small);
    color: var(--color-text-light);
    line-height: 1.7;
    margin-top: var(--space-xs);
    max-width: 260px;
    margin-inline: auto;
}

/* ---- Tablet: 2 per row ---- */
@media ( min-width: 576px ) {
    .team__card {
        width: calc(50% - var(--space-xl));
    }
}

/* ---- Desktop: up to 4 per row, fixed width so incomplete rows space evenly ---- */
@media ( min-width: 1024px ) {
    .team__card {
        width: 240px;
    }
}
