/* ── Team Block ──────────────────────────────────────────────────────────── */

.team-block {
    padding: 80px 0;
}

/* ── Department tabs ─────────────────────────────────────────────────────── */

.team-dept-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 24px;
}

.team-dept-btn {
    padding: 10px 20px;
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--neutral-200);
    font-size: 14px;
    font-weight: 400;
    color: var(--wp--preset--color--black, #1a1a25);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-radius: 0;
    margin-left: -1px;
}

.team-dept-btn:first-child {
    border-radius: 4px 0 0 4px;
    margin-left: 0;
}

.team-dept-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.team-dept-btn.is-active {
    background: var(--wp--preset--color--dark);
    border-color: var(--wp--preset--color--dark);
    color: var(--wp--preset--color--white);
    position: relative;
    z-index: 1;
}

.team-dept-btn:hover:not(.is-active) {
    background: var(--wp--preset--color--neutral-100);
}

/* ── Department description ──────────────────────────────────────────────── */

.team-dept-desc {
    margin-bottom: 48px;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--wp--preset--color--neutral-300, #747481);
    max-width: 720px;
}

.team-dept-desc:empty {
    margin-bottom: 0;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 24px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.team-card {
    display: flex;
    flex-direction: column;
    background: var(--wp--preset--color--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(26, 26, 37, 0.06);
    transition: box-shadow 0.2s, opacity 0.18s ease, transform 0.18s ease;
}

.team-card:hover {
    box-shadow: 0 8px 24px rgba(26, 26, 37, 0.12);
}

.team-card--hidden {
    display: none;
}

.team-card--exit {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

@keyframes teamCardIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.team-card--enter {
    animation: teamCardIn 0.32s ease both;
    animation-delay: calc(var(--ci, 0) * 45ms);
}

@media (prefers-reduced-motion: reduce) {
    .team-card--exit,
    .team-card--enter {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* ── Photo wrap ──────────────────────────────────────────────────────────── */

.team-card__photo-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #f0f0f8;
    flex-shrink: 0;
}

.team-card__photo {
    width: 100%;
    height: 100%;
}

.team-card__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease;
}

.team-card:hover .team-card__photo img {
    transform: scale(1.05);
}

.team-card__photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--wp--preset--color--neutral-200);
}

/* ── Badges (overlaid on photo) ──────────────────────────────────────────── */

.team-card__badges {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
}

.team-card__badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(4px);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--wp--preset--color--black);
    white-space: nowrap;
}

/* ── Card body ───────────────────────────────────────────────────────────── */

.team-card__body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    padding: 20px 20px 16px;
    gap: 16px;
}

.team-card__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-card__name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--wp--preset--color--black, #1a1a25);
}

.team-card__role {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wp--preset--color--purple-500, #430b8e);
}

.team-card__desc {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.65;
    color: var(--wp--preset--color--neutral-300, #747481);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Contact ─────────────────────────────────────────────────────────────── */

.team-card__contact {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f8;
}

.team-card__contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--wp--preset--color--neutral-100);
    border: none;
    border-radius: 6px;
    color: var(--wp--preset--color--neutral-300);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.team-card__contact-btn:hover {
    background: var(--wp--preset--color--purple-500, #430b8e);
    color: var(--wp--preset--color--white);
}

/* ── Empty ───────────────────────────────────────────────────────────────── */

.team-empty {
    text-align: center;
    padding: 64px 0;
    color: var(--wp--preset--color--neutral-300, #747481);
    font-size: 15px;
    font-weight: 300;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1199px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .team-block {
        padding: 48px 0;
    }

    .team-dept-desc {
        margin-bottom: 32px;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .team-card__body {
        padding: 16px 16px 12px;
    }

    .team-card__name {
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Dark mode ──────────────────────────────────────────────────────────── */

html[data-theme="dark"] .team-block {
    background-color: var(--wp--preset--color--black, #1A1A25);
}

html[data-theme="dark"] .team-dept-btn {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .2);
    color: var(--wp--preset--color--white);
}

html[data-theme="dark"] .team-dept-btn.is-active {
    background: var(--wp--preset--color--yellow, #FFE500);
    border-color: var(--wp--preset--color--yellow, #FFE500);
    color: var(--wp--preset--color--black, #1A1A25);
}

html[data-theme="dark"] .team-dept-btn:hover:not(.is-active) {
    background: rgba(255, 255, 255, .1);
}

html[data-theme="dark"] .team-dept-desc {
    color: rgba(255, 255, 255, .65);
}

html[data-theme="dark"] .team-card {
    background: rgba(255, 255, 255, .03);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, .12);
}

html[data-theme="dark"] .team-card:hover {
    box-shadow: none;
    border-color: rgba(255, 255, 255, .25);
}

html[data-theme="dark"] .team-card__photo-wrap {
    background: rgba(255, 255, 255, .05);
}

html[data-theme="dark"] .team-card__photo--empty {
    color: rgba(255, 255, 255, .3);
}

html[data-theme="dark"] .team-card__badge {
    background: rgba(26, 26, 37, .85);
    color: var(--wp--preset--color--white);
}

html[data-theme="dark"] .team-card__name {
    color: var(--wp--preset--color--white);
}

html[data-theme="dark"] .team-card__role {
    color: var(--wp--preset--color--yellow, #FFE500);
}

html[data-theme="dark"] .team-card__desc {
    color: rgba(255, 255, 255, .65);
}

html[data-theme="dark"] .team-card__contact {
    border-top-color: rgba(255, 255, 255, .12);
}

html[data-theme="dark"] .team-card__contact-btn {
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .65);
}

html[data-theme="dark"] .team-card__contact-btn:hover {
    background: var(--wp--preset--color--yellow, #FFE500);
    color: var(--wp--preset--color--black, #1A1A25);
}

html[data-theme="dark"] .team-empty {
    color: rgba(255, 255, 255, .65);
}
