/*
 * VSL PROFESSIONAL TEAM PROFILE SCROLL FIX
 *
 * Keeps the portrait panel stable while allowing the profile information
 * panel to scroll independently on short desktop and laptop screens.
 */

.popup[data-popup="team-profile"] {
    overflow: hidden !important;
    overscroll-behavior: contain !important;
}

.popup[data-popup="team-profile"] > .vsl-team-profile-card {
    height: min(88dvh, 760px) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 28px) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
}

.vsl-team-profile-card > .vsl-team-profile-visual,
.vsl-team-profile-card > .vsl-team-profile-content {
    min-height: 0 !important;
    height: 100% !important;
}

.vsl-team-profile-visual {
    min-height: 0 !important;
}

.vsl-team-profile-content {
    position: relative !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 28px !important;
}

.vsl-team-profile-content::-webkit-scrollbar {
    width: 9px !important;
}

.vsl-team-profile-content::-webkit-scrollbar-track {
    margin-block: 14px !important;
    border-radius: 999px !important;
    background: rgba(49, 69, 154, 0.055) !important;
}

.vsl-team-profile-content::-webkit-scrollbar-thumb {
    min-height: 48px !important;
    border: 2px solid transparent !important;
    border-radius: 999px !important;
    background:
        linear-gradient(
            180deg,
            #31459a,
            #1db9c2
        ) padding-box !important;
}

.vsl-team-profile-content {
    scrollbar-width: thin !important;
    scrollbar-color:
        #1aa9bd
        rgba(49, 69, 154, 0.055) !important;
}

/* Keep the contact actions clear and professional when reached. */
.vsl-team-profile-actions {
    flex: 0 0 auto !important;
    margin-top: 24px !important;
    padding-top: 18px !important;
    padding-bottom: 4px !important;
    border-top: 1px solid rgba(49, 69, 154, 0.08) !important;
    background:
        linear-gradient(
            180deg,
            rgba(247, 251, 255, 0),
            rgba(247, 251, 255, 0.94) 28%,
            rgba(247, 251, 255, 1) 100%
        ) !important;
}

.vsl-team-profile-action {
    flex: 1 1 135px !important;
}

.vsl-team-profile-action--support {
    flex: 1.2 1 170px !important;
}

.vsl-team-profile-footer {
    flex: 0 0 auto !important;
}

/* Make keyboard scrolling clear and accessible. */
.vsl-team-profile-content:focus-visible {
    outline: 2px solid rgba(29, 185, 194, 0.52) !important;
    outline-offset: -4px !important;
}

/* Dark mode scroll surface. */
html[data-theme="dark"] .vsl-team-profile-actions {
    border-top-color: rgba(120, 220, 230, 0.10) !important;
    background:
        linear-gradient(
            180deg,
            rgba(10, 21, 39, 0),
            rgba(10, 21, 39, 0.94) 28%,
            rgba(10, 21, 39, 1) 100%
        ) !important;
}

/* Short laptop screens: compress vertical spacing without shrinking text. */
@media (min-width: 761px) and (max-height: 820px) {
    .popup[data-popup="team-profile"] {
        padding: 14px !important;
    }

    .popup[data-popup="team-profile"] > .vsl-team-profile-card {
        height: calc(100dvh - 28px) !important;
        max-height: calc(100dvh - 28px) !important;
    }

    .vsl-team-profile-content {
        padding:
            44px
            42px
            22px !important;
    }

    .vsl-team-profile-header h2 {
        margin-top: 14px !important;
        font-size: clamp(34px, 4vw, 50px) !important;
    }

    .vsl-team-profile-status {
        margin-top: 18px !important;
    }

    .vsl-team-profile-responsibility {
        margin-top: 20px !important;
        padding: 19px 21px !important;
    }

    .vsl-team-profile-contact {
        margin-top: 18px !important;
    }

    .vsl-team-profile-actions {
        margin-top: 18px !important;
        padding-top: 15px !important;
    }

    .vsl-team-profile-footer {
        margin-top: 17px !important;
    }
}

/* Mobile uses one natural scrolling document inside the popup wrapper. */
@media (max-width: 760px) {
    .popup[data-popup="team-profile"] {
        align-items: start !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 10px !important;
    }

    .popup[data-popup="team-profile"] > .vsl-team-profile-card {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        grid-template-rows: none !important;
        overflow: visible !important;
    }

    .vsl-team-profile-card > .vsl-team-profile-visual,
    .vsl-team-profile-card > .vsl-team-profile-content {
        height: auto !important;
    }

    .vsl-team-profile-visual {
        min-height: 360px !important;
    }

    .vsl-team-profile-content {
        height: auto !important;
        overflow: visible !important;
        scrollbar-gutter: auto !important;
    }

    .vsl-team-profile-actions {
        display: grid !important;
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
        background: transparent !important;
    }

    .vsl-team-profile-action {
        width: 100% !important;
    }

    .vsl-team-profile-action--support {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 420px) {
    .vsl-team-profile-visual {
        min-height: 320px !important;
    }

    .vsl-team-profile-actions {
        grid-template-columns: 1fr !important;
    }

    .vsl-team-profile-action--support {
        grid-column: auto !important;
    }
}
