.board-directors {
    padding-top: 80px;
}

.staff-members {
    padding: 80px 0;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--al-black);
    padding-bottom: 48px;
}

.team-header h1 {
    margin: 0;
    width: 42.7%;
}

.team-header .slider-arrows {
    display: flex;
    gap: 16px;
}

.team-slider-section .slider-btn {
    padding: 16px;
    border: none;
    cursor: pointer;
}

.board-directors .team-header h1 {
    color: var(--al-lime);
}

.board-directors .slider-btn {
    background-color: #D6DE63;
    /* Light lime (Inactive/Normal) */
    color: var(--al-black);
    opacity: 0.6;
}

.board-directors .slider-btn.is-active {
    background-color: var(--al-lime);
    /* Strong lime (Active) */
    opacity: 1;
}

.staff-members .team-header h1 {
    color: var(--al-pink);
}

.staff-members .slider-btn {
    background-color: #FFB8D9;
    color: var(--al-black);
    opacity: 0.6;
}

.staff-members .slider-btn.is-active {
    background-color: var(--al-pink);
    opacity: 1;
}

.team-grid-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin-top: 48px;
}

.team-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (3 * 3.75%)) / 4);
    gap: 3.75%;
    transition: transform 0.5s ease;
    width: 100%;
}

.member-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.member-image-wrapper {
    position: relative;
    /* Fixed 180x180 */
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
}

.member-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.board-directors .member-overlay {
    background-color: var(--al-lime);
}

.staff-members .member-overlay {
    background-color: var(--al-pink);
}

/* FIX: Hover state now isolated strictly onto image container boundaries */
.member-image-wrapper:hover .member-overlay {
    opacity: 1;
}

.eye-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.mobile-eye-btn {
    display: none;
}

.member-name {
    font-family: var(--font-heading-bold);
    font-size: 32px;
    margin-bottom: 8px;
}

.board-directors .member-name {
    color: var(--al-lime);
}

.staff-members .member-name {
    color: var(--al-pink);
}

.member-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--al-black);
}

.member-years {
    color: var(--al-dark-grey);
}

/* Modal / Popup Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    display: none;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.is-active {
    display: flex;
}

.modal-container {
    background-color: var(--al-white);
    max-width: 1000px;
    width: 100%;
    height: 461px;
    position: relative;
    display: flex;
    animation: modalIn 0.4s ease forwards;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--al-black);
    color: var(--al-white);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
}

.modal-container .modal-close,
.modal-container .modal-close:hover,
.modal-container .modal-close:focus {
    background-color: #121212 !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.modal-image-side {
    width: 40%;
    background-color: #f5f5f5;
}

.modal-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-content-side {
    width: 60%;
    padding: 60px;
    display: flex;
    flex-direction: column;
}

.modal-member-name {
    font-family: var(--font-heading-bold);
    font-size: 48px;
    margin-bottom: 12px;
}

.modal-member-title {
    font-family: var(--font-bold);
    font-size: 20px;
    margin-bottom: 8px;
}

.modal-member-years {
    font-family: var(--font-regular);
    font-size: 16px;
    color: var(--al-dark-grey);
    margin-bottom: 32px;
}

.modal-divider {
    height: 1px;
    background-color: var(--al-lime);
    /* Default */
    margin-bottom: 32px;
    width: 100%;
}

.modal-bio {
    font-family: var(--font-regular);
    font-size: 18px;
    line-height: 1.6;
    color: var(--al-black);
    overflow-y: auto;
    max-height: 300px;
    padding-right: 20px;
}

/* Custom scrollbar for modal bio */
.modal-bio::-webkit-scrollbar {
    width: 4px;
}

.modal-bio::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-bio::-webkit-scrollbar-thumb {
    background: var(--al-dark-grey);
}

@media (max-width: 991.98px) {

    .team-grid {
        grid-auto-columns: calc((100% - (3 * 3%)) / 3.2) !important;
    }

    .supporters-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .supporters-label {
        width: 100%;
    }

}

@media (max-width: 767.98px) {

    /* FIX: Reorders slider sections structurally so elements flow down safely on mobile */
    .team-section {
        display: flex;
        flex-direction: column;
    }

    /* FIX: Changed to display: contents so children (h1 and arrows) can be ordered globally within .team-section */
    .team-header {
        display: contents;
    }

    /* FIX: Title stays at the absolute top */
    .team-section h1 {
        order: 1;
        margin-bottom: 24px;
        width:auto;
    }

    .team-grid-container {
        order: 2;
        margin-top: 0;
        padding-top: 32px;
        border-top: 1px solid var(--al-black);
    }

    /* FIX: Targets header layout to display navigation controls at the absolute bottom */
    .team-section .slider-arrows {
        order: 3;
        /* Forces arrows underneath the content layout flow */
        width: 100%;
        display: flex;
        justify-content: flex-start;
        margin-top: 32px;
        margin-bottom: 0;
    }

    .team-grid {
        grid-auto-columns: calc((100% - (3 * 3%)) / 2.2) !important;
    }

    .member-overlay {
        display: none;
    }

    .mobile-eye-btn {
        display: flex;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        margin: 16px auto 0;
        /* Centers it below the text */
    }

    .board-directors .mobile-eye-btn {
        background-color: var(--al-lime);
    }

    .staff-members .mobile-eye-btn {
        background-color: var(--al-pink);
    }

    .member-card {
        text-align: center;
        /* Matches the centered text/icon in the mobile image */
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 220px;
    }

    .ticket-illustration {
        right: 22px;
    }

    .team-section {
        padding: 60px 0;
    }

    .member-image-wrapper {
        width: 180px;
        height: 180px;
    }

    .member-name {
        font-size: 26px;
    }

    .modal-container {
        flex-direction: column;
        max-height: 90vh;
        height: auto;
        overflow-y: auto;
    }

    .modal-image-side {
        width: 100%;
        height: 300px;
    }

    .modal-content-side {
        width: 100%;
        padding: 30px;
    }

    .modal-member-name {
        font-size: 32px;
    }

}

@media (max-width: 575.98px) {

    .team-grid {
        grid-auto-columns: calc((100% - (3 * 3%)) / 1.5) !important;
    }

}