/* ============================================================================
   COHEN & ASSOCIATES — teams.css  (Team page · composed premium)
   ----------------------------------------------------------------------------
   Loads AFTER style.css and reuses its :root tokens + shared .section-head.
   Matches the redesigned Services look: clean sans type, soft-depth people
   cards, warm color blocking, calm motion (reveals + counters from main.js).

   The bio modal is populated + controlled by js/teams.js.
   (Back-to-top styling now lives in style.css, so it's not repeated here.)

   CONTENTS
     01. HERO
     02. SECTION BACKGROUNDS
     03. TEAM GRID + CARDS
     04. BIO MODAL
     05. RESPONSIVE
     06. MOTION SAFETY
============================================================================ */


/* ============================================================================
   01. HERO
============================================================================ */
.tm-hero {
    position: relative;
    padding-top: calc(var(--header-h) + clamp(2.5rem, 6vw, 4rem));
    padding-bottom: clamp(2.5rem, 6vw, 4rem);
    background: linear-gradient(180deg, var(--paper) 0%, var(--cream) 75%);
    overflow: hidden;
    isolation: isolate;
    text-align: center;
}
.tm-hero__glow {
    position: absolute;
    z-index: -1;
    width: 560px; height: 560px;
    top: -200px; left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(170, 86, 52, 0.14), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
}
.tm-hero__inner { max-width: 760px; margin-inline: auto; }
.tm-hero .eyebrow { justify-content: center; }
.tm-hero__title {
    font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.2rem);
    line-height: 1.06;
    margin: 1rem 0 1.25rem;
}
.tm-hero__sub {
    font-size: var(--fs-lead);
    line-height: 1.6;
    color: var(--g-600);
    max-width: 54ch;
    margin: 0 auto 2.5rem;
}

/* Stat strip */
.tm-hero__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.tm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem clamp(1.25rem, 3vw, 2.5rem);
}
.tm-stat + .tm-stat { border-left: 1px solid var(--g-200); }
.tm-stat__num {
    font-size: clamp(2rem, 1.5rem + 1.6vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--navy);
}
.tm-stat__label {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--g-500);
}


/* ============================================================================
   02. SECTION BACKGROUNDS
============================================================================ */
.tm-leaders { padding: var(--section-py) 0; background: var(--paper); }
.tm-team { padding: var(--section-py) 0; background: var(--cream); }


/* ============================================================================
   03. TEAM GRID + CARDS
============================================================================ */
.tm-grid { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.tm-grid--lead {
    grid-template-columns: repeat(2, 1fr);
    max-width: 880px;
    margin-inline: auto;
}
.tm-grid--core { grid-template-columns: repeat(3, 1fr); }

/* Card shell */
.tm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--g-200);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-sm);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.tm-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sh-lg);
    border-color: rgba(170, 86, 52, 0.25);
}

/* Photo (navy gradient shows through if an image is missing) */
.tm-card__photo {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--grad-navy);
}
.tm-card__photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}
.tm-card:hover .tm-card__photo img { transform: scale(1.05); }

/* Body */
.tm-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: clamp(1.25rem, 2.4vw, 1.75rem);
}
.tm-card__name { font-size: 1.25rem; color: var(--navy); margin-bottom: 0.25rem; }
.tm-card__role {
    display: inline-block;
    margin-bottom: 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--copper);
}
.tm-card__bio { font-size: 0.95rem; line-height: 1.6; color: var(--g-600); }

/* Actions row: "View full bio" + optional LinkedIn */
.tm-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
}
.tm-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--copper);
    transition: color var(--t-base);
}
.tm-card__more i { font-size: 0.85em; transition: transform var(--t-base); }
.tm-card__more:hover { color: var(--copper-dark); }
.tm-card__more:hover i { transform: translateX(4px); }

.tm-card__social {
    display: inline-grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(26, 35, 126, 0.06);
    color: var(--navy);
    font-size: 0.95rem;
    transition: background var(--t-base), color var(--t-base), transform var(--t-base);
}
.tm-card__social:hover {
    background: var(--grad-copper);
    color: #fff;
    transform: translateY(-2px);
}

