/* Team Page Styles */

/****************************
STICKY FOOTER LAYOUT
*****************************/

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.page-team {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
    margin-top: auto;
}

/****************************
TEAM HERO SECTION
*****************************/

.page-team {
    position: relative;
}

.team-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    background-color: #1b3f95;
    height: 500px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Diagonal divider overlays the MAP itself */
.team-hero__map {
    flex: 0 0 800px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    height: 100%;
    width: 800px;
    padding: 0;
}

.team-hero__map::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100px;
    height: 100.5%;
    background: #1b3f95;
    clip-path: polygon(0 0, 0% 100%, 100% 0);
    z-index: 2;
    pointer-events: none;
}

.team-hero__map svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: right center;
    z-index: 1;
}

/* Left Content */
.team-hero__content {
    color: #fff;
    z-index: 3;
    padding: 60px 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 90%;
    max-width: none;
    flex: 1;
}

.team-hero__title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
    color: #fff;
}

.team-hero__description {
    font-size: 1.5em;
    line-height: 1.6;
    margin: 0;
    color: #FFFFFF;
    width: 80%;
}

/****************************
RESPONSIVE DESIGN (HERO)
*****************************/

@media only screen and (max-width: 1024px) {
    .team-hero {
        height: 450px;
    }

    .team-hero__content {
        padding: 50px;
        width: 90%;
    }

    .team-hero__title {
        font-size: 40px;
    }

    .team-hero__description {
        font-size: 1.3em;
        width: 90%;
    }

    .team-hero__map {
        flex: 0 0 600px;
        width: 600px;
    }
}

