/* ============================================================
   Team Hover Expand Widget — team-hover.css
   ============================================================ */

/* ── Wrapper ── */
.thw-section {
    background-color: #0a1f4e;
    padding: 60px 40px;
    box-sizing: border-box;
    font-family: inherit;
}

/* ── Header ── */
.thw-header {
    text-align: center;
    margin-bottom: 48px;
}

.thw-section-title {
    color: #ffffff;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.2;
}

.thw-section-subtitle {
    color: #c8d0e0;
    font-size: 1rem;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Body row ── */
.thw-body {
    display: flex;
    align-items: stretch;   /* bio col stretches to images height */
    gap: 20px;
}

/* ── Images column ── */
.thw-images-col {
    flex: 0 0 55%;
    min-width: 0;
}

/* This is the actual flex row of photos — height is the single source of truth */
.thw-images-inner {
    display: flex;
    align-items: stretch;   /* all items fill the same height */
    height: 380px;          /* controlled by Elementor slider via inline style */
    gap: 8px;
}

/* ── Each member image item ── */
.thw-member-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-width: 0;
    height: 100%;            /* completes the chain: images-inner → item → img-wrap */
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wrap fills full height of its parent item — no fixed px here */
.thw-member-img-wrap {
    width: 100%;
    height: 100%;           /* ← key fix: always matches sibling images */
    overflow: hidden;
    border-radius: 4px;
    position: relative;
    background-color: #1c2e5a;
}

.thw-member-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    user-select: none;
}

.thw-member-item:hover .thw-member-img-wrap img,
.thw-member-item.thw-active .thw-member-img-wrap img {
    transform: scale(1.03);
}

/* Dim overlay on inactive images */
.thw-member-item:not(.thw-active) .thw-member-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 31, 78, 0.3);
    pointer-events: none;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.thw-member-item.thw-active .thw-member-img-wrap::after {
    opacity: 0;
}

/* Placeholder for missing images */
.thw-placeholder-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1c2e5a 0%, #2d4580 100%);
}

/* ── Bio panel column ── */
.thw-bio-col {
    flex: 0 0 45%;
    min-width: 0;
    position: relative;
    /* Matches the images height via align-items: stretch on .thw-body */
}

/* Container that fills the full bio col height */
.thw-bio-stack {
    position: relative;
    height: 100%;
}

/* Each bio entry — all absolutely stacked, only active visible */
.thw-bio-entry {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition:
        opacity 0.38s ease,
        transform 0.38s ease;
}

.thw-bio-entry.thw-bio-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Bio panel card — fills full height of its entry slot */
.thw-bio-panel {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 32px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;       /* scroll if bio text overflows the height */
}

.thw-bio-heading {
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    font-weight: 700;
    color: #0a1f4e;
    margin: 0 0 20px;
    line-height: 1.2;
    flex-shrink: 0;
}

.thw-bio-body {
    color: #444444;
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
    min-height: 0;
}

.thw-bio-body p {
    margin: 0 0 14px;
}

.thw-bio-body p:last-child {
    margin-bottom: 0;
}

.thw-bio-link {
    display: inline-block;
    margin-top: 20px;
    color: #0a1f4e;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border-bottom: 2px solid currentColor;
    padding-bottom: 2px;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.thw-bio-link:hover {
    opacity: 0.7;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 1024px)
   ════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .thw-section {
        padding: 48px 24px;
    }

    .thw-body {
        gap: 16px;
    }

    .thw-images-inner {
        height: 320px;
    }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 767px)
   Tap a photo → it expands + bio slides in below
   ════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .thw-section {
        padding: 36px 16px;
    }

    /* Stack images on top, bio below */
    .thw-body {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .thw-images-col,
    .thw-bio-col {
        flex: none !important;
        width: 100%;
    }

    /* Images row: fixed compact height, equal widths by default */
    .thw-images-inner {
        height: 220px;
        gap: 6px;
    }

    /* All items equal on mobile — active gets slightly more */
    .thw-member-item {
        flex: 1 1 0% !important;
        transition: flex 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .thw-member-item.thw-active {
        flex: 1.6 1 0% !important;
    }

    /* Bio col: auto height, no relative positioning trick needed */
    .thw-bio-col {
        position: static;
    }

    .thw-bio-stack {
        position: static;
        height: auto;
    }

    /* All entries hidden by default */
    .thw-bio-entry {
        position: static;
        inset: auto;
        display: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        transition: none;
    }

    /* Only active entry visible */
    .thw-bio-entry.thw-bio-active {
        display: block;
        opacity: 1;
        transform: none;
        animation: thwSlidein 0.35s ease forwards;
    }

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

    /* Bio panel: auto height, no overflow scroll */
    .thw-bio-panel {
        height: auto;
        overflow-y: visible;
        padding: 24px 20px;
    }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Small Mobile (≤ 479px)
   ════════════════════════════════════════════════ */
@media (max-width: 479px) {
    .thw-section {
        padding: 28px 14px;
    }

    .thw-images-inner {
        height: 180px;
        gap: 4px;
    }

    .thw-bio-panel {
        padding: 20px 16px;
    }

    .thw-bio-heading {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }

    .thw-bio-body {
        font-size: 0.85rem;
    }
}
