#map-container {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1380/830;
    width: 80vw;
    min-width: 300px;
}
#map-container img {
    width: 100%;
}
#world-map {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
}

#pin-container {
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.pin {
    display: block;
    width: calc(10000%/1920);
    height: auto;
    aspect-ratio: 1/1;
    background: url('') no-repeat center/cover;
    border-radius: 50%;

    position: absolute;
    transition: all 0.5s ease;
    transform-origin: center bottom;
    cursor: pointer;
    transform: translate(50%, 50%) scale(0.5);
    opacity: 0;
}

.pin.visible {
    opacity: 1;
    transform: translate(50%, 50%) scale(1);
}
.pin:hover {
    transform: translate(50%, 50%) scale(1.2);
    filter: saturate(1);
    z-index: 5;
}

#pin-tooltip {
    position: absolute;
    z-index: 1;
    opacity: 0;
    width: 510px;
    max-width: 100%;
    min-width: 360px;
    top: 50%;
    left: 50%;
    margin-left: auto;
    margin-right: auto;
    transform: translate(-50%, -30%);
    height: auto;
    background: white;
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    border-radius: 30px;
}



#pin-tooltip.visible {
    transition: opacity 0.3s ease;
}

#pin-tooltip h4,
#pin-tooltip a {
    color: #142A6E;
}


#pin-tooltip a.story-read-more::after {
    content: "";
    display: block;
    width: 26px;
    height: 14px;
    background: url('../images/arrow-right-pink.svg') no-repeat center/contain;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

#pin-tooltip a:hover:after {
    transform: translateX(10px);
}

#pin-tooltip .story-content {
    display: flex;
    gap: 5%;
    align-items: stretch;
    font-size: 18px;
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 400;
    flex-direction: column;
    padding: 80px 38px 50px;
    color: #455C98;
}
#stories .story-content {
    color: #455C98;
}
#pin-tooltip .story-content .project-details,
#stories .story-content .project-details {
    text-align: center;
    
}
#pin-tooltip .story-content .project-details h5,
#stories .story-content .project-details h5 {
    font-weight: 600;
}
#pin-tooltip .story-content .project-details .label,
#stories .story-content .project-details .label {
    text-transform: uppercase;
    color: white;
    font-weight: 600;
    border-radius: 40px;
    padding: 10px 30px;
    background-color: #00AEA8;
    display: inline-block;
    margin-bottom: 30px;
}
#pin-tooltip .story-header {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    padding-left: 60px;
    border-radius: 30px;
    margin-left: 50px;
    margin-right: 50px;
    margin-bottom: 20px;
    background-color: #BFEAE9;
    border: 1px solid #00AEA8;
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 600;
    line-height: 30px;
    font-size: 26px;
    color: #2B3E70
}
#pin-tooltip .story-header button {
    display: none;
}
#pin-tooltip .story-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}




#pin-tooltip .story-title {
    margin-top: 0;
    font-size: 24px;
    font-weight: 700;
}

#pin-tooltip .story-read-more {
    font-size: 20px;
    display: inline-flex;
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: center;
    text-decoration: none;
    font-weight: bold;
}

#pin-tooltip .story-content .story-footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    width: 100%;
    align-items: center;
    margin-top: auto;
}

#pin-tooltip .story-programme {
    border-radius: 30px;
    color: white;
    background-color: #C6005F;
    padding: 5px 20px;
}

@media screen and (max-width: 1440px) {

    #pin-tooltip .story-title {
        font-size: 20px;
    }

    #pin-tooltip .story-content {
        font-size: 16px;
    }

    #pin-tooltip .story-read-more {
        font-size: 16px;
    }
}

@media screen and (max-width: 1280px) {
    #pin-tooltip .story-title {
        font-size: 18px;
    }

    #pin-tooltip .story-content {
        font-size: 14px;
    }

    #pin-tooltip .story-read-more {
        font-size: 14px;
    }
}


#pin-tooltip .story-content p {
    margin-top: 0;
}

#pin-tooltip-close {
    position: absolute;
    width: 30px;
    height: 30px;
    right: 10px;
    top: 10px;
    cursor: pointer;
    color: black;
}

#pin-tooltip-close:hover {
    color: #C6005F;
}

#pin-tooltip-close svg {
    width: 100%;

}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pinBounce {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Country pin styles */
.pin-benin {
    background-image: url('../images/map/benin.svg');
    top: 50%;
    left: 42%;
}

.pin-burkina-faso {
    background-image: url('../images/map/burkina-faso.svg');
    top: 45%;
    left: 32%;
}

.pin-cameroon {
    background-image: url('../images/map/cameroon.svg');
    top: 74%;
    left: 67%;
}

.pin-chad {
    background-image: url('../images/map/chad.svg');
    top: 34%;
    left: 80%;
}

.pin-gambia {
    background-image: url('../images/map/gambia.svg');
    top: 39.9%;
    left: -1%;
}

.pin-ghana {
    background-image: url('../images/map/ghana.svg');
    top: 65%;
    left: 33.7%;
}

.pin-guinea-bissau {
    background-image: url('../images/map/guinea-bissau.svg');
    top: 46%;
    left: 3%;
}

.pin-guinea {
    background-image: url('../images/map/guinea.svg');
    top: 53%;
    left: 12%;
}

.pin-ivory-coast {
    background-image: url('../images/map/ivory-coast.svg');
    top: 63%;
    left: 23%;
}

.pin-mali {
    background-image: url('../images/map/mali.svg');
    top: 19%;
    left: 33%;
}

.pin-niger {
    background-image: url('../images/map/niger.svg');
    top: 24%;
    left: 61%;
}

.pin-nigeria {
    background-image: url('../images/map/nigeria.svg');
    top: 57%;
    left: 55%;
}

.pin-senegal {
    background-image: url('../images/map/senegal.svg');
    top: 33%;
    left: 2%;
}

.pin-togo {
    background-image: url('../images/map/togo.svg');
    top: 58%;
    left: 38%;
}


#stories {
    display: none;
}
#stories .story-header {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    align-items: center;
    padding: 5px;
    border-radius: 30px;
    background-color: #BFEAE9;
    border: 1px solid #00AEA8;
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 600;
    line-height: 30px;
    font-size: 26px;
    color: #2B3E70
}
#stories .story-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
#stories .story-header button {
    padding: 0;
    border: none;
    margin-left: auto;
}

@media screen and (max-width: 768px) {
    #map-container {
        width: 100%;
    }
    #stories {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin: 40px auto;
        max-width: 100%;
        padding: 0 10px;
    }
    #stories>div {
        background-color: #fff;
        border-radius: 30px;
    }
    #pin-tooltip {
        display: none !important;
    }
    /* #stories>div:nth-child(n+3) {
        display: none;
    } */

    .sories-page-map #stories>div {
        display: block;
    }
    #stories .story-content > div:not(.story-header) {
        padding: 20px;
    }
    #stories .story-content:not(.active) > div:not(.story-header) {
        display: none;
    }
    #stories .active .story-header button svg line:nth-child(2) {
        display: none;
    }


}