@media only screen and (max-width: 768px) {
    .team-hero {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        text-align: center;
    }

    .team-hero__content {
        padding: 40px 20px;
        max-width: 100%;
        width: 100%;
    }

    .team-hero__title {
        font-size: 36px;
    }

    .team-hero__description {
        font-size: 1.1em;
        width: 100%;
    }

    .team-hero__map {
        width: 100%;
        height: 300px;
        padding: 0;
    }

    .team-hero__map::after {
        display: none;
    }

    .team-hero__map svg {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

/****************************
TEAM CONTENT SECTION
*****************************/

.team-content {
    background-color: #f5f5f5;
    padding: 40px 0;
}

.team-content__container {
    max-width: 1261px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 20px;
}

/****************************
TEAM SIDEBAR
*****************************/

.team-sidebar {
    flex: 0 0 397px;
    background-color: #c5cdd8;
    padding: 30px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.team-sidebar__description {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    font-weight: 400;
}

/****************************
TEAM CONTENT MAIN
*****************************/

.team-content__main {
    flex: 0 0 824px;
    padding: 0;
}

/****************************
TEAM FILTER SECTION
*****************************/

.team-filter-section {
    background-color: #0052cc;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.team-filter__label {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #fff;
    white-space: nowrap;
}

.team-filter__dropdown {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #999;
    border-radius: 3px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    min-width: 150px;
}

.team-filter__dropdown:hover {
    border-color: #666;
}

.team-filter__dropdown:focus {
    outline: none;
    border-color: #0052cc;
    box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.1);
}

/****************************
TEAM LIST (MEMBERS & PARTNERS)
*****************************/

.team-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.team-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.team-item__container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.team-item__photo {
    flex: 0 0 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 2px;
    background-color: #f0f0f0;
}

.team-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.team-item__name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.team-item__name a {
    color: #0052cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.team-item__name a:hover {
    color: #003d99;
    text-decoration: underline;
}

.team-item__name--partner {
    color: #0052cc;
}

.team-item__title {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.team-item__location {
    margin: 0;
    font-size: 14px;
    color: #000;
    font-style: italic;
    font-weight: bold;
}



.team-item__action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-item__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #d4d9e3;
    border-radius: 3px;
    color: #0052cc;
    font-size: 24px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.team-item__link:hover {
    background-color: #c0c7d4;
    color: #003d99;
}

/* Team List Divider */
.team-list__divider {
    margin: 10px 0;
}

.team-list__separator {
    border: none;
    border-top: 2px solid #0052cc;
    margin: 0;
    height: 2px;
    background-color: #0052cc;
}

/****************************
RESPONSIVE (STACK SIDEBAR ABOVE FILTER)
*****************************/

@media (max-width: 1024px) {
    .team-content__container {
        flex-direction: column;
    }

    /* Sidebar becomes a full-width grey box above the filter */
    .team-sidebar {
        order: -1;
        /* ensure it sits above the main/filter if order changes */
        flex: 0 0 auto;
        width: 100%;
        padding: 20px;
        margin: 0 0 20px 0;
        border-radius: 4px;
        background-color: #c5cdd8;
    }

    .team-content__main {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .team-sidebar {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 4px;
    }
}

/****************************
TEAM MODAL
*****************************/

.team-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.team-modal--active {
    visibility: visible;
    opacity: 1;
}

.team-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.team-modal__content {
    position: relative;
    width: 1320px;
    height: 586px;
    max-width: 1320px;
    max-height: 586px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
}

.team-modal__header {
    position: relative;
    padding: 8px 12px;
    background-color: transparent;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 32px;
}

.team-modal__close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    transition: all 0.2s ease;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    line-height: 1;
}

.team-modal__close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.team-modal__body {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.team-modal__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-size: 16px;
}

.team-modal__loading i {
    font-size: 24px;
}

.team-modal__iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
    flex: 1;
}

.error-message {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

/* Prevent body scroll when modal is open */
body.team-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* iOS Safari viewport fix */
@supports (-webkit-touch-callout: none) {
    .team-modal__content {
        height: -webkit-fill-available;
    }

    @media (max-width: 768px) {
        .team-modal__content {
            height: 95vh;
            height: -webkit-fill-available;
        }
    }
}

/* Responsive modal - only apply responsive behavior below 1400px */
@media (max-width: 1400px) {
    .team-modal__content {
        width: 95%;
        height: 85vh;
        max-width: 95%;
        max-height: 85vh;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .team-modal__overlay {
        padding: 10px;
        align-items: center;
    }

    .team-modal__content {
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 8px;
        margin: 0;
    }

    .team-modal__header {
        padding: 10px 15px;
        flex-shrink: 0;
    }

    .team-modal__close {
        font-size: 20px;
        padding: 8px;
    }

    .team-modal__body {
        flex: 1;
        min-height: 0;
    }

    .team-modal__iframe {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .team-modal__overlay {
        padding: 5px;
    }

    .team-modal__content {
        height: 95vh;
        max-height: 95vh;
        border-radius: 4px;
    }

    .team-modal__header {
        padding: 8px 12px;
    }

    .team-modal__close {
        font-size: 18px;
        padding: 6px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .team-modal__content {
        max-height: 98vh;
        height: 98vh;
    }

    .team-modal__overlay {
        padding: 2px;
        padding-top: 5px;
    }

    .team-modal__header {
        padding: 6px 12px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .team-modal__overlay {
        padding: 0;
    }

    .team-modal__content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .team-modal__header {
        padding: 6px 10px;
    }
}

/* Ensure modal is accessible on all screen sizes */
@media (max-height: 500px) {
    .team-modal__content {
        max-height: 100vh;
        height: 100vh;
    }

    .team-modal__overlay {
        padding: 0;
        align-items: stretch;
    }
}

/* Prevent body scroll when modal is open */
body.team-modal-open {
    overflow: hidden;
}

/* Responsive modal */
@media (max-width: 768px) {
    .team-modal__overlay {
        padding: 0;
    }

    .team-modal__content {
        height: 100vh;
        border-radius: 0;
    }

    .team-modal__header {
        padding: 10px 15px;
    }

    .team-modal__body {
        height: calc(100vh - 50px);
    }
}