/* ==========================================================================
   Team page (team.php) — builds on home.css + about.css
   ========================================================================== */

.tm-hero { min-height: 62vh; }

.tm-kicker {
    display: block;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--brand);
}
.tm-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
}

/* ---------- Leadership ---------- */
.tm-lead { padding: 4rem 0 2rem; background: #fff; }
.tm-lead-card {
    display: grid;
    grid-template-columns: 320px 1fr;
    align-items: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid #ece4da;
    border-radius: 24px;
    background: linear-gradient(135deg, #fff 0%, #fffaf4 100%);
}
.tm-lead-photo {
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    overflow: hidden;
    background: #eadfd2;
}
.tm-lead-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.tm-lead-body h2 {
    margin: .4rem 0 .2rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 700;
    color: var(--ink);
}
.tm-lead-role { color: #888; font-weight: 600; margin-bottom: 1.4rem; }
.tm-lead-body blockquote {
    margin: 0 0 1.6rem;
    padding-left: 1.2rem;
    border-left: 3px solid var(--brand);
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.12rem;
    line-height: 1.75;
    color: #4a4239;
}
.tm-lead-contact { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; }
.tm-lead-contact a { color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none; }
.tm-lead-contact a i { color: var(--brand); margin-right: .45rem; }
.tm-lead-contact a:hover { color: var(--brand-deep); }

/* ---------- Team grid ---------- */
.tm-team {
    position: relative;
    padding: 5.5rem 0 6.5rem;
    background:
        radial-gradient(circle at 50% 0%, rgba(247, 151, 63, .08), transparent 50%),
        #fff;
}
.tm-head { max-width: 640px; margin: 0 auto 3.2rem; text-align: center; }
.tm-head .about-label { justify-content: center; }
.tm-head p { margin: 0; color: #6b6b6b; line-height: 1.7; }
.tm-head-line { display: flex; align-items: center; justify-content: center; gap: .7rem; margin: 1.1rem 0; }
.tm-head-line span { width: 54px; height: 1px; background: linear-gradient(90deg, transparent, var(--brand)); }
.tm-head-line span:last-child { background: linear-gradient(90deg, var(--brand), transparent); }
.tm-head-line i { width: 8px; height: 8px; background: var(--brand); transform: rotate(45deg); }

/* Centred grid: looks right with 1 member or 20 */
.tm-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}
.tm-card { position: relative; flex: 0 1 280px; }
.tm-card-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    color: inherit;
    border-radius: 22px;
}
.tm-card-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.tm-photo {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(160deg, #f6ede2, #eadfd2);
    box-shadow: 0 22px 50px rgba(60, 40, 10, .14);
    transition: box-shadow .5s, translate .5s var(--ease-out);
}
.tm-card-btn:hover .tm-photo,
.tm-card-btn:focus-visible .tm-photo { translate: 0 -8px; box-shadow: 0 32px 60px rgba(247, 151, 63, .25); }
.tm-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 1s var(--ease-out);
}
.tm-card-btn:hover .tm-photo img,
.tm-card-btn:focus-visible .tm-photo img { transform: scale(1.06); }
.tm-initials {
    position: absolute;
    inset: 0 0 30% 0;
    display: grid;
    place-items: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--brand-deep);
}

/* Name plate over the photo; the bio slides in on hover */
.tm-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4rem 1.4rem 1.3rem;
    color: #fff;
    background: linear-gradient(0deg, rgba(20, 15, 8, .88) 0%, rgba(20, 15, 8, .55) 55%, transparent 100%);
}
.tm-role {
    display: inline-block;
    margin-bottom: .45rem;
    padding: .22rem .65rem;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
    background: var(--brand);
}
.tm-overlay h3 { margin: 0; font-size: 1.25rem; font-weight: 800; color: #fff; }
.tm-bio,
.tm-more {
    display: block;
    max-height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .5s var(--ease-out), opacity .4s ease, margin .4s ease;
}
.tm-bio { font-size: .86rem; line-height: 1.55; color: rgba(255, 255, 255, .82); }
.tm-more { font-size: .82rem; font-weight: 700; color: #ffc46b; }
.tm-more i { transition: transform .35s var(--ease-out); display: inline-block; }
.tm-card-btn:hover .tm-bio,
.tm-card-btn:focus-visible .tm-bio { max-height: 6rem; opacity: 1; margin-top: .6rem; }
.tm-card-btn:hover .tm-more,
.tm-card-btn:focus-visible .tm-more { max-height: 2rem; opacity: 1; margin-top: .7rem; }
.tm-card-btn:hover .tm-more i { transform: translateX(4px); }
@media (hover: none) {
    .tm-more { max-height: 2rem; opacity: 1; margin-top: .6rem; }
}

.tm-social { position: absolute; top: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.tm-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .9rem;
    color: var(--ink);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    text-decoration: none;
    transition: background-color .3s, color .3s;
}
.tm-social a:hover { background: var(--brand); color: #fff; }
.tm-empty { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 3rem 1rem; color: #888; text-align: center; }
.tm-empty i { font-size: 1.6rem; color: var(--brand); }

/* ---------- Departments ---------- */
.tm-depts { padding: 6rem 0; background: linear-gradient(180deg, #fffaf4 0%, #fff4e8 100%); }
.tm-dept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #ece4da;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
}
.tm-dept {
    display: flex;
    gap: 1rem;
    padding: 1.8rem;
    border-right: 1px solid #ece4da;
    border-bottom: 1px solid #ece4da;
    transition: background-color .3s;
}
.tm-dept:nth-child(3n) { border-right: 0; }
.tm-dept:nth-last-child(-n + 3) { border-bottom: 0; }
.tm-dept:hover { background: #fffaf4; }
.tm-dept > i {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    color: var(--brand);
    background: #fff4e8;
}
.tm-dept h3 { margin: .1rem 0 .3rem; font-size: 1.02rem; font-weight: 800; color: var(--ink); }
.tm-dept p { margin: 0; font-size: .88rem; line-height: 1.6; color: #6b6b6b; }

/* ---------- Join ---------- */
.tm-join { padding: 0 0 6rem; background: #fff4e8; }
.tm-join-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem 3rem;
    padding: 2.4rem 2.8rem;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(150deg, #2b351f, #1b1f17);
}
.tm-join-card h2 { margin: 0 0 .4rem; font-size: 1.6rem; font-weight: 800; color: #fff; }
.tm-join-card p { margin: 0; max-width: 560px; color: rgba(255, 255, 255, .72); }
.tm-join-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .8rem 1.6rem;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s;
}
.tm-join-btn:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Profile popup ---------- */
.tm-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 18, 12, .6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s ease;
}
.tm-modal[hidden] { display: none; }
.tm-modal.open { opacity: 1; }
.tm-modal-card {
    position: relative;
    width: min(760px, 100%);
    max-height: 90vh;
    overflow: auto;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
    transform: translateY(16px);
    transition: transform .35s var(--ease-out);
}
.tm-modal.open .tm-modal-card { transform: none; }
.tm-modal-content { display: grid; grid-template-columns: 260px 1fr; }
.tm-modal-photo { position: relative; min-height: 320px; background: linear-gradient(160deg, #f6ede2, #eadfd2); }
.tm-modal-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.tm-modal-body { padding: 2.2rem 2rem; }
.tm-modal-body h3 { margin: .4rem 0 1rem; font-family: 'Playfair Display', Georgia, serif; font-size: 1.8rem; font-weight: 700; color: var(--ink); }
.tm-modal-body p { color: #555; line-height: 1.75; }
.tm-modal-social { display: flex; gap: .6rem; margin-top: 1.2rem; }
.tm-modal-social a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border: 1px solid #ece4da;
    border-radius: 8px;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}
.tm-modal-social a:hover { border-color: var(--brand); color: var(--brand-deep); }
.tm-modal-close {
    position: absolute;
    top: .9rem;
    right: .9rem;
    z-index: 1;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.tm-modal-close:hover { background: var(--brand); color: #fff; }

@media (max-width: 991.98px) {
    .tm-lead-card { grid-template-columns: 240px 1fr; gap: 2rem; }
    .tm-dept-grid { grid-template-columns: 1fr 1fr; }
    .tm-dept:nth-child(3n) { border-right: 1px solid #ece4da; }
    .tm-dept:nth-child(2n) { border-right: 0; }
    .tm-dept:nth-last-child(-n + 3) { border-bottom: 1px solid #ece4da; }
    .tm-dept:nth-last-child(-n + 2) { border-bottom: 0; }
}
@media (max-width: 767.98px) {
    .tm-lead-card { grid-template-columns: 1fr; padding: 1.4rem; }
    .tm-lead-photo { max-width: 280px; }
    .tm-dept-grid { grid-template-columns: 1fr; }
    .tm-dept, .tm-dept:nth-child(n) { border-right: 0; border-bottom: 1px solid #ece4da; }
    .tm-dept:last-child { border-bottom: 0; }
    .tm-modal-content { grid-template-columns: 1fr; }
    .tm-modal-photo { min-height: 260px; }
    .tm-join-card { padding: 1.8rem; }
}
@media (max-width: 575.98px) {
    .tm-grid { gap: 1.4rem; }
    .tm-card { flex-basis: 100%; max-width: 320px; }
}