/* Leadership cards — larger, horizontal on desktop */
.tm-card--lead {
    flex-direction: row;
    align-items: stretch;
    min-height: 320px;
    box-shadow: var(--sh-md);
}
.tm-card--lead .tm-card__photo {
    flex: 0 0 42%;
    aspect-ratio: auto;
}
.tm-card--lead .tm-card__body {
    justify-content: center;
    padding: clamp(1.5rem, 3vw, 2.25rem);
}
.tm-card--lead .tm-card__name { font-size: 1.5rem; }
.tm-card--lead .tm-card__bio { font-size: 1rem; }


/* ============================================================================
   04. BIO MODAL
============================================================================ */
.tm-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.tm-modal.is-open { opacity: 1; visibility: visible; }

.tm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 51, 0.55);
    -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
}

.tm-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 860px;
    max-height: 88vh;
    background: var(--paper);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--sh-xl);
    transform: translateY(24px) scale(0.98);
    transition: transform 0.45s var(--ease);
}
.tm-modal.is-open .tm-modal__dialog { transform: none; }

/* Media */
.tm-modal__media {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
    background: var(--grad-navy);
}
.tm-modal__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Body (scrolls if the bio is long) */
.tm-modal__body {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: clamp(1.75rem, 3.5vw, 2.75rem);
}
.tm-modal__role {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--copper);
}
.tm-modal__name {
    font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
    line-height: 1.12;
    color: var(--navy);
    margin-bottom: 1.25rem;
}
.tm-modal__bio p {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--g-700);
    margin-bottom: 1rem;
}
.tm-modal__bio p:last-child { margin-bottom: 0; }

.tm-modal__link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.75rem;
    padding: 0.7rem 1.3rem;
    border-radius: var(--r-full);
    background: var(--grad-copper);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--sh-copper);
    transition: transform var(--t-base), box-shadow var(--t-base);
}
.tm-modal__link:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(170, 86, 52, 0.42); }

/* Close button — frosted circle, reads on photo or white */
.tm-modal__close {
    position: absolute;
    top: 1rem; right: 1rem;
    z-index: 2;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--navy);
    font-size: 1.1rem;
    box-shadow: var(--sh-md);
    transition: background var(--t-base), color var(--t-base), transform var(--t-base);
}
.tm-modal__close:hover { background: var(--copper); color: #fff; transform: rotate(90deg); }


/* ============================================================================
   05. RESPONSIVE
============================================================================ */
@media (max-width: 860px) {
    .tm-grid--core { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .tm-grid--lead { grid-template-columns: 1fr; max-width: 520px; }
}

@media (max-width: 680px) {
    /* Modal stacks: photo banner on top, scrollable bio below */
    .tm-modal__dialog { flex-direction: column; max-height: 90vh; }
    .tm-modal__media { flex: none; height: 220px; }
}

@media (max-width: 560px) {
    .tm-grid--core { grid-template-columns: 1fr; max-width: 380px; margin-inline: auto; }

    /* Leadership cards stack like the rest */
    .tm-card--lead { flex-direction: column; min-height: 0; }
    .tm-card--lead .tm-card__photo { flex: none; aspect-ratio: 4 / 5; }
    .tm-card--lead .tm-card__body { justify-content: flex-start; }
}

@media (max-width: 380px) {
    .tm-stat { padding-inline: 0.9rem; }
}


/* ============================================================================
   06. MOTION SAFETY
============================================================================ */
@media (prefers-reduced-motion: reduce) {
    .tm-card,
    .tm-card:hover,
    .tm-card__social,
    .tm-card__social:hover { transform: none !important; }
    .tm-card:hover .tm-card__photo img { transform: none !important; }
    .tm-card__more:hover i { transform: none !important; }
    .tm-modal__dialog { transform: none !important; }
    .tm-modal__close:hover { transform: none !important; }
}
