/* ===========================================================
   [our_team] shortcode styles   ->  /assets/team/team.css
   =========================================================== */
.team-page {
    --tm-blue: var(--primary-color, #2326bf);
    --tm-orange: #c46428;
    --tm-ink: #1c1d3a;
    --tm-text: #5a5d73;
}

.team-page *,
.team-page *::before,
.team-page *::after {
    box-sizing: border-box;
}

/* ---------- Layout ---------- */
.team-sc-leaders {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 6 - 6 */
    gap: 24px;
}

.team-sc-grid {
    display: grid;
    grid-template-columns: repeat(var(--team-cols, 3), minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 991.98px) {
    .team-sc-leaders { grid-template-columns: 1fr; }
    .team-sc-grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .team-sc-grid { grid-template-columns: 1fr; }
}

/* ---------- Sections ---------- */
.team-section {
    padding: 40px 0;
}

.team-section-grid {
    padding-bottom: 80px;
}

.team-section-head {
    margin-bottom: 24px;
    text-align: left;
}

.team-section-head h2 {
    position: relative;
    margin: 0;
    padding-bottom: 14px;
    color: var(--tm-ink);
    font-size: 1.6rem;
}

.team-section-head h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 3px;
    border-radius: 3px;
    background: var(--tm-orange);
}

/* ---------- Filter chips ---------- */
.team-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.team-page .team-chip {
    padding: 8px 18px;
    border: 1px solid #d9dbf2;
    border-radius: 999px;
    background: #fff;
    color: var(--tm-blue);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.team-page .team-chip:hover,
.team-page .team-chip.active {
    border-color: var(--tm-blue);
    background: var(--tm-blue);
    color: #fff;
}

.team-item.is-hidden {
    display: none;
}

/* ---------- Card ---------- */
.team-page .team-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(35, 38, 191, 0.08);
    text-align: left;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.team-page .team-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(35, 38, 191, 0.16);
}

.team-photo {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #e9ebf8;
}

.team-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: grayscale(1);
}

.team-card:hover .team-photo img {
    transform: scale(1.05);
}

/* Social buttons over the photo */
.team-social {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 36px 14px 14px;
    background: linear-gradient(0deg, rgba(35, 38, 191, 0.85), rgba(35, 38, 191, 0));
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.team-card:hover .team-social,
.team-card:focus-within .team-social {
    opacity: 1;
    transform: none;
}

@media (hover: none) {
    .team-social {
        opacity: 1;
        transform: none;
    }
}

.team-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: var(--tm-blue);
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.team-social a:hover {
    background: var(--tm-orange);
    color: #fff;
}

/* ---------- Card text (same sizes on every card) ---------- */
.team-body {
    position: relative;
    flex: 1;
    padding: 20px 22px 22px;
}

.team-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22px;
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--tm-orange);
    transition: width 0.3s ease;
}

.team-card:hover .team-body::before {
    width: 46px;
}

/* !important only where the theme's heading styles would otherwise win */
.team-page .team-card .team-name {
    display: -webkit-box;
    margin: 0 0 4px !important;
    overflow: hidden;
    color: var(--tm-ink);
    font-size: 1.1rem !important;
    font-weight: 700;
    line-height: 1.3 !important;
    text-align: left;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.team-page .team-card .team-role {
    display: block;
    margin: 0;
    color: var(--tm-orange);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
}

.team-page .team-card .team-bio {
    display: -webkit-box;
    margin: 12px 0 0;
    overflow: hidden;
    color: var(--tm-text);
    font-size: 0.92rem;
    line-height: 1.65;
    text-align: left;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.team-page .team-card .team-bio p {
    margin: 0 0 0.6em;
    font-size: inherit;
    line-height: inherit;
}

.team-page .team-card .team-bio p:last-child {
    margin-bottom: 0;
}

/* Read more: full text */
.team-page .team-card .team-bio.is-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.team-page .team-more {
    display: inline-block;
    margin: 10px 0 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--tm-orange);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
}

.team-page .team-more:hover,
.team-page .team-more:focus-visible {
    color: #a9531f;
    text-decoration: underline;
}

.team-page .team-more[hidden] {
    display: none;
}

/* ---------- Leadership (large, horizontal card) ---------- */
.team-page .team-leader {
    flex-direction: row;
}

/* Photo keeps its own fixed size: it never grows or shrinks with the text */
.team-leader .team-photo {
    flex: 0 0 40%;
    align-self: flex-start;
    aspect-ratio: 4 / 5;
}

/* One leader: full-width card, photo left / content right */
.team-sc-leaders.is-single {
    grid-template-columns: 1fr;
}

.team-sc-leaders.is-single .team-leader .team-photo {
    flex-basis: 300px;
}

.team-sc-leaders.is-single .team-leader .team-bio {
    -webkit-line-clamp: 8;
}

@media (max-width: 991.98px) {
    .team-leader .team-photo {
        flex-basis: 300px;
    }
}

.team-leader .team-body {
    align-self: center;
    padding: 28px;
}

.team-leader .team-body::before {
    left: 28px;
}

.team-page .team-leader .team-name {
    font-size: 1.3rem !important;
}

.team-page .team-leader .team-bio {
    font-size: 0.95rem;
    -webkit-line-clamp: 6;
}

@media (max-width: 575.98px) {
    .team-page .team-leader {
        flex-direction: column;
    }

    .team-leader .team-photo,
    .team-sc-leaders.is-single .team-leader .team-photo {
        flex: none;
        align-self: stretch;
        aspect-ratio: 4 / 3;
    }
}