.block-team {
    margin-bottom: 80px !important;
}
.block-team .leadership{
    width: 523px;
}
.block-team h3.leadership-subheading{
    font-size: 16px;
    font-weight: 500;
    line-height: 40px;
    margin-bottom: 10px;
    color: #D1FF61;


}
.block-team .leadership-heading {
    font-size: 30px;
    color: #efefef;
    font-weight: bold;
    line-height: 36px;
    letter-spacing: -0.75px;
}
.block-team .leadership-description {
    font-size: 18px;
    line-height: 28px;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Team Grid */
.block-team .team-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 31px;
    margin-top: 60px;
    width: 100%;
    max-width: 100%;
}

.block-team .team-member {
    width: 100%;
    cursor: pointer;
    display: block;
}
.block-team .team-member:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

.block-team .team-member-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    border-radius: 8px;
    margin-bottom: 20px;
    background-size: contain;
    background-position: center bottom;
    background-repeat: no-repeat;
}
.block-team .team-member-image:after{
    content:"";
    background: #6B7280;
    width: 100%;
    height: 80%;
    display: block;
    position: absolute;
    z-index: -1;
    bottom: 0;
    border-radius: 12px;
    opacity: 0.2;
    transition: all 0.5s ease;
    -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
}
.block-team .team-member-image:hover:after{
    background: #d1ff61;
    opacity: 1;
}
.block-team .team-member h4 {
    font-size: 18px;
    color: #fff;
    font-weight: 600;
    line-height: 26px;
    margin-bottom: 4px;
}
.block-team .team-member .role {
    font-size: 16px;
    color: #d1ff61;
    line-height: 24px;
}

/* ---- Modal ---- */
:root {
    --overlay-bg: rgba(15, 18, 24, 0.6);
    --card-bg: rgba(8, 7, 23, 0.97);
    --muted: #D1FF61;
    --radius: 16px;
}

.block-team .modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: none;
    opacity: 0;
    transition: opacity .28s ease;
    z-index: 1000;
}

.block-team .modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 1001;
}

.block-team .modal-card {
    width: min(1000px, 92vw);
    max-height: min(84vh, 800px);
    background: var(--card-bg);
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(15, 18, 24, 0.25);
    transform: scale(.9);
    opacity: 0;
    pointer-events: auto;
    transition: transform .32s cubic-bezier(.2,.7,.2,1), opacity .28s ease;
    transform-origin: var(--origin-x, 50%) var(--origin-y, 50%);
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    position: relative;
    pointer-events: none;
}

.block-team .modal.show .modal-card {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.block-team .modal.show + .modal-overlay {
    display: block;
    opacity: 1;
}
.block-team .modal {
    pointer-events: none;
}
.block-team .modal.show {
    pointer-events: auto;
}

.block-team .modal-media {
    min-height: 320px;
    background-size: contain;
    background-position: center bottom;
    background-repeat: no-repeat;
    position: relative;
    margin-bottom: 20%;
    margin-left: 20%;
}
.block-team .modal-media:after{
    content:"";
    background: #d1ff61;
    width: 100%;
    height: 80%;
    display: block;
    position: absolute;
    z-index: -1;
    bottom: 0;
    border-radius: 6px;
}

.block-team .modal-body {
    padding: 50px;
    overflow: auto;
}
.block-team .modal-body .title {
    font-size: 28px;
    margin: 0 0 6px;
}
.block-team .modal-body .headline {
    color: var(--muted);
    margin: 0 0 18px;
}
.block-team .modal-body .description {
    line-height: 1.6;
    color: #fff;
}

.block-team .modal-body .social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding:5px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #0b1220;
}
.block-team .modal-body .social a svg {
    width: 18px;
    height: 18px;
}
.block-team .modal-body .social a:hover {
    background: #e2e8f0;
}

.block-team .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 0;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(6px);
    border-radius: 50px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 18, 24, 0.18);
}
.block-team .close-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Mobile-only modal adaptations (≤820px) ===== */
@media (max-width: 820px) {
    /* keep leadership width fluid */
    .block-team .leadership{
        width: 100%;
    }

    /* Make modal card stack vertically and use more of the viewport */
    .block-team .modal {
        display: flex;
        align-items: center;            /* center vertically */
        justify-content: start;

    }
    .block-team .modal-card {
        grid-template-columns: 1fr;
        width: 100vw;                    /* near-full width */
        max-width: 720px;
        max-height: 90vh;               /* taller on mobile */
        border-radius: 14px;
    }
    .block-team .modal-media {
        height: 220px;                  /* fixed visual area */
        margin: 0;                      /* remove desktop offsets */
        background-position: center center;
    }
    .block-team .modal-media:after {
        border-radius: 10px;
    }
    .block-team .modal-body {
        padding: 24px;                  /* tighter padding */
    }
    .block-team .close-btn {
        top: 8px;
        right: 8px;
        width: 42px;
        height: 42px;
        z-index: 999;
    }

    /* You originally changed the grid to a column on mobile; leaving it intact. */
    .block-team .team-grid{
        display: flex;
        flex-direction: column;
    }
}

/* Optional helper when body is locked (set via JS) */
body.block-team--modal-open {
    overflow: hidden !important;
    touch-action: none;
}
