/* ============================================
   DESIGN D — Combined
   Cards from B (4-col grid), section headers from A
   (label + line), full-screen overlay popup from C
   ============================================ */

/* ---------- SECTIONS WRAPPER ---------- */
.td-sections {
    background: #f4f5f5;
    padding: 0 var(--container-pad);
    padding-bottom: clamp(48px, 7vh, 96px);
}

/* ---------- EACH SECTION ---------- */
.td-section {
    padding-top: clamp(48px, 6vh, 80px);
}

.td-section-inner {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* ---------- SECTION HEADER (Design A style) ---------- */
.td-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: clamp(28px, 3.5vh, 44px);
}

.td-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(1, 12, 51, 0.4);
    white-space: nowrap;
}

.td-section-line {
    flex: 1;
    height: 1px;
    background: rgba(1, 12, 51, 0.08);
}

/* ---------- TEAM GRID (4 columns) ---------- */
.td-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(16px, 2vw, 28px);
}

/* ---------- CARD (Design B style, compact) ---------- */
.td-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(1, 12, 51, 0.07);
    border-radius: 14px;
    overflow: hidden;
    padding: 0;
    text-align: left;
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo), border-color 0.25s;
}

.td-card-clickable {
    cursor: pointer;
}

.td-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(1, 12, 51, 0.1);
    border-color: rgba(6, 196, 162, 0.3);
}

.td-card-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f1f3;
}

.td-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ease-out-expo);
}

.td-card:hover .td-card-photo {
    transform: scale(1.04);
}

.td-card-info {
    padding: 13px 14px 12px;
}

.td-card-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-card-linkedin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(1, 12, 51, 0.2);
    transition: color 0.2s;
}

.td-card-linkedin:hover {
    color: #0a66c2;
}

.td-card-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #010c33;
    letter-spacing: -0.02em;
    margin: 0;
}

.td-card-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.45);
    margin: 3px 0 0;
}

/* ---------- COMING SOON ---------- */
.td-coming-soon {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.3);
    font-style: italic;
}

/* ---------- FULL-SCREEN OVERLAY (Design C style) ---------- */
.td-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 10, 31, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: visible;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.td-overlay--active {
    opacity: 1;
    pointer-events: auto;
}

.td-overlay--has-logos .td-overlay-inner {
    max-height: 75vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.td-overlay--has-logos .td-overlay-inner::-webkit-scrollbar {
    display: none;
}

.td-overlay-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.td-overlay-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.td-overlay-inner {
    display: flex;
    gap: clamp(32px, 4vw, 64px);
    align-items: start;
    max-width: 900px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.4s var(--ease-out-expo);
}

.td-overlay--active .td-overlay-inner {
    transform: translateY(0);
}

.td-overlay-photo-wrap {
    flex-shrink: 0;
    width: clamp(220px, 30vw, 340px);
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
}

.td-overlay-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.td-overlay-content {
    flex: 1;
    min-width: 0;
}

.td-overlay-name {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin: 0;
}

.td-overlay-title {
    font-size: 1rem;
    font-weight: 600;
    color: #06c4a2;
    margin: 6px 0 0;
}

.td-overlay-location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
}

.td-overlay-location svg {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.3);
}

.td-overlay-divider {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 24px 0;
}

.td-overlay-bio {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.75;
    color: #ffffff;
    margin: 0;
    white-space: pre-line;
}

.td-overlay-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 28px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.td-overlay-linkedin:hover {
    color: #ffffff;
    border-color: #06c4a2;
    background: rgba(6, 196, 162, 0.1);
}

/* ---------- PORTFOLIO LOGO PILLS ---------- */
.td-overlay-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.td-overlay-logos:empty {
    display: none;
}

.td-overlay-logo-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, background 0.2s;
}

.td-overlay-logo-pill:hover {
    border-color: rgba(6, 196, 162, 0.3);
    background: rgba(6, 196, 162, 0.05);
}

.td-overlay-logo-pill img {
    height: 16px;
    width: auto;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.td-overlay-logo-pill:hover img {
    opacity: 0.9;
}

/* ---------- ADVISOR PLACEHOLDER ---------- */
.td-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(1, 12, 51, 0.12);
}

.td-card--static:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(1, 12, 51, 0.07);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .td-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .td-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Section headers: add line before label so label is centered between two lines */
    .td-section-header::before {
        content: '';
        flex: 1;
        height: 1px;
        background: rgba(1, 12, 51, 0.08);
    }

    /* Overlay: full-screen scrollable from top on mobile */
    .td-overlay {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Popup: left-align all content, add padding for scroll */
    .td-overlay-inner {
        flex-direction: column;
        text-align: left;
        align-items: flex-start;
        padding-top: 60px;
        padding-bottom: 40px;
    }

    /* Close button fixed to viewport on mobile */
    .td-overlay-close {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 2001;
    }

    .td-overlay-location {
        justify-content: flex-start;
    }

    .td-overlay-photo-wrap {
        width: clamp(180px, 50vw, 260px);
    }

    /* Remove max-height constraint on mobile — overlay itself scrolls */
    .td-overlay--has-logos .td-overlay-inner {
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 480px) {
    /* Center the single-column card grid */
    .td-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
}
